<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pathum Sandeepa on Medium]]></title>
        <description><![CDATA[Stories by Pathum Sandeepa on Medium]]></description>
        <link>https://medium.com/@pathumsandeepa13?source=rss-2a30935b9c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Pj8i-tIrK68GsoOpKETRxA.png</url>
            <title>Stories by Pathum Sandeepa on Medium</title>
            <link>https://medium.com/@pathumsandeepa13?source=rss-2a30935b9c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:43:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pathumsandeepa13/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Schedulers in Spring Boot: From Simple Tasks to Production-Ready Jobs]]></title>
            <link>https://medium.com/@pathumsandeepa13/understanding-schedulers-in-spring-boot-from-simple-tasks-to-production-ready-jobs-7fc400dccfd6?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fc400dccfd6</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[scheduler]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 06:14:51 GMT</pubDate>
            <atom:updated>2026-11-16T06:14:51.390Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mQyy5sufiPIdaGoIcWW9A.jpeg" /></figure><p>When I started working with Spring Boot, I was asked to develop a scheduler for one of our backend services. I was already familiar with Laravel and had some experience creating scheduled tasks using Laravel’s task scheduler. However, Spring Boot was still new to me, so I had to learn how scheduling works in the Java ecosystem.</p><p>While building it, I realised that the basic idea of scheduling tasks is quite simple. The interesting part is understanding how to make those tasks reliable, avoid duplicate executions, handle failures, and make sure they behave correctly in a real-world application.</p><p>I decided to write this article to share what I learned along the way. I’ll start with the basics and gradually move into practical examples and some best practices that are worth following when building schedulers in Spring Boot.</p><p>You don’t need any previous Spring Boot or scheduler experience to follow along.</p><h3>1. First, what is Spring Boot?</h3><p>Spring Boot is a Java framework built on top of the Spring Framework that makes it easier to build standalone applications, REST APIs, and backend services. It handles much of the configuration for us through auto-configuration, starter dependencies, and built-in server support, so we can focus more on writing application logic instead of setting everything up manually.</p><h3>Why use Spring Boot instead of other frameworks?</h3><p>There are several reasons why developers choose Spring Boot:</p><ol><li><strong>Less configuration:</strong> It provides sensible defaults and automatically configures many things based on the dependencies in your project.</li><li><strong>Easy to get started:</strong> Starter dependencies make it simple to add features such as database access, security, and API development.</li><li><strong>Production-friendly:</strong> It supports monitoring, health checks, logging, and other features that are useful when running applications in production.</li><li><strong>A strong ecosystem:</strong> It works well with databases, messaging systems, cloud platforms, and many other tools used in modern backend development.</li></ol><p>Of course, Spring Boot isn’t automatically the best choice for every project. Different frameworks have different strengths. However, when building Java-based backend applications, Spring Boot provides a useful combination of flexibility, productivity, and a mature ecosystem.</p><h3>2. What exactly is a scheduler?</h3><p>Let’s forget about programming for a moment.</p><p>Imagine you run an online shopping application. Every day at 9 AM, you need to send reminders to customers who haven’t completed their payments.</p><p>Would you open your computer every morning and manually run the code?</p><p>Probably not.</p><p>Instead, you would tell your application:</p><p>“Run this task every day at 9 AM.”</p><p>That’s basically what a scheduler does.</p><p>A <strong>scheduler is a mechanism that automatically executes a particular task at a scheduled time or after a specified interval.</strong></p><p>You don’t need someone to trigger it manually. Once configured, the application takes care of running it.</p><p>You might already be using schedulers without realising it. For example:</p><ul><li>Sending payment reminders to customers.</li><li>Generating daily reports.</li><li>Deleting expired temporary records.</li><li>Updating exchange rates.</li><li>Checking whether subscriptions have expired.</li><li>Synchronising data with another system.</li><li>Sending notifications for upcoming appointments.</li><li>Processing records that are waiting for approval.</li></ul><p>These are all good examples of tasks that can be handled by a scheduler.</p><h3>3. Why do we need schedulers?</h3><p>Let’s say your application needs to generate a daily transaction report.</p><p>You could create a REST API endpoint like this:</p><pre>@PostMapping(&quot;/generate-report&quot;)<br>public ResponseEntity&lt;String&gt; generateReport() {<br>    reportService.generateDailyReport();<br>    return ResponseEntity.ok(&quot;Report generated&quot;);<br>}</pre><p>Now, someone needs to call this endpoint every day.</p><p>You could use Postman, another service, or even a separate script. But now you’ve introduced another dependency just to trigger something that should happen automatically.</p><p>A scheduler solves this problem.</p><p>Instead of depending on someone or something to call an API, we can configure the application to execute the task automatically.</p><p>This makes scheduled operations easier to manage and reduces the need for manual intervention.</p><p>One important thing to understand is that a scheduler doesn’t necessarily make a task faster. Its main purpose is to make sure a task runs automatically at the right time.</p><h3>4. How does scheduling work in Spring Boot?</h3><p>Spring Boot provides scheduling support through the @Scheduled annotation.</p><p>Before using it, we need to enable scheduling in our application.</p><h3>Step 1: Enable scheduling</h3><p>Open your main Spring Boot application class.</p><pre>@SpringBootApplication<br>@EnableScheduling<br>public class MyApplication {<br>public static void main(String[] args) {<br>        SpringApplication.run(MyApplication.class, args);<br>    }<br>}</pre><p>The important part here is:</p><pre>@EnableScheduling</pre><p>This tells Spring to look for methods annotated with @Scheduled and arrange for them to execute according to their configured schedules.</p><p>Without enabling scheduling, your scheduled methods won’t run.</p><h3>Step 2: Create your first scheduler</h3><p>Let’s create a simple scheduler that prints a message every five seconds.</p><pre>@Component<br>public class MyFirstScheduler {<br>@Scheduled(fixedRate = 5000)<br>public void runTask() {<br>        System.out.println(&quot;Hello! This task runs automatically.&quot;);<br>    }<br>}</pre><p>That’s it. We have created our first Spring Boot scheduler.</p><p>Let’s understand what’s happening here.</p><p><strong>@Component</strong></p><p>This annotation tells Spring that this class should be managed by the Spring container. Spring creates the object and makes it available to the application.</p><p><strong>@Scheduled(fixedRate = 5000)</strong></p><p>This tells Spring to execute the method at a fixed rate of 5,000 milliseconds, which is five seconds.</p><p><strong>runTask()</strong></p><p>This is the actual method that gets executed.</p><p>You don’t need to call this method manually. Spring handles the scheduling and execution for you.</p><p>One thing to remember is that scheduled methods must not accept method parameters. Their return values are also not used by the scheduler.</p><h3>5. Understanding the different scheduling options</h3><p>This is where things become interesting.</p><p>Spring Boot provides different ways to schedule tasks. The three options you’ll commonly use are:</p><ul><li>fixedRate</li><li>fixedDelay</li><li>cron</li></ul><p>They may look similar, but they behave differently.</p><h3>5.1 Fixed Rate</h3><p>fixedRate runs a task at a regular interval, measured from the start of one execution to the start of the next scheduled execution.</p><pre>@Scheduled(fixedRate = 5000)<br>public void runTask() {<br>    System.out.println(&quot;Executing fixed-rate task&quot;);<br>}</pre><p>Here, Spring schedules the task every five seconds.</p><p>Imagine the task starts at 10:00:00 and finishes at 10:00:01. The next execution is scheduled for around 10:00:05.</p><p>A fixed-rate schedule is useful when you want a task to run at regular intervals, regardless of how long the previous execution took.</p><p>However, the scheduler doesn’t normally run the same periodic task concurrently on the same scheduling thread. If an execution takes longer than the interval, the next execution can start later than planned.</p><h3>5.2 Fixed Delay</h3><p>fixedDelay works differently.</p><p>It waits until the previous execution finishes and then starts counting the delay before running the task again.</p><pre>@Scheduled(fixedDelay = 5000)<br>public void runTask() {<br>    System.out.println(&quot;Executing fixed-delay task&quot;);<br>}</pre><p>Let’s assume the task starts at 10:00:00 and takes two seconds to finish.</p><p>The execution finishes at 10:00:02.</p><p>Spring then waits another five seconds before starting the next execution, which would be around 10:00:07.</p><p>So, the important difference is:</p><ul><li><strong>Fixed Rate:</strong> Measures the interval between scheduled execution start times.</li><li><strong>Fixed Delay:</strong> Measures the delay after the previous execution finishes.</li></ul><p>For tasks that should wait until the previous execution has completed before starting the next cycle, fixedDelay is often a good choice.</p><h3>5.3 Cron Expression</h3><p>Now let’s talk about the option you’ll probably use most often in real-world applications.</p><p>A cron expression allows us to define a specific schedule using time-based rules.</p><p>For example, imagine we need to generate a daily report at 9 AM.</p><p>Instead of running it every five seconds or every five minutes, we can use:</p><pre>@Scheduled(cron = &quot;0 0 9 * * *&quot;)<br>public void generateDailyReport() {<br>    System.out.println(&quot;Generating daily report...&quot;);<br>}</pre><p>This tells Spring to execute the method every day at 9 AM.</p><p>Let’s break down the cron expression:</p><pre>0 0 9 * * *<br>│ │ │ │ │ │<br>│ │ │ │ │ └── Day of the week<br>│ │ │ │ └──── Month<br>│ │ │ └────── Day of the month<br>│ │ └──────── Hour<br>│ └────────── Minute<br>└──────────── Second</pre><p>Spring’s cron expressions use six fields, including seconds.</p><p>Here are some useful examples:</p><p>Cron expression Meaning0 * * * * *Every minute0 */5 * * * *Every five minutes0 0 * * * *Every hour0 0 9 * * *Every day at 9 AM0 0 9 * * MON-FRIEvery weekday at 9 AM0 30 18 * * *Every day at 6:30 PM0 0 0 1 * *At midnight on the first day of every month</p><p>You don’t have to memorise all these expressions.</p><p>I usually recommend keeping a cron expression reference nearby when working with scheduled tasks. It’s much easier than trying to remember every field.</p><h3>6. Let’s build a real-world scheduler</h3><p>So far, we’ve only printed messages to the console.</p><p>Let’s build something more realistic.</p><p>Imagine we’re developing a payment management system. Some customers have pending payments, and we need to send them reminders every day.</p><p>The process would look something like this:</p><ol><li>The scheduler runs at the configured time.</li><li>It calls a service responsible for finding pending payments.</li><li>The service gets the relevant records from the database.</li><li>Reminder notifications are sent</li><li>The system records which reminders were successfully processed.</li></ol><p>Let’s implement a simple version of this.</p><h3>Step 1: Add the scheduling configuration</h3><p>Instead of hardcoding the cron expression directly inside our Java class, let’s keep it in application.yml.</p><pre>app:<br>  scheduling:<br>    payment-reminder-cron: &quot;0 0 9 * * *&quot;<br>    time-zone: &quot;Asia/Colombo&quot;</pre><p>Why do this?</p><p>Imagine that the business later decides to send reminders at 10 AM instead of 9 AM.</p><p>If the expression is hardcoded, we need to modify the source code and deploy the application again.</p><p>By keeping it in configuration, we can change the schedule without modifying the Java class.</p><p>This also makes it easier to use different schedules for development, testing, and production environments.</p><h3>Step 2: Create the scheduler class</h3><pre>@Component<br>@RequiredArgsConstructor<br>@Slf4j<br>public class PaymentReminderScheduler {<br><br>    private final PaymentReminderService paymentReminderService;<br><br>    @Scheduled(<br>        cron = &quot;${app.scheduling.payment-reminder-cron}&quot;,<br>        zone = &quot;${app.scheduling.time-zone}&quot;<br>    )<br>    public void sendPaymentReminders() {<br><br>        log.info(&quot;Payment reminder scheduler started&quot;);<br><br>        int processedCount =<br>            paymentReminderService.sendPendingPaymentReminders();<br><br>        log.info(<br>            &quot;Payment reminder scheduler completed. Processed: {}&quot;,<br>            processedCount<br>        );<br>    }<br>}</pre><p>Let’s understand what we’re doing here.</p><p><strong>@RequiredArgsConstructor</strong></p><p>This is a Lombok annotation. It generates a constructor for the required fields, allowing Spring to inject PaymentReminderService through constructor injection.</p><p><strong>@Slf4j</strong></p><p>This generates a logger so we can write useful log messages instead of using System.out.println().</p><p><strong>@Scheduled</strong></p><p>This tells Spring when the method should execute.</p><p>Notice that we’re using:</p><pre>cron = &quot;${app.scheduling.payment-reminder-cron}&quot;</pre><p>We’re reading the cron expression from our configuration file rather than hardcoding it.</p><p>We’re also setting the timezone:</p><pre>zone = &quot;${app.scheduling.time-zone}&quot;</pre><p>This is important because the server’s default timezone may be different from the timezone used by the business.</p><p>For example, if your application runs on a server in another country, you probably don’t want your 9 AM Sri Lankan reminder to be sent at 9 AM in the server’s timezone.</p><h3>Step 3: Create the service</h3><p>I prefer keeping the scheduler responsible for triggering the operation and moving the actual business logic into a separate service.</p><p>Why?</p><p>Because sending payment reminders is business logic. It shouldn’t be tightly coupled to the scheduling mechanism.</p><pre>@Service<br>@RequiredArgsConstructor<br>@Slf4j<br>public class PaymentReminderService {<br><br>    private final PaymentRepository paymentRepository;<br>    private final NotificationService notificationService;<br><br>    @Transactional<br>    public int sendPendingPaymentReminders() {<br><br>        List&lt;Payment&gt; pendingPayments =<br>            paymentRepository.findTop100ByStatusOrderByDueDateAsc(<br>                PaymentStatus.PENDING<br>            );<br><br>        int processedCount = 0;<br><br>        for (Payment payment : pendingPayments) {<br><br>            notificationService.sendPaymentReminder(payment);<br><br>            payment.markReminderAsSent();<br><br>            processedCount++;<br>        }<br><br>        return processedCount;<br>    }<br>}</pre><p>This is a simplified example. The repository method and entity methods would need to match your actual application.</p><p>Notice that we’re using:</p><pre>@Transactional</pre><p>This tells Spring to execute the service operation inside a database transaction.</p><p>It is useful when multiple database changes need to be committed together. However, an important detail is that a database transaction cannot automatically roll back an email or an external API request that has already been sent.</p><p>For example, if a notification is successfully sent but a later database operation fails, the notification cannot simply be undone.</p><p>For more complex notification workflows, an outbox pattern is often a better choice. We’ll discuss that in the best practices section.</p><p>Also notice that we’re retrieving only the first 100 pending payments.</p><p>This is intentional. Loading thousands or even millions of records into memory at once is not a good idea. In production, you should process large datasets in manageable batches.</p><h3>7. Best practices when building Spring Boot schedulers</h3><p>Creating a scheduler is easy. Building one that behaves correctly in production requires a little more thought.</p><p>These are some of the things I would pay attention to.</p><h3>7.1 Don’t put business logic inside the scheduler</h3><p>This is probably one of the most important things to remember.</p><p>Avoid writing all your database queries, calculations, and notification logic directly inside a method annotated with @Scheduled.</p><p>For example, avoid this approach:</p><pre>@Component<br>public class PaymentScheduler {<br><br>    @Scheduled(cron = &quot;0 0 9 * * *&quot;)<br>    public void processPayments() {<br><br>        // Fetch database records<br><br>        // Validate payment details<br><br>        // Calculate amounts<br><br>        // Send notifications<br><br>        // Update database records<br><br>        // Handle business rules<br>    }<br>}</pre><p>Instead, keep the scheduler small and let a service handle the actual work.</p><pre>@Component<br>@RequiredArgsConstructor<br>public class PaymentScheduler {<br><br>    private final PaymentService paymentService;<br><br>    @Scheduled(cron = &quot;${app.scheduling.payment-cron}&quot;)<br>    public void processPayments() {<br><br>        paymentService.processPendingPayments();<br>    }<br>}</pre><p>This gives you cleaner code and makes your business logic easier to test and reuse.</p><h3>7.2 Use logging instead of System.out.println()</h3><p>When developing locally, System.out.println() might seem perfectly fine.</p><p>But what happens when your application is deployed to a server or running inside a Docker container?</p><p>You need proper logs to understand what happened.</p><p>Use a logger instead:</p><pre>@Slf4j<br>@Component<br>public class ReportScheduler {<br><br>    @Scheduled(cron = &quot;${app.scheduling.report-cron}&quot;)<br>    public void generateReport() {<br><br>        log.info(&quot;Report scheduler started&quot;);<br><br>        // Execute task<br><br>        log.info(&quot;Report scheduler completed&quot;);<br>    }<br>}</pre><p>For production applications, useful log information includes:</p><ul><li>When the scheduler started.</li><li>When it finished.</li><li>How many records were processed.</li><li>How many records failed.</li><li>How long the execution took.</li></ul><p>Try to include relevant identifiers when logging failures. However, avoid logging passwords, access tokens, customer secrets, or sensitive personal information.</p><h3>7.3 Handle failures properly</h3><p>Let’s say your scheduler needs to process 100 payment reminders.</p><p>What happens if processing fails because the notification service is temporarily unavailable?</p><p>You shouldn’t ignore the problem.</p><p>At the same time, you shouldn’t let one failed customer notification prevent all other reminders from being processed.</p><p>A better approach is to handle expected failures at the appropriate level.</p><p>For example:</p><pre>for (Payment payment : pendingPayments) {<br><br>    try {<br>        notificationService.sendPaymentReminder(payment);<br><br>        payment.markReminderAsSent();<br><br>    } catch (NotificationException exception) {<br><br>        log.error(<br>            &quot;Failed to send reminder for payment ID: {}&quot;,<br>            payment.getId(),<br>            exception<br>        );<br>    }<br>}</pre><p>This is a simplified example. A production implementation should also record failed attempts, define retry rules, and make sure failed records can be processed again.</p><p>The important point is that you should never silently ignore exceptions.</p><p>You need to know when something goes wrong.</p><h3>7.4 Make scheduled tasks idempotent</h3><p>This is a word you’ll probably come across when working with backend systems.</p><p>Let’s understand it with a simple example.</p><p>Imagine a payment reminder is successfully sent to a customer. However, the application crashes before recording that the reminder was sent.</p><p>When the scheduler runs again, it finds the same payment and sends another reminder.</p><p>Now the customer receives the same notification twice.</p><p>This is the kind of problem idempotency helps prevent.</p><p>An operation is idempotent when repeating it produces the same intended result as performing it once.</p><p>For our payment reminder example, we could maintain a database field such as:</p><pre>reminder_sent_at</pre><p>Before sending a reminder, we check whether it has already been processed.</p><p>But simply checking a field isn’t always enough. Two application instances could check the same record at almost the same time.</p><p>For more reliable processing, consider using:</p><ul><li>Database constraints or atomic status updates.</li><li>Unique idempotency keys.</li><li>A proper retry mechanism.</li><li>Transactional outbox patterns for reliable notification delivery.</li></ul><p>The exact solution depends on your application, but the goal is always the same: avoid unintended duplicate processing.</p><h3>7.5 Be careful when running multiple application instances</h3><p>This is something developers sometimes overlook.</p><p>Imagine your Spring Boot application is deployed using Docker or Kubernetes, and you have three application instances running.</p><p>All three instances have the same @Scheduled method.</p><p>What happens when the scheduled time arrives?</p><p>All three instances can execute the task.</p><p>For example:</p><pre>Application Instance 1<br>        |<br>        |---- Runs scheduler<br>        |<br>Application Instance 2<br>        |<br>        |---- Runs scheduler<br>        |<br>Application Instance 3<br>        |<br>        |---- Runs scheduler</pre><p>If the task sends payment reminders, customers might receive duplicate notifications.</p><p>Spring Boot’s built-in scheduler does not automatically coordinate scheduled executions across multiple application instances.</p><p>One solution is to use a distributed lock.</p><p>A popular library for this is <strong>ShedLock</strong>.</p><p>ShedLock ensures that only one application instance obtains the lock and executes a particular scheduled task at a time.</p><p>For example:</p><pre>@Scheduled(cron = &quot;${app.scheduling.payment-cron}&quot;)<br>@SchedulerLock(<br>    name = &quot;paymentReminderScheduler&quot;,<br>    lockAtMostFor = &quot;10m&quot;,<br>    lockAtLeastFor = &quot;30s&quot;<br>)<br>public void sendPaymentReminders() {<br><br>    paymentReminderService.sendPendingPaymentReminders();<br>}</pre><p>You also need to configure ShedLock and provide a shared lock provider, such as one backed by your database.</p><p>The important thing is that all application instances must use the same shared locking mechanism.</p><p>Also, lockAtMostFor should be chosen carefully. If the task runs longer than the maximum lock duration, another instance may be able to acquire the lock while the original task is still running.</p><p>A distributed lock is useful, but it doesn’t replace idempotency or proper database-level protection.</p><h3>7.6 Don’t load all records into memory</h3><p>Imagine your application has 500,000 pending records.</p><p>Would you fetch all of them and process them in one method?</p><p>Probably not.</p><p>That can consume a lot of memory and make the scheduler take too long to finish.</p><p>Instead, process records in batches.</p><p>For example:</p><pre>Pageable pageable = PageRequest.of(0, 100);<br><br>Page&lt;Payment&gt; payments =<br>    paymentRepository.findByStatus(<br>        PaymentStatus.PENDING,<br>        pageable<br>    );</pre><p>This retrieves a limited number of records.</p><p>For actual batch processing, you would need to continue retrieving subsequent pages or use a suitable chunk-based processing approach.</p><p>For large, complex batch jobs, Spring Batch may be worth considering. It provides additional features for chunk processing, job tracking, retries, and restarting failed jobs.</p><h3>7.7 Configure the scheduler thread pool</h3><p>One more thing worth understanding is how scheduled tasks use threads.</p><p>By default, a Spring Boot application generally uses a single scheduling thread when it auto-configures its task scheduler.</p><p>Imagine you have three scheduled tasks:</p><ul><li>Payment reminder scheduler.</li><li>Daily report scheduler.</li><li>Expired subscription scheduler.</li></ul><p>What happens if the report generation task takes 20 minutes?</p><p>The other scheduled tasks may have to wait if they share that single scheduling thread.</p><p>We can configure the scheduling thread pool through application.yml.</p><pre>spring:<br>  task:<br>    scheduling:<br>      pool:<br>        size: 5<br>      thread-name-prefix: app-scheduler-</pre><p>This allows the application to execute multiple scheduled tasks using a pool of five scheduling threads.</p><p>However, don’t increase the thread count without thinking about the workload.</p><p>More threads can increase database connections, API requests, and overall resource usage. Also, tasks that modify the same records still need proper concurrency protection.</p><p>Choose a pool size based on how many tasks you have, how long they run, and the resources available to your application.</p><h3>7.8 Don’t hardcode scheduling times</h3><p>We already looked at keeping cron expressions in application.yml.</p><p>I would follow the same approach for other scheduling-related settings.</p><p>For example:</p><pre>app:<br>  scheduling:<br>    enabled: true<br>    payment-cron: &quot;0 0 9 * * *&quot;<br>    report-cron: &quot;0 30 18 * * *&quot;<br>    time-zone: &quot;Asia/Colombo&quot;</pre><p>This makes it easier to manage schedules without changing the Java source code.</p><p>You can also use different configuration values for different environments.</p><p>For example, you might want a task to run every minute in a development environment but only once a day in production.</p><h3>7.9 Monitor scheduled tasks</h3><p>A scheduler can fail without anyone noticing if you don’t monitor it properly.</p><p>Imagine a daily report scheduler stops working on Monday. Nobody notices until Friday, when someone asks why there are no reports.</p><p>That’s not a good situation.</p><p>In a real application, you should monitor:</p><ul><li>The last successful execution time.</li><li>The execution duration.</li><li>The number of processed records.</li><li>The number of failed records.</li><li>Whether the task is running as expected.</li></ul><p>Spring Boot Actuator and monitoring tools such as Prometheus and Grafana can help you monitor application health and expose useful metrics.</p><p>For important jobs, consider sending alerts when a scheduled task repeatedly fails or hasn’t completed within the expected time.</p><h3>8. How can we test scheduled tasks?</h3><p>Testing scheduled tasks is also important.</p><p>I wouldn’t recommend depending entirely on the actual cron schedule to test your business logic.</p><p>Imagine your task runs every day at 9 AM. Do you really want to wait until 9 AM just to verify whether the payment reminder logic works?</p><p>Instead, separate the scheduling mechanism from the business logic.</p><p>For example:</p><pre>@Service<br>public class PaymentReminderService {<br><br>    public void sendPendingPaymentReminders() {<br><br>        // Actual business logic<br>    }<br>}</pre><p>You can write unit tests for this service and test different scenarios:</p><ul><li>No pending payments are available.</li><li>Pending payments are available.</li><li>A notification is sent successfully.</li><li>A notification fails.</li><li>A payment has already received a reminder.</li></ul><p>You can also write a small test for the scheduler to verify that it calls the correct service method.</p><p>This makes testing faster and more reliable.</p><p>For time-dependent business logic, injecting a Clock is also a good practice. It allows your tests to control the current time instead of depending on the actual system clock.</p><h3>9. When should you consider something other than @Scheduled?</h3><p>Spring Boot’s @Scheduled annotation is great for simple recurring tasks.</p><p>But it isn’t designed to handle every type of background job.</p><p>Imagine you’re developing a system that needs to process 100,000 customer records, track job progress, retry failed jobs, and restart processing after an application failure.</p><p>A simple scheduled method may not be enough.</p><h3>10. Some alternatives to Spring Boot’s @Scheduled</h3><p><strong>1. Spring </strong>@Scheduled</p><p>Best for simple recurring tasks that need to run automatically at a specific time or interval, such as generating daily reports or sending payment reminders.</p><p><strong>2. Spring Batch</strong></p><p>Useful when working with large amounts of data that need to be processed in batches. It also provides features such as job tracking, chunk processing, retry handling, and restarting failed jobs.</p><p><strong>3. Message Queues</strong></p><p>Useful when background tasks need to be triggered by messages or events. For example, when a customer places an order, the application can publish a message and let another service process the task asynchronously.</p><p><strong>4. Quartz Scheduler</strong></p><p>A good option for more advanced scheduling requirements. It supports persistent scheduled jobs and provides more control over job scheduling, execution, and management.</p><p>You don’t need to use a complicated solution for every scheduled task.</p><p>Start with the simplest option that meets your requirements. Move to a more specialised tool when the job’s complexity actually requires it.</p><h3>10. Final thoughts</h3><p>Working with schedulers in Spring Boot was a good learning experience for me, especially because I was already familiar with Laravel’s scheduler.</p><p>The basic idea is almost the same. You define a task, decide when it should run, and let the application handle execution.</p><p>However, as I learned more, I realised that writing a scheduler is only a small part of the work.</p><p>The real challenge is making sure it behaves correctly when something fails, when the application has multiple instances, or when a task needs to process thousands of records.</p><p>My biggest takeaway is this:</p><p><strong>Don’t just focus on making a scheduler run. Focus on making sure it runs reliably.</strong></p><p>Start with@Scheduled, understand the difference between fixedRate, fixedDelayand cron expressions, keep your business logic inside services, and pay attention to logging, error handling, idempotency, and monitoring.</p><p>These small decisions can make a big difference when your application moves from a local development environment to production.</p><p>I’m still learning more about the Java and Spring ecosystem, and this article is my way of sharing some of the things I picked up while working on a real application.</p><p>Hopefully, it makes your first experience with Spring Boot schedulers a little easier.</p><p>Thanks for reading!</p><p>I’m continuously learning and sharing my experiences as I explore backend engineering, Cloud, DevOps, and modern software development.<br><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn</em></a><em> </em>and learn something new together! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fc400dccfd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Node.js Works Under the Hood (Event Loop Explained Simply)]]></title>
            <link>https://medium.com/@pathumsandeepa13/how-node-js-works-under-the-hood-event-loop-explained-simply-43ec0b7df057?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/43ec0b7df057</guid>
            <category><![CDATA[js-structure]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[nodejs-architecture]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[nodejs-event-loop]]></category>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Wed, 29 Apr 2026 11:06:50 GMT</pubDate>
            <atom:updated>2026-04-29T11:06:50.409Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9dEyJXl28z36cZmlKsDgw.png" /></figure><p>If you have ever heard someone say “Node.js is non-blocking” or “it uses an event loop,” and nodded along without really knowing what that means, this post is for you. No jargon, no advanced CS degree required. Just a simple, honest explanation with real-world comparisons.</p><h3>First, What Even Is Node.js?</h3><p>Node.js lets you run JavaScript outside of a browser, on your computer or a server. Before Node.js came along, JavaScript only lived inside web browsers. Node.js changed that.</p><p>But here is the interesting part. Node.js runs on a single thread. That means it does one thing at a time, unlike some other languages that can spin up multiple threads to handle many tasks simultaneously. So how does it handle thousands of requests without freezing? That is where the event loop comes in.</p><h3>Think of a Coffee Shop</h3><p>Before we go technical, imagine a coffee shop with one barista.</p><p>A customer walks in and orders a latte. Making that latte takes 3 minutes. If the barista just stood there doing nothing while the milk was heating, no one else could be served. The whole shop would grind to a halt.</p><p>But a smart barista does not do that. They start the milk heating, take the next customer’s order, maybe wipe the counter, and come back to finish the latte when it is ready. They are not doing five things at once, but they are never just sitting idle either.</p><p>Node.js works the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AH2w5TgFNUdQ8jcqYw8tA.png" /></figure><h3>What Is the Event Loop?</h3><p>The event loop is Node’s way of managing tasks without getting stuck waiting.</p><p>Here is a simple way to think about it. When your Node.js code runs, there is a main queue of tasks. The event loop keeps checking that queue and picks up tasks one by one. When it hits a task that will take time, like reading a file from your disk or fetching data from an API, it says “okay, you go do your thing, I will come back to you” and moves on to the next task. When the slow task finishes, it signals back and gets added to the queue again to be processed.</p><p>This is what people mean by “non-blocking.” The code does not sit and wait. It keeps moving.</p><h3>A Real Code Example</h3><p>Let us say you have this code:</p><pre>console.log(&quot;Start&quot;);<br><br>setTimeout(function() {<br>  console.log(&quot;This runs after 2 seconds&quot;);<br>}, 2000);<br><br>console.log(&quot;End&quot;);</pre><p>You might expect the output to be:</p><pre>Start<br>This runs after 2 seconds<br>End</pre><p>But what actually prints is:</p><pre>Start<br>End<br>This runs after 2 seconds</pre><p>Why? Because setTimeout tells Node &quot;wait 2 seconds and then run this.&quot; Node registers that timer and immediately moves on to the next line. It does not pause and wait. Two seconds later, when the timer fires, the callback gets picked up by the event loop and runs.</p><p>This is the event loop in action.</p><h3>The Phases of the Event Loop (Simply Put)</h3><p>The event loop goes through several phases in a cycle, over and over. Here is a plain-English version of what happens:</p><p><strong>Timers</strong> — Runs any callbacks from setTimeout or setInterval that are ready.</p><p><strong>Pending callbacks</strong> — Handles some system-level callbacks from the previous cycle.</p><p><strong>Poll</strong> — This is where most of the work happens. It picks up new I/O events, like data coming back from a database call or a file that finished loading.</p><p><strong>Check</strong> — Runs setImmediate callbacks, which are meant to run right after the current poll phase.</p><p><strong>Close callbacks — </strong>Cleans up things like closed socket connections.</p><p>Then the whole cycle repeats. Constantly. As long as your app is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ehWU9qzGdQ7YZA2y4ig3KQ.png" /></figure><h3>What Is I/O and Why Does It Matter?</h3><p>I/O stands for Input/Output. It is basically any time your code talks to something outside of itself. Reading a file, writing to a database, making an API call, listening for a network request. These things take time.</p><p>In most traditional languages, your program would sit and wait for that I/O to finish before doing anything else. Node.js offloads that waiting to a system called libuv, which handles it in the background. Your main thread stays free to do other work. When the I/O is done, libuv says “hey, the data is here” and the event loop picks it back up.</p><p>This is why Node.js is particularly good for things like web servers, real-time apps, and APIs where you are constantly handling many small requests.</p><h3>A Quick Analogy Summary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E75X43QKhEO48Al_nKXbQA.png" /></figure><h3>What Node.js Is NOT Good At</h3><p>To be fair, the event loop model has a weakness. If you give Node.js a heavy computation, like running a huge mathematical calculation or processing a large image in the main thread, it blocks everything. The whole event loop freezes until that task is done.</p><p>This is called “blocking the event loop” and it is something every Node developer learns to avoid. For CPU-heavy tasks, you would use Worker Threads or offload to a separate service.</p><h3>Wrapping Up</h3><p>Node.js is fast and efficient not because it does many things at once, but because it never wastes time waiting. The event loop is the engine behind this. It is a simple idea, really. Keep moving, handle things when they are ready, never just sit there.</p><p>Once this clicks, a lot of things about JavaScript and Node.js start to make more sense. Callbacks, promises, async/await. They all exist because of this single-threaded, non-blocking nature of Node.</p><p>If you are just starting out with backend development or picking up Node.js for the first time, understanding the event loop will save you hours of confusion down the road.</p><p>I write about Cloud, DevOps, and coding in a way that does not make your head spin. If this was helpful, connect with me on <a href="https://www.linkedin.com/in/pathumz/">LinkedIn </a>to follow my journey into Cloud, DevOps, and coding. There is a lot more coming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43ec0b7df057" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Never Set Up a NestJS Project Twice the Same Way Docker, Prisma, and Seeders Done Right]]></title>
            <link>https://medium.com/@pathumsandeepa13/never-set-up-a-nestjs-project-twice-the-same-way-docker-prisma-and-seeders-done-right-28c004505f8f?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/28c004505f8f</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[prisma]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Fri, 13 Mar 2026 16:11:15 GMT</pubDate>
            <atom:updated>2026-03-13T16:11:15.897Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lyfx5dWi8NR8XwxCFZ5vRw.png" /></figure><p>So you just finished building your NestJS backend. It works perfectly on your machine. You’re proud of it.</p><p>Then your teammate clones the repo, runs it, and messages you:</p><p><em>“Hey, it’s crashing. Also, what’s the database password? Also, where are the tables? Also, why is there no admin account?”</em></p><p>Yeah. We’ve all been there.</p><p>This post is about solving exactly that. How do you set up your NestJS project so that anyone including future you after a long vacation can clone it, run two or three commands, and have a fully working app with tables created and default data already loaded.</p><p>Let’s go step by step.</p><h3>What We’re Building Here</h3><p>Imagine you’re building a news platform. Your app needs:</p><ul><li>A PostgreSQL database (to store articles, users, etc.)</li><li>Tables automatically created from your code (no manual SQL)</li><li>A default admin account so someone can actually log in on day one</li><li>All of this to work with a single setup flow</li></ul><p>That’s exactly what this post covers.</p><h3>The Tools We’re Using (and Why)</h3><p>Before we dive in, let me quickly explain the tools. If you already know these, skip ahead.</p><p><strong>Docker: </strong>Think of it as a box that contains a mini-computer running on your actual computer. We use it to run PostgreSQL without installing PostgreSQL directly. You just run the box. When you’re done, you stop it. Clean, isolated, no mess.</p><p><strong>PostgreSQL:</strong> The database. This is where all your data lives — users, articles, everything. It’s like a giant, organized spreadsheet, but way more powerful.</p><p><strong>Prisma:</strong> Prisma is the bridge between your TypeScript code and the database. Instead of writing raw SQL like SELECT * FROM users WHERE..., you write TypeScript like prisma.user.findMany(). Prisma also manages your database structure (which tables exist and which columns they have) through a schema file.</p><p><strong>NestJS:</strong> The backend framework. It’s like Express.js but with structure, so your code doesn’t turn into spaghetti when the project grows.</p><h3>The Problem This Solves (Real Story)</h3><p>Here’s what happened to me while working on a recent project.</p><p>I cloned my own repo on a different machine. Ran pnpm install. Ran pnpm start:dev. The app crashed with:</p><pre>PrismaClientInitializationError: Can&#39;t reach database server</pre><p>Then I fixed that. Ran again. Got:</p><pre>The table `public.User` does not exist in the current database.</pre><p>Fixed that. Ran again. Opened the app. Tried to log in. No admin account exists. I had to manually create one through an API call.</p><p>Every time I handed the project to someone, they went through the same pain. That&#39;s when I decided to fix this properly with Docker, Prisma migrations, and a seed script.</p><h3>File Structure</h3><p>Here’s the folder layout we’re going to work with:</p><pre>my-app/<br>├── prisma/<br>│   ├── schema.prisma        ← your database structure lives here<br>│   └── seed.ts              ← default data script<br>├── src/<br>│   ├── app.module.ts<br>│   ├── main.ts<br>│   └── ...your feature folders<br>├── docker-compose.yml       ← the box that runs PostgreSQL<br>├── prisma.config.ts         ← Prisma connection configuration<br>├── .env                     ← your secret values (not pushed to git)<br>├── .env.example             ← a safe template others can copy<br>└── package.json</pre><p>The two most important files for this blog are docker-compose.yml, prisma/schema.prisma, and prisma/seed.ts. Everything else is standard NestJS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ROX2dataKg6aIO3IRG7kng.png" /></figure><h3>Step 1 — Run PostgreSQL with Docker</h3><p>Install Docker Desktop first. Then, create a docker-compose.yml file in the root of your project.</p><pre>version: &#39;3.8&#39;<br><br>services:<br>  db:<br>    image: postgres:16<br>    container_name: my_app_db<br>    restart: always<br>    environment:<br>      POSTGRES_USER: myuser<br>      POSTGRES_PASSWORD: mypassword<br>      POSTGRES_DB: myapp<br>    ports:<br>      - &#39;5432:5432&#39;<br>    volumes:<br>      - postgres_data:/var/lib/postgresql/data<br>volumes:<br>  postgres_data:</pre><p>What does this do?</p><ul><li>It downloads the official PostgreSQL 16 image (if not already downloaded)</li><li>Creates a database called myapp</li><li>Runs it on port 5432 (the standard PostgreSQL port)</li><li>Stores the data in a volume, so your data survives even if you stop the container</li></ul><p>To start it:</p><pre>docker-compose up -d</pre><p>The -d means &quot;detached&quot; — it runs in the background. Your terminal stays free.</p><p>To stop it</p><pre>docker-compose down</pre><p>To check if it’s running:</p><pre>docker ps</pre><p>You should see your container listed. That means your database is alive.</p><h3>Step 2 — Connect NestJS to the Database</h3><p>Create a .env file:</p><pre>DATABASE_URL=&quot;postgresql://myuser:mypassword@localhost:5432/myapp&quot;</pre><p>This is the connection string. It tells Prisma where the database is, what username and password to use, and what database name to connect to.</p><p>Now create a .env.example file (this one goes to git, the real .env does not):</p><pre>DATABASE_URL=&quot;postgresql://your_user:your_password@localhost:5432/your_db&quot;</pre><p>Why .env.example? So the next person who clones the repo knows what variables they need. They just copy it and fill in their own values.</p><pre>cp .env.example .env</pre><p>Add .env to your .gitignore. Never push real credentials to GitHub.</p><h3>Step 3 — Define Your Database Structure with Prisma</h3><p>Install Prisma:</p><p>bash</p><pre>pnpm add prisma @prisma/client<br>pnpm add -D prisma<br>npx prisma init</pre><p>This creates the prisma/ folder with a schema.prisma file. Open it and define your models (models = tables).</p><pre>// prisma/schema.prisma<br><br>generator client {<br>  provider = &quot;prisma-client-js&quot;<br>}<br><br>datasource db {<br>  provider = &quot;postgresql&quot;<br>  url      = env(&quot;DATABASE_URL&quot;)<br>}<br><br>model User {<br>  id        String   @id @default(uuid())<br>  username  String   @unique<br>  email     String   @unique<br>  password  String<br>  role      Role     @default(READER)<br>  createdAt DateTime @default(now())<br>}<br><br>enum Role {<br>  ADMIN<br>  EDITOR<br>  READER<br>}</pre><p>Think of model User as defining what the users table looks like. Every field is a column. @id means primary key. @unique means no duplicates allowed. @default sets the default value.</p><p>enum Role is a custom type. It means the role field can only ever be ADMIN, EDITOR, or READER — nothing else. This prevents typos and invalid data.</p><h3>Step 4 — Migrations (Keeping the Database in Sync with Your Code)</h3><p>A migration is just a record of a change you made to the database structure. When you add a new column or a new table, you create a migration. Prisma turns your schema changes into SQL and applies them to the database.</p><p>There are two approaches:</p><p><strong>Option A — </strong><strong>prisma migrate dev (recommended for most projects)</strong></p><pre>npx prisma migrate dev --name init</pre><p>This creates a prisma/migrations/ folder with timestamped SQL files. Prisma tracks which migrations have been applied and only runs the new ones. This is clean, safe, and production-friendly.</p><p><strong>Option B — </strong><strong>prisma db push (quick and simple)</strong></p><pre>npx prisma db push</pre><p>This reads your schema and directly updates the database to match — without creating migration files. Good for early development or simple projects. I used this in my project because the schema wasn’t changing much, and I wanted to keep things simple.</p><p>Which should you use?</p><p>SituationUseTeam project, production appprisma migrate devSolo project, early stageprisma db pushJust experimentingprisma db push</p><p>After either command, your tables exist in the database.</p><p>Now generate the Prisma client (the TypeScript code Prisma uses to talk to the database):</p><pre>npx prisma generate</pre><p>Important: you need to run this every time you change the schema. If you forget, your TypeScript types won’t match your database and you’ll get confusing errors.</p><h3>Step 5 — The Seed Script (Default Data on Day One)</h3><p>This is the part most people skip and then regret. The seed script is a TypeScript file that runs once to populate your database with the initial data your app needs to function.</p><p>In a real project, this usually means:</p><ul><li>An admin account (so someone can log in immediately)</li><li>Maybe some default categories or settings</li><li>Sample data for development</li></ul><p>Create prisma/seed.ts:</p><pre>import { PrismaClient } from &#39;@prisma/client&#39;;<br>import * as bcrypt from &#39;bcrypt&#39;;<br><br>const prisma = new PrismaClient();<br>const USERS_DATA = [<br>  {<br>    username: &#39;admin&#39;,<br>    email: &#39;admin@myapp.com&#39;,<br>    password: &#39;Admin@123&#39;,<br>    role: &#39;ADMIN&#39; as const,<br>  },<br>  {<br>    username: &#39;editor&#39;,<br>    email: &#39;editor@myapp.com&#39;,<br>    password: &#39;Editor@123&#39;,<br>    role: &#39;EDITOR&#39; as const,<br>  },<br>  {<br>    username: &#39;reader&#39;,<br>    email: &#39;reader@myapp.com&#39;,<br>    password: &#39;Reader@123&#39;,<br>    role: &#39;READER&#39; as const,<br>  },<br>];<br>async function main() {<br>  console.log(&#39;🌱 Seeding database...&#39;);<br>  for (const user of USERS_DATA) {<br>    const hashedPassword = await bcrypt.hash(user.password, 12);<br>    await prisma.user.upsert({<br>      where: { email: user.email },<br>      update: {},<br>      create: {<br>        username: user.username,<br>        email: user.email,<br>        password: hashedPassword,<br>        role: user.role,<br>      },<br>    });<br>    console.log(`✅ Created user: ${user.username} (${user.role})`);<br>  }<br>  console.log(&#39;🎉 Seeding complete!&#39;);<br>}<br>main()<br>  .catch((e) =&gt; {<br>    console.error(&#39;❌ Seed failed:&#39;, e);<br>    process.exit(1);<br>  })<br>  .finally(async () =&gt; {<br>    await prisma.$disconnect();<br>  });</pre><p>A few things worth explaining here:</p><p>bcrypt.hash(password, 12) — Never store plain text passwords. Ever. bcrypt turns your password into a scrambled string that can&#39;t be reversed. The 12 is the cost factor — higher = slower = harder to crack.</p><p>prisma.user.upsert — This is the smart way to seed. It means &quot;if this record already exists, do nothing (update: {}). If it doesn&#39;t exist, create it.&quot; So if you run the seed script 10 times, you don&#39;t get 10 duplicate admin users.</p><p>Now tell Prisma where the seed file is. In package.json:</p><pre>{<br>  &quot;prisma&quot;: {<br>    &quot;seed&quot;: &quot;ts-node prisma/seed.ts&quot;<br>  }<br>}</pre><p>You’ll also need ts-node:</p><pre>pnpm add -D ts-node</pre><p>Run the seed:</p><pre>npx prisma db seed</pre><p>You’ll see the console logs. Check your database with Prisma Studio:</p><pre>npx prisma studio</pre><p>This opens a visual browser UI at localhost:5555 where you can see all your tables and data. It&#39;s great for debugging.</p><h3>Step 6 — Wire Prisma into NestJS</h3><p>Create a PrismaService that the rest of your app can use:</p><pre>// src/prisma/prisma.service.ts<br><br>import { Injectable, OnModuleInit, OnModuleDestroy } from &#39;@nestjs/common&#39;;<br>import { PrismaClient } from &#39;@prisma/client&#39;;<br>@Injectable()<br>export class PrismaService<br>  extends PrismaClient<br>  implements OnModuleInit, OnModuleDestroy<br>{<br>  async onModuleInit() {<br>    await this.$connect();<br>    console.log(&#39;✅ Database connected&#39;);<br>  }<br>  async onModuleDestroy() {<br>    await this.$disconnect();<br>  }<br>}</pre><pre>// src/prisma/prisma.module.ts<br><br>import { Module, Global } from &#39;@nestjs/common&#39;;<br>import { PrismaService } from &#39;./prisma.service&#39;;<br>@Global()<br>@Module({<br>  providers: [PrismaService],<br>  exports: [PrismaService],<br>})<br>export class PrismaModule {}</pre><p>@Global() means you only need to import PrismaModule once in AppModule, and it becomes available everywhere else. No need to import it in every feature module.</p><p>Now import it in app.module.ts:</p><pre>@Module({<br>  imports: [<br>    PrismaModule,<br>    // your other modules...<br>  ],<br>})<br>export class AppModule {}</pre><p>Using it in a service:</p><pre>@Injectable()<br>export class UsersService {<br>  constructor(private prisma: PrismaService) {}<br>  findAll() {<br>    return this.prisma.user.findMany();<br>  }<br>}<br>```<br>---<br>### Step 7 - Fix the Build Order (A Real Mistake I Made)<br>When you deploy or run `pnpm build`, NestJS compiles your TypeScript. But if Prisma&#39;s client types haven&#39;t been generated yet, the build fails with confusing errors like:<br>```<br>Cannot find module &#39;@prisma/client&#39;</pre><h3>Step 7 — Fix the Build Order (A Real Mistake I Made)</h3><p>When you deploy or run `pnpm build`, NestJS compiles your TypeScript. But if Prisma’s client types haven’t been generated yet, the build fails with confusing errors like:</p><pre><br>Cannot find module ‘@prisma/client’</pre><p>The fix is simple. In your package.json build script, always run prisma generate first:</p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;prisma generate &amp;&amp; nest build&quot;,<br>    &quot;start:dev&quot;: &quot;nest start --watch&quot;,<br>    &quot;start:prod&quot;: &quot;node dist/src/main&quot;<br>  }<br>}</pre><p>Now, whenever someone builds the project, Prisma types are always generated before the TypeScript compiler runs.</p><h3>The Full Setup Flow for a New Developer</h3><p>This is what you put in your README. This is the magic section that saves everyone time.</p><pre># 1. Clone the repo<br>git clone https://github.com/you/your-project.git<br>cd your-project<br><br># 2. Install dependencies<br>pnpm install<br><br># 3. Set up environment variables<br>cp .env.example .env<br># (open .env and fill in your values)<br><br># 4. Start the database<br>docker-compose up -d<br><br># 5. Create the tables<br>npx prisma db push<br># or: npx prisma migrate dev<br><br># 6. Load default data<br>npx prisma db seed<br><br># 7. Run the app<br>pnpm start:dev</pre><p>Seven commands. Anyone can do this. No tribal knowledge required.</p><h3>Common Errors and What They Mean</h3><p><strong>Can&#39;t reach database server at localhost:5432</strong> Your Docker container isn&#39;t running. Run docker-compose up -d first.</p><p><strong>The table public.User does not exist</strong> You forgot to run prisma db push or prisma migrate dev. The database exists, but the tables don&#39;t.</p><p><strong>Environment variable not found: DATABASE_URL</strong> You forgot to create the .env file. Run cp .env.example .env and fill it in.</p><p><strong>Cannot find module &#39;@prisma/client&#39;</strong> Run npx prisma generate. The Prisma client wasn&#39;t generated.</p><p><strong>Unique constraint failed on field: email</strong> You ran the seed script, and the records already exist. If you used upsert this shouldn&#39;t have happened. If you used create, switch to upsert.</p><p><strong>error TS2307: Cannot find module</strong> After changing the schema, you forgot to run it npx prisma generate again. The TypeScript types are out of sync.</p><h3>Best Practices Summary</h3><p><strong>Always use </strong><strong>.env.example</strong> — document every variable your app needs. Never commit the real .env.</p><p><strong>Use </strong><strong>upsert in seed scripts, not </strong><strong>create</strong> — idempotent seeds (safe to run multiple times) are a sign of a mature project.</p><p><strong>Hash passwords in the seed script</strong> — even development/test passwords. Build the habit early.</p><p><strong>Run </strong><strong>prisma generate before every build</strong> — automate this in your build script.</p><p><strong>Keep the seed script realistic</strong> — seed the minimum data your app needs to function from day one. Don’t seed fake garbage.</p><p><strong>Use </strong><strong>prisma studio during development</strong> — it&#39;s like having a free database GUI built in.</p><p><strong>Use </strong><strong>volumes in docker-compose</strong> — otherwise your data disappears every time you stop the container.</p><h3>Why This Matters More Than You Think</h3><p>The real value of this setup isn’t just for teammates. It’s for yourself six months from now when you want to spin up the project again. Or when you’re setting up a staging environment. Or when a bug only reproduces with fresh data.</p><p>Having a clean, repeatable setup flow is the difference between a “it works on my machine” project and an actual professional codebase.</p><p>Once you set this up properly, you’ll do it this way for every project. It takes maybe 30 extra minutes the first time and saves hours every time after.</p><p><em>Found this helpful? Share it with someone who’s currently staring at a “table does not exist” error. They need this more than they know.</em></p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn</em></a><em> </em>to follow my journey into Cloud, DevOps, and coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28c004505f8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Server Needs a Backpack: Specific Guide to AWS Storage]]></title>
            <link>https://medium.com/@pathumsandeepa13/why-your-server-needs-a-backpack-specific-guide-to-aws-storage-cad7245bb677?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cad7245bb677</guid>
            <category><![CDATA[aws-ec2-instance]]></category>
            <category><![CDATA[aws-tags]]></category>
            <category><![CDATA[aws-ebs-volume]]></category>
            <category><![CDATA[cloud-usb-stick]]></category>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 15:06:16 GMT</pubDate>
            <atom:updated>2026-02-13T15:06:16.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTPA1kKoTlKZH0x-Cc3YhQ.png" /></figure><p>When you buy a laptop, it comes with an internal hard drive. But what happens if that laptop breaks? Or what if you run out of space and need to store important files safely?</p><p>In the real world, you would go to a store and buy an <strong>External Hard Drive</strong> or a <strong>USB Stick</strong>. You can plug it in, save files, unplug it, and plug it into a different computer later.</p><p>In the cloud (AWS), we have the exact same concept. It is called <strong>EBS (Elastic Block Store)</strong>.</p><p>Today, I learned how to create this “external storage” in the cloud. It sounds technical, but it’s actually quite simple. Here is how I did it.</p><h3>What is EBS?</h3><p><strong>EBS</strong> stands for <strong>Elastic Block Store</strong>.</p><ul><li><strong>Elastic:</strong> You can make it bigger or smaller (mostly bigger) as needed.</li><li><strong>Block Store:</strong> It stores data in “blocks,” just like a standard hard drive.</li></ul><p>The most important thing to know is that an EBS Volume is <strong>independent</strong>. It creates storage that doesn’t disappear just because you shut down your server.</p><h3>Step 1: Finding the “Store”</h3><p>Even though EBS is storage, it lives inside the <strong>EC2 (Elastic Compute Cloud)</strong> dashboard because it is usually attached to virtual servers (EC2 instances).</p><p>I navigated to the EC2 Dashboard and found <strong>“Volumes”</strong> under the <strong>Elastic Block Store</strong> section on the left menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPMwzRBcZgGvsPdE0ni4_g.png" /><figcaption>The Volumes dashboard in AWS, where all your virtual hard drives live</figcaption></figure><h3>Step 2: Buying the Drive (Configuration)</h3><p>I clicked <strong>Create Volume</strong> to start setting up my new drive. This is where you choose the “specs” of your hardware.</p><p>For this project, I had specific requirements:</p><ul><li><strong>Volume Type:</strong> I chose <strong>General Purpose SSD (gp3)</strong>. This is the modern standard for AWS storage. It balances price and performance perfectly for most workloads.</li><li><strong>Size:</strong> I set it to <strong>2 GiB</strong>. In the cloud, you can create tiny drives for small tasks or massive drives for big databases. You only pay for what you allocate!</li></ul><p><strong>Important Note:</strong> I had to make sure the <strong>Availability Zone</strong> (the physical data center location) matched where my servers are. If your server is in “Building A,” you can’t plug in a hard drive that is stored in “Building B.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1gE9gdst_PNotiPOfVv8g.png" /><figcaption>Configuring the size and speed of the new Volume</figcaption></figure><h3>Step 3: Putting a Sticker on It (Tagging)</h3><p>Imagine having 50 identical black USB drives on your desk. You wouldn’t know which one has your family photos and which one has your work documents.</p><p>In AWS, we solve this with <strong>Tags</strong>.</p><p>I added a tag with the Key <strong>“Name”</strong> and the Value <strong>“datacenter-volume”</strong>. Now, when I look at my dashboard, I will know exactly what this drive is for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtsNpg5NZtnIjc-rjbx2Vw.png" /><figcaption>Adding a “Name” tag so we can easily identify the volume later</figcaption></figure><h3>Step 4: Success!</h3><p>I clicked <strong>Create</strong>, and within seconds, my new “Cloud Hard Drive” was ready.</p><p>The status showed <strong>“Available”</strong> (blue). This means the drive is sitting on the shelf, ready to be plugged into a server whenever I need it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mM96KaHgTmwtHhEU05rAg.png" /><figcaption>The new volume is created and currently in the “Available” state</figcaption></figure><h3>Why This Matters for DevOps</h3><p>As I dive deeper into DevOps, I’m realizing that <strong>decoupling</strong> (separating things) is a superpower.</p><p>By keeping my data on an <strong>EBS Volume</strong> instead of the server’s internal drive, I make my infrastructure resilient. If my server crashes or gets deleted, my data is safe on this volume. I can simply spin up a new server, attach this volume, and pick up right where I left off.</p><p>It’s simple, but it’s the foundation of cloud data security. ☁️</p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn</em></a><em> to follow my journey into Cloud &amp; DevOps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cad7245bb677" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Cloud Server Needs a Home Address: Setting Up Azure VNets]]></title>
            <link>https://medium.com/@pathumsandeepa13/why-your-cloud-server-needs-a-home-address-setting-up-azure-vnets-269fec4c6d75?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/269fec4c6d75</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 05:59:03 GMT</pubDate>
            <atom:updated>2026-01-27T05:59:03.594Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NlyBx7Y9d4SKSTzw4pU6hg.png" /></figure><p>In my <a href="https://medium.com/@pathumsandeepa13/how-to-create-your-first-network-vnet-in-azure-its-easier-than-you-think-88d13f28e950">previous posts</a>, We learned how to build “houses” in the cloud (Virtual Machines). But today, I realized something important: A house is useless if it doesn’t have a road connecting it to the rest of the world.</p><p>In the cloud, these “roads” are called <strong>Virtual Networks (VNet)</strong>.</p><p>Today, I moved away from just launching servers and started building the actual infrastructure that connects them. Here is how we build a private, secure network in Microsoft Azure.</p><h3>What is a Virtual Network?</h3><p>Imagine you are building a gated community. Before you build the first house, you need to lay down the streets and define the property lines.</p><p>That is exactly what a <strong>VNet</strong> is. It is a private, isolated network in the cloud where your virtual machines live. It allows them to talk to each other securely while keeping them safe from the public internet.</p><h3>Step 1: Laying the Foundation (The Basics)</h3><p>Every project needs a name and a location. In Azure, “Location” is critical because it determines which physical data center holds your network.</p><p>For this project, we chose the <strong>South Central US</strong> region. If you put your network in the US but your customers are in Sri Lanka, the data has to travel halfway around the world, making everything slow. So, we always choose a region close to our users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*F81TAwZCeN72VAPjJa2k5w.png" /><figcaption><em>Setting up the VNet name and physical location (Region)</em></figcaption></figure><h3>Step 2: Zoning the Neighborhood (IP Addresses)</h3><p>This is the most technical part, but think of it like this: If the VNet is the neighborhood, the <strong>IP Address Space</strong> is the set of house numbers available.</p><p>We used the address space 192.168.0.0/24.</p><p><strong>What does </strong><strong>/24 mean?</strong></p><p>In simple English, it means we are creating a small network that can hold <strong>256 IP addresses</strong>. It’s like zoning a plot of land that is big enough for exactly 256 houses. This is a standard size for small internal networks.</p><p>We also created a <strong>Subnet</strong>. If the VNet is the whole city, a Subnet is a specific street (e.g., “Main Street”). All our servers will live on this specific digital street.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kNAXYXRw-X6wjbk66QG_Q.png" /><figcaption><em>Defining the “Address Space” to determine how many devices can fit in our network</em></figcaption></figure><h3>Step 3: The Security Gate (What we skipped, but need to know!)</h3><p>There is a tab called <strong>“Security”</strong> that we left as default for this task, but as we learn more about Cloud Security, these options are powerful.</p><p>Even though we didn’t turn them on today, here is what they do in plain English:</p><ul><li><strong>Azure Bastion:</strong> Think of this like a secure guard booth. Instead of giving every house (VM) a key to the front gate (Public IP), you log in through this single, secure booth. It is much safer.</li><li><strong>Azure Firewall:</strong> This is like the neighborhood security checkpoint. It inspects every car (data packet) coming in and out to make sure no bad actors are entering your streets.</li><li><strong>DDoS Protection:</strong> This protects your neighborhood from a riot. If millions of fake attackers try to block your roads (a DDoS attack), this service clears the traffic so real visitors can still get through.</li></ul><h3>Step 4: Organization (Tags)</h3><p>We also saw a <strong>“Tags”</strong> tab. In a professional environment, you might have hundreds of networks. Tags are like sticky notes you put on resources, saying things like <em>“Project: Migration”</em> or <em>“Owner: Sandeepa”</em>. It helps keep the bills organized!</p><h3>Step 5: Final Inspection</h3><p>Before building, Azure runs a “Validation” check. This ensures we haven’t made any typos in our address planning. Once everything looked green, we hit <strong>Create</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*lIdOggymty8WQblOp4o1Hw.png" /><figcaption><em>Reviewing the configuration before deploying the infrastructure</em></figcaption></figure><h3>The Result</h3><p>In just a few seconds, the “Digital Roads” were paved. We now have a fully functional private network in the US.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_371SN65SuX96VPstyUYZA.png" /><figcaption><em>Success! The Virtual Network is live and ready for servers</em></figcaption></figure><h3>What We Learned</h3><p>Building a Virtual Machine is exciting, but building the <strong>Network</strong> is what makes you a true Cloud Engineer.</p><ul><li><strong>VMs</strong> are the houses.</li><li><strong>VNets</strong> are the roads.</li><li><strong>Subnets</strong> are the streets.</li><li><strong>Security Groups</strong> are the gates.</li></ul><p>Now that the roads are built, we are ready to start moving in the furniture!</p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn</em></a><em> to follow my journey into Cloud &amp; DevOps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=269fec4c6d75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “Undo” Button for the Cloud: Securing Data with AWS S3]]></title>
            <link>https://medium.com/@pathumsandeepa13/the-undo-button-for-the-cloud-securing-data-with-aws-s3-cbf630e139ee?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbf630e139ee</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 21:33:39 GMT</pubDate>
            <atom:updated>2026-01-27T04:05:09.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyI8jTCnU8bd8dvLHQAvzQ.png" /></figure><p>As a software engineer, I know the panic of accidentally overwriting a file. You hit “Save,” and a split second later, you realize you just wiped out three hours of work.</p><p>In coding, we have tools to save us. But what about the actual files, the images, customer logs, and important documents stored in the cloud? If you delete them there, are they gone forever?</p><p>Recently, I’ve been diving deep into <strong>AWS (Amazon Web Services)</strong> to solve exactly this problem. I wanted to build a storage system that doesn’t just hold files, but protects them from human error.</p><p>Here is how I built a “Time Machine” for data using <strong>Amazon S3</strong>.</p><h3>What is S3?</h3><p><strong>S3 (Simple Storage Service)</strong> is basically Amazon’s version of a massive, infinite hard drive in the cloud. It’s where companies like Netflix and Airbnb store their images, videos, and backups.</p><p>But unlike a regular hard drive, S3 has a superpower called <strong>Versioning</strong>.</p><h3>The Goal: A Folder That Never Forgets</h3><p>My task was to create a specific storage bucket (which is just AWS speak for a “folder”) for a project.</p><p>The requirement was strict: <strong>“If a file is deleted or overwritten, we must be able to get it back.”</strong></p><p>Here is the step-by-step process of how I set this up.</p><h3>Step 1: Naming the Bucket</h3><p>In AWS, every bucket name must be completely unique across the entire world. It’s like choosing a username for Instagram if my-cool-bucket is taken by someone in Germany, I can&#39;t use it in Sri Lanka.</p><p>I named my bucket xfusion-s3-3061 to ensure it was unique.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXYg-KxkPlCtc_uPs6waBA.png" /><figcaption><em>Setting a globally unique name for the new S3 bucket</em></figcaption></figure><h3>Step 2: The “Magic Switch” (Versioning)</h3><p>This is the most important part. By default, cloud storage works like your desktop: if you overwrite photo.jpg with a new version, the old one is deleted instantly.</p><p>To fix this, I enabled <strong>Bucket Versioning</strong>.</p><p>Think of Versioning like a safety net. When this feature is on, AWS keeps a hidden copy of every single change you make.</p><ul><li>If I upload report.pdf today...</li><li>And I accidentally overwrite it with a blank file tomorrow…</li><li>AWS keeps <strong>both</strong>. I can simply “undo” my mistake and go back to the version from today.</li></ul><p>I scrolled down and flipped the switch from “Disable” to <strong>“Enable”</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwM3N9UEPrjjQgQhAwnNQg.png" /><figcaption><em>Enabling Bucket Versioning to create an automatic safety net for all files</em></figcaption></figure><h3>Step 3: Locking the Front Door</h3><p>Storing data is useless if it isn’t secure. I verified that the setting <strong>“Block all public access”</strong> was checked.</p><p>This effectively locks the digital front door. Unless I explicitly give someone a key, nobody on the internet can see what is inside my bucket. This is crucial for protecting private user data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HwM3N9UEPrjjQgQhAwnNQg.png" /><figcaption><em>Ensuring “Block all public access” is checked to prevent unauthorized viewing.</em></figcaption></figure><h3>Step 4: Creation and Success</h3><p>After double-checking my settings, I clicked <strong>Create bucket</strong>.</p><p>I now have a secure, resilient storage container living in the <strong>US East (N. Virginia)</strong> data center. It looks like a simple folder, but under the hood, it has a built-in backup system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yVvx5tm7FuuN4Tj26dLZSg.png" /><figcaption><em>The successfully created bucket, now ready to store and protect data</em></figcaption></figure><h3>Why This Matters</h3><p>As I transition from Full Stack development to DevOps, I’m learning that my job isn’t just about writing code; it’s about <strong>resilience</strong>.</p><p>Enabling versioning takes five seconds, but it solves two massive problems:</p><ol><li><strong>The “Oops” Factor:</strong> If a teammate accidentally deletes a critical file, we can restore it in seconds.</li><li><strong>Security:</strong> If a hacker tries to overwrite our data, we can simply roll back to the clean version from yesterday.</li></ol><p>It’s a simple feature, but in the professional world, it is an absolute lifesaver.</p><p><strong><em>Connect with me on </em></strong><a href="https://www.linkedin.com/in/pathumz/"><strong><em>LinkedIn </em></strong></a><strong><em>to follow my journey into Cloud &amp; DevOps.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbf630e139ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Your First Network(VNet) in Azure (It’s Easier Than You Think!)]]></title>
            <link>https://medium.com/@pathumsandeepa13/how-to-create-your-first-network-vnet-in-azure-its-easier-than-you-think-88d13f28e950?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/88d13f28e950</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 19:31:22 GMT</pubDate>
            <atom:updated>2026-01-23T19:31:22.031Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NTY9aVkW2U5WLFmuRQ1ggQ.png" /></figure><p>If you are new to the cloud, the jargon can get confusing fast. You hear about VPCs in AWS, VNets in Azure, and VPCs again in Google Cloud. It feels like learning three different languages.</p><p>But here is the secret: <strong>They are all the same thing.</strong></p><ul><li><strong>AWS VPC</strong> (Virtual Private Cloud)</li><li><strong>Google Cloud VPC</strong></li><li><strong>Azure VNet</strong> (Virtual Network)</li></ul><p>They all serve the exact same purpose. Think of the public cloud as a massive, open city. You don’t want to pitch a tent on the sidewalk; you want a private house with walls and a lock. <strong>The VNet is your private house.</strong> It’s an isolated space where you can run your servers securely, away from the rest of the internet.</p><p>Today, I’m going to show you how I built my first VNet in Azure.</p><h3>Step 1: The Basics (Building the Foundation)</h3><p>In Azure, I started by searching for “Virtual Networks” and clicking <strong>Create</strong>.</p><p>The first screen asked for the “Basics.” This is where Azure is a little different from others because of something called <strong>Resource Groups</strong>.</p><p>Think of your Azure account as a messy desk. If you just throw everything (servers, databases, networks) on the desk, you’ll never find anything. A <strong>Resource Group</strong> is like a <strong>Folder</strong>. You <em>must</em> put your new VNet inside a folder.</p><ul><li><strong>Resource Group:</strong> I created a new one called datacenter-rg.</li><li><strong>Name:</strong> I named my network datacenter-vnet.</li><li><strong>Region:</strong> I chose <strong>(US) Central US</strong>. This is just the physical location where the data center lives.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*EBfdgu-JA1CvIDEHB7vhHA.png" /><figcaption><em>Setting up the foundation. Notice the Resource Group — it acts like a folder for all my resources.</em></figcaption></figure><h3>Step 2: The Address Space</h3><p>Next, I moved to the <strong>IP Addresses</strong> tab. This is where we define the size of our network.</p><p>Azure asks for an “IPv4 address space.” If the VNet is your house, this is your street address. Azure usually suggests a default (like 10.0.0.0/16), which gives you thousands of internal IP addresses to use.</p><p>Since I am just learning, I stuck with the default. It’s plenty of space for a test lab!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*KQzKGXyHSLmUY8Sc7BiYoA.png" /><figcaption><em>Defining the internal IP range. The default settings are usually perfect for beginners.</em></figcaption></figure><h3>Wait, What About the “Security” and “Tags” Tabs?</h3><p>You might notice I skipped two tabs: <strong>Security</strong> and <strong>Tags</strong>. I left them as default to keep things simple, but it is important to know what they do for the real world.</p><h3>1. The Security Tab</h3><p>Think of this as hiring security guards for your house.</p><ul><li><strong>BastionHost:</strong> This lets you log into your servers securely without exposing them to the public internet.</li><li><strong>DDoS Protection:</strong> This stops attackers from flooding your network with junk traffic to crash it.</li><li><strong>Firewall:</strong> This filters who can come in and go out.</li><li><em>In a real company, you would definitely configure these!</em></li></ul><h3>2. The Tags Tab</h3><p>Tags are like <strong>Sticky Notes</strong> you slap onto your resources.</p><ul><li>You might add a tag saying Department: Finance or Project: Website.</li><li>Why? So when the bill comes at the end of the month, your boss knows exactly which team spent the money. It helps keep things organized.</li></ul><h3>Step 3: Review and Create</h3><p>Once I skipped past those optional tabs, I hit <strong>Review + create</strong>.</p><p>Azure takes a few seconds to run a “Validation.” This is basically Azure checking your work to make sure you didn’t make any typos or impossible configurations. Once I saw the green “Validation Passed” checkmark, I knew I was good to go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*4X3T2DFppRnAl2_lsaG9sg.png" /><figcaption><em>Always wait for that green validation checkmark!</em></figcaption></figure><h3>Step 4: Success!</h3><p>I clicked <strong>Create</strong>, and a few moments later, I got the notification: <strong>Your deployment is complete.</strong></p><p>And that’s it! I now have a private, isolated network in the Azure cloud. It might look like just a few clicks, but this datacenter-vnet is the foundation for everything else-servers, databases, and apps will all live inside here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCxkckbC4XwSMavL222Irg.png" /><figcaption><em>The best sight in cloud engineering — Deployment Complete.</em></figcaption></figure><h3>What’s Next?</h3><p>We have successfully built our “digital house” (the VNet) and organized it into a folder (the Resource Group). But right now, the house is empty. There is no furniture and no one living there!</p><p>The next logical step in this journey is to start moving things in — like <strong>Virtual Machines (VMs)</strong> or databases. That is where the real fun begins, seeing how these isolated networks actually allow servers to talk to each other securely.</p><p>If you have been hesitant to touch Azure, give this a try. It takes less than 5 minutes, and it is the perfect first step into the Microsoft cloud ecosystem. I’ll keep you posted on what I build inside this network next!</p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn </em></a><em>to follow my journey into DevOps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88d13f28e950" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Finally Understood AWS Subnets (And Created My First One!)]]></title>
            <link>https://medium.com/@pathumsandeepa13/how-i-finally-understood-aws-subnets-and-created-my-first-one-503453f035a7?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/503453f035a7</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 18:01:13 GMT</pubDate>
            <atom:updated>2026-01-23T18:01:13.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IxYwTsGCqoCLZe2He83ECA.png" /></figure><p>If you are anything like me, opening the AWS console for the first time feels a bit like stepping into the cockpit of a spaceship. There are buttons everywhere, strange acronyms, and a lingering fear that clicking the wrong thing might break the internet (or cost a fortune).</p><p>I recently had to do a task that sounded intimidating: <strong>“Create a subnet named </strong><strong>datacenter-subnet inside the default VPC.&quot;</strong></p><p>I had zero experience. But I figured it out, and I want to explain it simply so you can do it too. No complicated jargon, just the basics.</p><h3>First, what actually is a subnet?</h3><p>Before clicking anything, I needed to understand what I was building. The best way to think about it is with a house analogy:</p><ul><li><strong>The VPC (Virtual Private Cloud)</strong> is your <strong>House</strong>. It’s your private property where you live.</li><li><strong>The Subnet</strong> is a <strong>Room</strong> inside that house.</li></ul><p>You wouldn’t just throw your bed, your stove, and your bathtub into one big pile in the hallway, right? You build walls to separate them. You have a bedroom (private) and a living room (public).</p><p>In AWS, we do the same thing. We don’t dump our servers in a pile; we organize them into “rooms” called Subnets.</p><h3>Step 1: finding our “House” (The VPC)</h3><p>To build a room, you first need to know which house you are working on. In AWS, this is usually the “Default VPC.”</p><p>I went to the <strong>VPC Dashboard</strong> and clicked on <strong>Your VPCs</strong>. Here, I could see the default VPC already waiting for me. It’s important to note the “IPv4 CIDR” (the address range) because our new room needs to fit inside this address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1hDfEYmZCtIhc4To7EgJw.png" /><figcaption><em>This is our “house” — the default VPC where we will build our new room.</em></figcaption></figure><h3>Step 2: starting the construction</h3><p>Once I knew my VPC ID, I clicked on <strong>Subnets</strong> in the left menu and hit the big orange <strong>Create Subnet</strong> button.</p><p>The first thing AWS asks is: “Which VPC does this subnet belong to?”</p><p>I simply selected the Default VPC from the dropdown menu. This tells AWS, “I want to build my new room inside <em>this</em> building.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJiszDa1zx575r97aG5J3w.png" /><figcaption><em>Selecting the Default VPC ensures our subnet ends up in the right place.</em></figcaption></figure><h3>Step 3: the settings (The tricky part!)</h3><p>This is where most beginners (including me) get stuck. You have to fill out a form to define what this “room” looks like.</p><p>Here is exactly what I did:</p><ol><li><strong>Subnet Name:</strong> I named it datacenter-subnet. This is just a label so I can find it later.</li><li><strong>Availability Zone:</strong> I picked us-east-1a. Think of this as choosing which floor of the building the room is on.</li><li><strong>IPv4 CIDR block:</strong> This looks scary, but it’s just the address for the room.</li></ol><ul><li>The VPC address was 172.31.0.0/16.</li><li>I needed a slice of that, so I used 172.31.100.0/24.</li></ul><p><em>Tip: If you use a number that overlaps with another subnet, AWS will yell at you. Changing the third number (like changing 100 to 101) usually fixes it!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i49k9NdZqTIfEY6s1Q3JCw.png" /><figcaption><em>My configuration. Notice how the CIDR block is unique to this subnet.</em></figcaption></figure><h3>Step 4: success!</h3><p>After double-checking my numbers, I scrolled down and clicked <strong>Create</strong>.</p><p>A few seconds later, I saw the green banner. It’s such a small thing, but seeing that “Successfully created” message feels like a huge win when you are just starting out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4SmcjefaTfonOyX3ggacQ.png" /><figcaption><em>The green banner of victory!</em></figcaption></figure><h3>final thoughts</h3><p>It turns out, cloud engineering isn’t magic. It’s just organizing things. We took a big network (the VPC) and carved out a small, organized space (the Subnet) for our servers to live in.</p><p>If I can do it with zero experience, you definitely can too. Don’t be afraid to click around and break things (in a lab environment, of course!). That’s how we learn.</p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn </em></a><em>to follow my journey into DevOps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=503453f035a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No Portal? No Problem! Deploying Azure VMs with the CLI]]></title>
            <link>https://medium.com/@pathumsandeepa13/no-portal-no-problem-deploying-azure-vms-with-the-cli-47a9d66a6ac2?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/47a9d66a6ac2</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Sun, 11 Jan 2026 16:14:55 GMT</pubDate>
            <atom:updated>2026-01-11T16:14:55.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtKSP3DOu3iiJv_9NGNFRQ.png" /></figure><p>As a software engineer and CS undergraduate, I’m used to building things with code. But when it comes to Cloud Infrastructure, it’s tempting to rely on the beautiful graphical interfaces (GUIs) provided by AWS or Azure. We call this “ClickOps” — clicking buttons to get things done.</p><p>Today, in the <strong>KodeKloud 100 Days of Cloud Challenge</strong>, I hit a wall that forced me to leave “ClickOps” behind.</p><h3>The Challenge: “Access Denied”</h3><p>For this task, the scenario was intense. I needed to provision a Virtual Machine (VM) for a migration project, but there was a catch: <strong>The team does not have access to the Azure Portal.</strong></p><p>I was given a terminal, a username, and a list of requirements:</p><ul><li><strong>VM Name:</strong> xfusion-vm</li><li><strong>Image:</strong> Ubuntu 22.04</li><li><strong>Size:</strong> Standard_B2s</li><li><strong>Storage:</strong> 30GB Standard HDD (Strictly no Premium SSDs!)</li></ul><p>The only way forward was the <strong>Azure Command-Line Interface (CLI)</strong>.</p><h3>Step 1: Where am I?</h3><p>Without the portal, I couldn’t even see what “Resource Group” (the folder that holds my resources) I was supposed to use. In DevOps, you can’t build if you don’t know where to build.</p><p>I learned that the az command is your eyes and ears. I started by listing the groups available to me:</p><pre>az group list --output table</pre><p>This revealed my target Resource Group: kml_rg_main-7267c44bc40f4740.</p><h3>Step 2: The Mega-Command</h3><p>In the GUI, creating a VM takes about 5 screens of clicking “Next,” selecting dropdowns, and unchecking boxes. In the CLI, it’s <strong>one single command</strong>.</p><p>However, accuracy is key. I had to map every requirement from the task description to a specific “flag” in the command.</p><p>Here is the command I constructed:</p><pre>az vm create \<br>  --resource-group kml_rg_main-7267c44bc40f4740 \<br>  --name xfusion-vm \<br>  --image Ubuntu2204 \<br>  --size Standard_B2s \<br>  --admin-username azureuser \<br>  --generate-ssh-keys \<br>  --storage-sku Standard_LRS \<br>  --os-disk-size-gb 30</pre><h3>Breaking it Down</h3><p>As someone new to DevOps, understanding these flags was crucial:</p><ul><li>--image Ubuntu2204: Specifies the Operating System.</li><li>--size Standard_B2s: This defines the hardware (CPU/RAM).</li><li>--generate-ssh-keys: This is magic. It automatically creates the SSH key pair so I can log in securely without passwords.</li><li><strong>The Critical Flag:</strong> --storage-sku Standard_LRS.</li><li><em>Why this matters:</em> By default, Azure tries to give you Premium SSDs. If I hadn’t added this flag, the deployment would have failed because of the lab’s strict budget policies. This forces the use of a Standard HDD (“LRS” stands for Locally Redundant Storage).</li></ul><h3>The Result</h3><p>I hit Enter. The cursor blinked for about a minute.</p><p>Instead of a “Success” popup, I got a block of JSON output in the terminal showing the provisioningState: Succeeded and the new IP address.</p><h3>What I Learned</h3><p>Coming from a background in Full Stack development (React, Node, Laravel), I realized that <strong>Infrastructure as Code (IaC)</strong> is powerful.</p><ol><li><strong>Speed:</strong> Once I knew the command, I could create 100 servers in the time it takes to click through the portal for one.</li><li><strong>Precision:</strong> There’s no risk of accidentally clicking the wrong dropdown menu. The code is the documentation.</li><li><strong>Automation:</strong> I can now save this command in a script. Next time, I won’t even have to type it.</li></ol><p>This task pushed me out of my comfort zone, but it proved that the command line isn’t scary it’s just a more direct way to talk to the cloud.</p><p>On to the next challenge! 🚀</p><p><em>Connect with me on </em><a href="https://www.linkedin.com/in/pathumz/"><em>LinkedIn </em></a><em>to follow my journey into DevOps.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47a9d66a6ac2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero to Hero: Your First Laravel Project with Docker]]></title>
            <link>https://medium.com/@pathumsandeepa13/from-zero-to-hero-your-first-laravel-project-with-docker-56dfb36dbbbe?source=rss-2a30935b9c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/56dfb36dbbbe</guid>
            <dc:creator><![CDATA[Pathum Sandeepa]]></dc:creator>
            <pubDate>Sun, 10 Aug 2025 14:00:17 GMT</pubDate>
            <atom:updated>2025-08-11T02:41:35.203Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XezpEbK8doZG977J7bM7Tw.png" /></figure><p>Hey everyone! If you’re a PHP developer, you’ve probably heard the buzz around Docker. It promises clean, isolated development environments, but let’s be honest — getting started can feel like hitting a wall of YAML and confusing commands. I’ve been there!</p><p>Recently, I decided to set up a fresh Laravel 12 project using Docker, and I want to walk you through exactly how I did it, including the little errors I hit and how we can solve them. By the end of this post, you’ll have a fully containerized Laravel application running with Nginx and PostgreSQL, all managed by Docker.</p><p>This is the modern, professional way to build web apps, and it’s a killer skill to have, whether you’re freelancing or working for a company. Let’s dive in!</p><h3>What You’ll Need</h3><p>Before we start, make sure you have these two things installed on your machine:</p><ul><li><strong>Docker Desktop:</strong> The mothership for managing our containers.</li><li><strong>Composer:</strong> The dependency manager for PHP.</li></ul><h3>Step 1: Create a Fresh Laravel Project</h3><p>First things first, let’s get our Laravel code. Find a folder for your project, open your terminal or command prompt there, and run this command:</p><pre># The dot at the end tells it to install in the current folder<br>composer create-project laravel/laravel .</pre><p>This will download the latest version of Laravel and all its dependencies. Easy peasy.</p><h3>Step 2: The Docker “Recipe”, Our Dockerfile</h3><p>Next, we need to create a recipe that tells Docker how to build the “environment” or “image” for our application. This recipe is a file called a <strong>Dockerfile</strong>.</p><p>Create a file named Dockerfile (no extension!) In your project&#39;s root folder and paste this inside:</p><pre># Stage 1: The &quot;builder&quot; stage - installs dependencies<br>FROM php:8.2-alpine as builder<br><br># Install system dependencies and required PHP extensions<br>RUN apk add --no-cache $PHPIZE_DEPS postgresql-dev \<br>    &amp;&amp; docker-php-ext-install pdo pdo_pgsql pcntl<br><br># Get the latest version of Composer<br>COPY --from=composer:latest /usr/bin/composer /usr/bin/composer<br>WORKDIR /app<br>COPY . .<br><br># Install dependencies WITHOUT running scripts (this is important!)<br>RUN composer install --no-dev --no-interaction --optimize-autoloader --no-scripts<br><br># -----------------------------------------------------------------------------<br><br># Stage 2: The &quot;final&quot; stage - creates the lean production image<br>FROM php:8.2-fpm-alpine<br>WORKDIR /var/www/html<br><br># Install PostgreSQL driver and clean up build dependencies<br>RUN apk add --no-cache postgresql-libs \<br>    &amp;&amp; apk add --no-cache --virtual .build-deps $PHPIZE_DEPS postgresql-dev \<br>    &amp;&amp; docker-php-ext-install pdo pdo_pgsql \<br>    &amp;&amp; apk del .build-deps<br><br># Copy application code and vendor files from the builder stage<br>COPY --from=builder /app .<br><br># Set correct file permissions for Laravel<br>RUN chown -R www-data:www-data storage bootstrap/cache<br>EXPOSE 9000</pre><p><strong>What’s happening here?</strong> We’re using a “multi-stage build,” which is a pro-level trick.</p><ul><li><strong>Stage 1 (</strong><strong>builder)</strong> is a temporary workshop. We install all the tools we need (postgresql-dev), bring in Composer, and install our PHP packages.</li><li><strong>Stage 2 (</strong><strong>final)</strong> is the clean, final product. We start with a fresh, lightweight PHP image and only copy the finished application code over from the builder stage. This keeps our final image small and secure.</li></ul><h3>Step 3: The “Orchestra Conductor”, docker-compose.yml</h3><p>The It Dockerfile is a recipe for one dish. Now we need the master plan for the whole dinner party! That&#39;s our <strong>docker-compose.yml</strong> file. It defines all the services (containers) our app needs and makes them work together.</p><p>Create a file named docker-compose.yml in your project root and paste this in:</p><pre>services:<br>  # The Laravel Application Service<br>  app:<br>    build:<br>      context: .<br>      dockerfile: Dockerfile<br>    container_name: laravel_app<br>    restart: unless-stopped<br>    working_dir: /var/www/html<br>    volumes:<br>      - ./:/var/www/html<br>    networks:<br>      - laravel<br><br>  # The Nginx Web Server Service<br>  nginx:<br>    image: nginx:alpine<br>    container_name: laravel_nginx<br>    restart: unless-stopped<br>    ports:<br>      - &quot;8000:80&quot;<br>    volumes:<br>      - ./:/var/www/html<br>      - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf<br>    networks:<br>      - laravel<br>    depends_on:<br>      - app<br><br>  # The PostgreSQL Database Service<br>  db:<br>    image: postgres:15-alpine<br>    container_name: laravel_db<br>    restart: unless-stopped<br>    environment:<br>      POSTGRES_DB: laravel<br>      POSTGRES_USER: sandeepa<br>      POSTGRES_PASSWORD: password<br>    ports:<br>      - &quot;5432:5432&quot;<br>    volumes:<br>      - laravel_postgres_data:/var/lib/postgresql/data<br>    networks:<br>      - laravel<br><br>networks:<br>  laravel:<br>    driver: bridge<br><br>volumes:<br>  laravel_postgres_data:<br>    driver: local</pre><p>This file sets up our three services: app, nginx, and db. The most important parts are volumes, which sync our local code with the code inside the container (so we can edit live!), and networks, which lets the containers talk to each other.</p><h3>Step 4: The “Waiter” — Nginx Configuration</h3><p>Our Nginx service needs instructions. Create a folder path docker/nginx/ and inside it, create a file named default.conf.</p><pre>server {<br>    listen 80;<br>    server_name _;<br>    root /var/www/html/public;<br><br>    add_header X-Frame-Options &quot;SAMEORIGIN&quot;;<br>    add_header X-XSS-Protection &quot;1; mode=block&quot;;<br>    add_header X-Content-Type-Options &quot;nosniff&quot;;<br><br>    index index.php;<br>    charset utf-8;<br><br>    location / {<br>        try_files $uri $uri/ /index.php?$query_string;<br>    }<br><br>    location ~ \.php$ {<br>        fastcgi_pass app:9000;<br>        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;<br>        include fastcgi_params;<br>    }<br><br>    location ~ /\.(?!well-known).* {<br>        deny all;<br>    }<br>}</pre><p>Think of Nginx as the waiter in a restaurant. It takes requests from the browser and either serves simple files (like CSS or images) directly or passes the request to the “kitchen” (our app container on port 9000) to be processed by PHP.</p><h3>Step 5: Bringing It All to Life!</h3><p>Okay, the blueprints are ready. Time for the magic. In your terminal, run this one command:</p><pre>docker compose up -d --build</pre><p>This tells Docker to build our app image using the Dockerfile and then start all the services defined in docker-compose.yml in the background (-d). This will take a few minutes the first time.</p><h3>Step 6: Final Laravel Configuration</h3><p>The containers are running, but we have a couple of one-time setup steps left.</p><ol><li><strong>Create your </strong>.env<strong> file:</strong> In your project folder, copy the .env.example file and rename the copy to just .env.</li><li><strong>Edit the </strong>.env <strong>file:</strong> Open the new .env file and find the DB_ section. Replace it with this:</li></ol><pre>DB_CONNECTION=pgsql<br>DB_HOST=db<br>DB_PORT=5432<br>DB_DATABASE=laravel<br>DB_USERNAME=sandeepa<br>DB_PASSWORD=password</pre><p><strong>Crucial Tip:</strong> DB_HOST=db works because Docker lets containers find each other on the network using their service name from the docker-compose.yml file. No more 127.0.0.1!</p><p><strong>3. Run the final commands:</strong> Now, we’ll execute commands <em>inside</em> our running app container.</p><pre># Generate Laravel&#39;s application key<br>docker compose exec app php artisan key:generate<br><br># Run the database migrations to create the tables<br>docker compose exec app php artisan migrate</pre><p>And that’s it! Open your browser and go to <strong>http://localhost:8000</strong>. You should see the beautiful Laravel welcome page! 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZXZWilYfrN8fHV5JC0yzw.png" /></figure><h3>Bonus: How to Swap to MySQL?</h3><p>What if you prefer MySQL? It’s incredibly easy. In your docker-compose.yml file, just replace the entire db service with this:</p><pre># The MySQL Database Service<br>  db:<br>    image: mysql:8.0<br>    container_name: laravel_db<br>    restart: unless-stopped<br>    environment:<br>      MYSQL_DATABASE: laravel<br>      MYSQL_USER: sandeepa<br>      MYSQL_PASSWORD: password<br>      MYSQL_ROOT_PASSWORD: root_password # Required by MySQL image<br>    ports:<br>      - &quot;3306:3306&quot;<br>    volumes:<br>      - laravel_mysql_data:/var/lib/mysql<br>    networks:<br>      - laravel</pre><p>Then, update your .env file with the matching MySQL credentials. That&#39;s the power of Docker—swapping out a major component like a database is trivial.</p><h3>Final Tips for a Clean Setup</h3><ul><li><strong>The </strong><strong>--no-scripts flag was key!</strong> We added it to our composer install command because trying to run php artisan commands during the Docker build is a common mistake. The app isn&#39;t ready yet! Do the final setup <em>after</em> the container is running.</li><li><strong>Stop Everything:</strong> To shut down all your containers, just run docker compose down.</li><li><strong>Check the Logs:</strong> If something isn’t working, the first place to look is the logs. Run docker compose logs nginx or docker compose logs app to see what&#39;s happening.</li></ul><p>I hope this guide helps you get started on your Docker journey. It might seem like a lot of setup, but the stability and consistency it provides are totally worth it. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56dfb36dbbbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>