<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zaman shovon</title>
    <description>The latest articles on DEV Community by zaman shovon (@mzshovon).</description>
    <link>https://dev.to/mzshovon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F226917%2F8676e5c9-c699-41b7-bb47-128d8da592ff.png</url>
      <title>DEV Community: zaman shovon</title>
      <link>https://dev.to/mzshovon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mzshovon"/>
    <language>en</language>
    <item>
      <title>Laravel Resource or Customized Repo?</title>
      <dc:creator>zaman shovon</dc:creator>
      <pubDate>Wed, 21 Aug 2024 04:10:10 +0000</pubDate>
      <link>https://dev.to/mzshovon/laravel-resource-or-customized-repo-3h6n</link>
      <guid>https://dev.to/mzshovon/laravel-resource-or-customized-repo-3h6n</guid>
      <description>&lt;p&gt;Earlier this week, when working with the Laravel Rest API, I encountered an annoyance in the form of a timeout error. It leads to end-user frustration with development concerns. Let me brief the total scenario:&lt;/p&gt;

&lt;p&gt;I needed to load data from an external data source, filter it, then prepare it for a json return. The amount of data was not large, only around 10K in a single request. The main problem occurred when I tried to format them after retrieving and filtering them. So, i started to debug using following step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Check the query is optimized and columns are indexed as well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make sure use of chunk method&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the formatting repo doesn’t use any unnecessary method/reference/implementation/unused functions/external api calling.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All checks are done but still it shows Gateway Timeout Error as it exceeds more than 1 minute. The service class looks like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoprm8x1bmu5moerg387.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxoprm8x1bmu5moerg387.png" alt="Formatting Repo&amp;lt;br&amp;gt;
" width="800" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repo class looks like below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnw6nd7v89bx4o33iz02g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnw6nd7v89bx4o33iz02g.png" alt="Formatting Repo" width="800" height="685"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In naked eye, It shouldn’t throw timeout error for 10K+ data processing and manipulating. We will discuss at the end why it happens(mayn’t be actual concrete reason but probable) and now discuss how i resolve it using &lt;a href="https://laravel.com/docs/10.x/eloquent-resources" rel="noopener noreferrer"&gt;Laravel Api Resource&lt;/a&gt;.&lt;/p&gt;



&lt;p&gt;Its simple to implement. First, generate Laravel Api Resource from command line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:resource DataFormatterResource

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, send your model object to resource and format/manipulate your data as per requirement given below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtpjdre2r2lqs62nzlpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtpjdre2r2lqs62nzlpg.png" alt="Service Layer for business logic" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj1texa5k2v5h4729vx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftj1texa5k2v5h4729vx5.png" alt="Formatting Resource" width="710" height="910"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Surprisingly, It only took 3.7 seconds to response 😮!&lt;br&gt;
I tried to dig out the real issue here and found some probable cases that mentioned on top to define at the end. The cases are given:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Laravel API resources provide a consistent interface for accessing and manipulating data where i use repo with some dependency injection in it. This makes it easier to write efficient code and to avoid common performance bottlenecks.&lt;/li&gt;
&lt;li&gt;Laravel API resources are optimized for performance as they use caching and other techniques to improve the speed of data retrieval and processing where i only go for chunk of array raw formatting.&lt;/li&gt;
&lt;li&gt;Laravel API resources automatically serialize the results of database queries to JSON or XML, depending on the request headers. This saves you the hassle of having to write your own serialization code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At most of my project’s services, I utilized repo or functional formatter at the service layer, but in this case, I had a difficulty where there may be other causes for this issue to occur.&lt;br&gt;
What I wanted to emphasize is that Laravel Resources might come in handy in some tricky situations when working with models.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you like this article leave a clap or comment. &amp;lt;?= “Happy coding!….” ?&amp;gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>database</category>
      <category>resource</category>
    </item>
    <item>
      <title>Cache driver switch in Laravel while failing connection</title>
      <dc:creator>zaman shovon</dc:creator>
      <pubDate>Thu, 02 Mar 2023 14:27:36 +0000</pubDate>
      <link>https://dev.to/mzshovon/cache-driver-switch-in-laravel-while-failing-connection-156e</link>
      <guid>https://dev.to/mzshovon/cache-driver-switch-in-laravel-while-failing-connection-156e</guid>
      <description>&lt;h2&gt;
  
  
  Common Usage of Cache Driver
&lt;/h2&gt;

&lt;p&gt;While working with small projects ex. SPA(Single Page Application), Module based feature(Payment Gateway), Small service provider etc. no need to deal with big sets of data while rendering. But while working with large scale application with proper scalability, Less rendering time and faster data loading we often face with loading issue and database connection issue.&lt;/p&gt;

&lt;p&gt;To mitigate those issues, We often use cache driver to store data for certain time to process data faster and there no need to fetch from database or query from there. &lt;/p&gt;

&lt;p&gt;Laravel &lt;a href="https://laravel.com/docs/8.x/cache"&gt;cache driver&lt;/a&gt; is used in some large-scale application to maintain data readability, faster execution and data filtering. But when comes the worst scenario mentioned below what we have to do is to deal with some exceptions with bare hand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Cache driver failed to connect ex. &lt;strong&gt;Redis&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cache driver stop responding or shut down for some issue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data storing or data fetching unknown exception raised.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For those, Application falls and client disappointment is raised too high. To prevent this kind of situation, We have to switch immediately from one cache driver to another without delay and not manually.&lt;/p&gt;

&lt;p&gt;In Laravel, There is a tricky but much efficient to do switch cache drivers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Switch cache driver in Laravel
&lt;/h2&gt;

&lt;p&gt;Suppose, We set &lt;strong&gt;Redis&lt;/strong&gt; as cache driver but we have file driver for cache storing as well. If &lt;strong&gt;Redis&lt;/strong&gt; shut down accidently, We have to switch to file driver by using below operation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class CacheConnectionValidator // Cache connection checker
{
    /**
     * @return void
     */
    public static function checkAndUpdateCacheDriver() : void
    {
        $redis_host = env("REDIS_HOST"); // primary set cache host
        $redis_port = env("REDIS_PORT"); // primary set cache host port
        if(!self::checkPortConnection($redis_host,$redis_port)){
            config(['cache.default' =&amp;gt; 'file']);
        }
    }

    /**
     * @param string $redis_host
     * @param string $redis_port
     *
     * @return bool
     */
    private static function checkPortConnection($redis_host,$redis_port) // check host return response
    {
        try{
            $connection = fsockopen($redis_host, $redis_port, $errno, $errstr, 20);
            if( !$connection ){
                return false;
            } else {
                return true;
            }
        } catch(Exception $e){
            return false;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;strong&gt;CacheConnectionValidator&lt;/strong&gt; class will check, validate and set the storage for default cache driver for data processing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.php.net/manual/en/function.fsockopen.php"&gt;fsockopen()&lt;/a&gt; is used here to open the external source socket connection to check connection establishment during any application runtime. We can use &lt;a href="https://www.php.net/manual/en/function.pfsockopen.php"&gt;pfsockopen()&lt;/a&gt; which is identical to fsockopen() but fsockopen() is closing after script finishing but pfsockopen() is running even after script finishing.&lt;br&gt;
If connection returns true, It means the host is responding but if the connection returns false immediately set the file as default cache driver.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        // While boot the class will be called
        CacheConnectionValidator::checkAndUpdateCacheDriver();
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;CacheConnectionValidator&lt;/strong&gt; class should be registered in boot function in &lt;strong&gt;AppServiceProvider&lt;/strong&gt; to load the script.&lt;/p&gt;

&lt;p&gt;The whole process is sketched in following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NbLat4hP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eefxf2hum4g36bon5ehp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NbLat4hP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eefxf2hum4g36bon5ehp.png" alt="Cache storage switch journey" width="880" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are lot more packages ex. Predis, PhpRedis to catch the Redis connection exception but they sometimes unable to catch exception while falling in runtime. So, It will be secure and safe to use php built in functions to catch the exception and take immediate action&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Have a good lara-day 😎&lt;/p&gt;

</description>
      <category>redis</category>
      <category>laravel</category>
      <category>cache</category>
      <category>storage</category>
    </item>
    <item>
      <title>Laravel Worker with super-visor</title>
      <dc:creator>zaman shovon</dc:creator>
      <pubDate>Mon, 10 Oct 2022 07:01:02 +0000</pubDate>
      <link>https://dev.to/mzshovon/laravel-worker-with-super-visor-34ln</link>
      <guid>https://dev.to/mzshovon/laravel-worker-with-super-visor-34ln</guid>
      <description>&lt;p&gt;Many of us struggled to setup &lt;strong&gt;supervisor&lt;/strong&gt; with &lt;strong&gt;Laravel Worker&lt;/strong&gt; in our docker container or web-server. If you don't then you are lucky not as me. 😉 &lt;/p&gt;

&lt;p&gt;If you are struggling to do or you want to know about what is job, how supervisor maintain the jobs inside a docker-container or web-server, how to setup all these stuffs then you are in right post i guess.&lt;/p&gt;

&lt;p&gt;Follow my journey that let you know something informative.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Setup laravel queue:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan queue:table
php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After migrating, You should find 2 tables named &lt;strong&gt;failed_jobs&lt;/strong&gt; &amp;amp; &lt;strong&gt;jobs&lt;/strong&gt;. If you don't then follow the procedure again or check &lt;a href="https://laravel.com/docs/9.x/queues" rel="noopener noreferrer"&gt;laravel queue&lt;/a&gt; for better understanding.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup job batches to keep track of jobs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan queue:batches-table
php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see table named &lt;strong&gt;job_batches&lt;/strong&gt;. To learn more about batch jobs, Check the beautiful documentation of &lt;a href="https://laravel.com/docs/9.x/queues#defining-batchable-jobs" rel="noopener noreferrer"&gt;batch jobs laravel&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup some test methods for batch jobs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    public function testJob() {
        $path = storage_path('test');
        $files = glob("$path/user.csv"); // Parse the stored csv
        $header = [];
        foreach ($files as $key =&amp;gt; $file) {
            $data = array_map('str_getcsv', file($file));
            if($key === 0) {
                $header = $data[0];
                unset($data[0]);
            }
        }
        $batch = Bus::batch([new TestCsvForSupervisor($header, 
        $data)-&amp;gt;dispatch();
        return $batch-&amp;gt;id;
    }

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;What we do here?&lt;/u&gt;&lt;br&gt;
Ok, we've imported a csv with 100 thousand users information ex. email, username, address etc. &lt;strong&gt;TestCsvForSupervisor&lt;/strong&gt; is the job class for handling some checks or operation like insert, update or comparing datas with any table ex. users. Simple as writing artisan command. 😉&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In TestCsvForSupervisor Job Class:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    public function handle()
    {
        try{
            foreach ($this-&amp;gt;data as $row) {
                $result = array();
                $result = User::whereName($row[0])-&amp;gt;first() ? 'Found' : 'Not Found';
                Log::info('User checked successfully with email: '.$row[1]);
            }
        } catch (Exception $err) {
            Log::info('Error occured with message: '.$err);
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tough one, I have 20 thousand users information in my users table and what I've done here? Compare csv data with users table data and store the checking result in log (You might find it clueless but it's just a test case actually not good test case😒). Then dispatch the job to store the pending jobs to be done in table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup supervisor
&lt;/h2&gt;

&lt;p&gt;Now it's time for setup supervisor into docker container where you can follow 2 steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can access docker bash and install supervisor by command scripts (It is for local testing not for global deployment or team collaboration)&lt;/li&gt;
&lt;li&gt;You can integrate the command scripts in Dockerfile.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Before digging into both please let me inform you some details about supervisor&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Supervisor is basically linux based daemon that runs in the background. You have to configure your laravel app so that supervisor know about background jobs. It monitors the executing or executable jobs and if for any interference the jobs accidentally stop ex. server down after the restarting the supervisor automatically starts the job from where it stops and monitor the failed, pending and success jobs through this time and can deliver us jobs report.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Install from docker bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install supervisor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install from Dockerfile using Daemon&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In your app/docker-conf/php/Dockerfile, Write the following script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RUN apt-get install -y supervisor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, build and start the docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker compose build
docker compose up -d // -d for running the docker in background
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I will suggest you to follow the docker daemon-based (step-2) supervisor because it can be used globally. So, we will be continuing with that.&lt;/p&gt;

&lt;p&gt;In your root directory make file named &lt;strong&gt;laravel-worker.conf&lt;/strong&gt; and write and save the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /app/artisan queue:work // you may use extra attributes like --sleep=3
autostart=true
autorestart=true
# stopasgroup=true
# killasgroup=true
;user=
numprocs=8
redirect_stderr=true
stdout_logfile=/app/storage/logs/worker.log​
stopwaitsecs = 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the docker bash, you will find file named &lt;strong&gt;supervisord.conf&lt;/strong&gt; in /etc/supervisor/ directory. Overwrite the last line of the &lt;strong&gt;supervisord.conf&lt;/strong&gt; file by following script and save it:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[include]&lt;br&gt;
files = /etc/supervisor/conf.d/*.conf  /app/laravel-worker.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that, Execute the following commands to initiate supervisor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Start the service
  service supervisor start

# Read the new config from supervisord file
  supervisorctl reread

# Activate the configuration
  supervisorctl update

# Start queue command for running jobs
  supervisorctl start laravel-worker:* or laravel-worker

# Check the status of new config operation
  supervisorctl status​
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Congrats 🥳, You've just did a great job not just laravel-job but the real automated jobs using supervisor.&lt;/p&gt;

&lt;p&gt;You may find the job list with status and unique id from &lt;strong&gt;job_batches&lt;/strong&gt; table after starting supervisor like below shot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fblfkpyn8psty83igwzf0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fblfkpyn8psty83igwzf0.png" alt="Batch jobs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There is one interesting fact about supervisor. Do you know what language used to develop supervisor?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's &lt;strong&gt;Python&lt;/strong&gt; 🐍😲&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         Thanks for reading with so much patience. ❤️
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>laravel</category>
      <category>supervisor</category>
      <category>worker</category>
      <category>job</category>
    </item>
    <item>
      <title>DSA vs Generic System Dev</title>
      <dc:creator>zaman shovon</dc:creator>
      <pubDate>Mon, 25 Apr 2022 16:08:23 +0000</pubDate>
      <link>https://dev.to/mzshovon/dsa-vs-generic-system-dev-3fpo</link>
      <guid>https://dev.to/mzshovon/dsa-vs-generic-system-dev-3fpo</guid>
      <description>&lt;p&gt;I am a new one here(Dev.to) and in my &lt;strong&gt;2+&lt;/strong&gt; year of dev career I have faced a lot of challenges over many micro and robust project.&lt;/p&gt;

&lt;p&gt;Mostly the challenge I have faced that maintaining system architecture and handling more data in less time and in a convenient way(bugless/non-conflict).&lt;/p&gt;

&lt;p&gt;Some points we usually use Generic coding over DSA are mentioned below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Because of limited deadline, Most of us use template which may be open-source or already in our git storage(Previous project reference). To meet the tight deadline and make sure less buggy product, We often follow this trend and almost all of them are written in generic method calling and packed by sometimes oop's(Object Oriented Programming System) or redundant method calling! So, we have less scope to implement or even fix where to use DSA.😐&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If we develop the project from the scratch, Most of us always love to use some built-in methods, open source packages or as usual array-looping execution over DSA. This is because we feel comfort to use those or we are very used to use those. We think of using recursive loop over binary search because we feel ok with that but we barely think about memory-optimization/time-complexity/space-complexity!!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Those mentioned points can be different for others but the motive is almost same for everyone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have been a team member of a robust project since 2021 and I have faced a lot of issues while handling huge amount of data at a time. We have used &lt;strong&gt;Django&lt;/strong&gt; and we thought that as Django is faster and can handle more requests per second. But we were wrong. This million dollar project is becoming slower while database is becoming heavier day by day. While digging the main reason, We have found that if we used DSA at some modules, System won't be slow so earlier! 😓&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>django</category>
      <category>recursion</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
