<?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 Kaveesha Sanduni Kodikara on Medium]]></title>
        <description><![CDATA[Stories by Kaveesha Sanduni Kodikara on Medium]]></description>
        <link>https://medium.com/@kaveeshasanduni200066?source=rss-d4b1406bac60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xQjKtEfdzbNU2rnp2Ldb2g@2x.jpeg</url>
            <title>Stories by Kaveesha Sanduni Kodikara on Medium</title>
            <link>https://medium.com/@kaveeshasanduni200066?source=rss-d4b1406bac60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:39:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kaveeshasanduni200066/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[What Actually Happens When a Request Hits a Spring Boot Application?]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/what-actually-happens-when-a-request-hits-a-spring-boot-application-c6a6ee37effe?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6a6ee37effe</guid>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 04:55:18 GMT</pubDate>
            <atom:updated>2026-09-14T04:55:18.330Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A step-by-step journey from an HTTP request to the database and back again.</em></p><p>When working with Spring Boot, we often write code like this:</p><pre>@GetMapping(&quot;/{id}&quot;)<br>public CustomerResponse getCustomer(@PathVariable Long id) {<br>    return customerService.getCustomer(id);<br>}</pre><p>We send a request:</p><pre>GET /api/customers/10</pre><p>And somehow, Spring Boot returns a response.</p><p>Simple, right?</p><p>But what actually happens between the moment the request reaches our application and the moment the client receives the response?</p><p>There is a lot happening behind that seemingly simple @GetMapping.</p><p>In this article, we’ll follow a single HTTP request through a typical Spring Boot application and understand the major components involved along the way.</p><h3>The Big Picture</h3><p>Let’s start with the overall journey.</p><pre>                         HTTP REQUEST<br>                              │<br>                              ▼<br>                     Embedded Web Server<br>                          (Tomcat)<br>                              │<br>                              ▼<br>                     DispatcherServlet<br>                              │<br>                              ▼<br>                       HandlerMapping<br>                              │<br>                              ▼<br>                         Controller<br>                              │<br>                              ▼<br>                           Service<br>                              │<br>                              ▼<br>                         Repository<br>                              │<br>                              ▼<br>                     Spring Data JPA<br>                              │<br>                              ▼<br>                         Hibernate<br>                              │<br>                              ▼<br>                           JDBC<br>                              │<br>                              ▼<br>                          Database<br>                              │<br>                              ▼<br>                     Result / Entity<br>                              │<br>                              ▼<br>                           Service<br>                              │<br>                              ▼<br>                         Controller<br>                              │<br>                              ▼<br>                           Jackson<br>                              │<br>                              ▼<br>                       HTTP RESPONSE<br>                              │<br>                              ▼<br>                           Client</pre><p>This diagram represents the core request-response lifecycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*84kvnvagLLu4d4paoZm6hw.png" /></figure><p>Now let’s break it down.</p><h3>1. Everything Starts With an HTTP Request</h3><p>Suppose a client wants to retrieve customer information.</p><p>It sends:</p><pre>GET /api/customers/10</pre><p>The request may contain:</p><pre>HTTP Method: GET<br>URL: /api/customers/10<br>Headers:<br>    Authorization: Bearer ...<br>    Accept: application/json</pre><p>For a POST request, there might also be a request body:</p><pre>{<br>    &quot;name&quot;: &quot;Kaveesha&quot;,<br>    &quot;email&quot;: &quot;kaveesha@example.com&quot;<br>}</pre><p>At this point, nothing has reached our controller yet.</p><p>The request first needs to be received by the web server running our application.</p><h3>2. The Request Reaches the Embedded Web Server</h3><p>When we run a typical Spring Boot application, we don’t necessarily need to install a separate application server.</p><p>Spring Boot can package an embedded web server such as Tomcat with the application.</p><p>For example:</p><pre>Spring Boot Application<br>        │<br>        └── Embedded Tomcat</pre><p>When the application starts, the embedded server listens on a configured port.</p><p>For example:</p><pre>http://localhost:8080</pre><p>When a client sends:</p><pre>GET /api/customers/10</pre><p>the request first arrives at the embedded server.</p><p>The server handles the HTTP-level communication and passes the request into the servlet infrastructure.</p><p>So the journey begins roughly like this:</p><pre>Client<br>   │<br>   │ HTTP Request<br>   ▼<br>Embedded Tomcat<br>   │<br>   ▼<br>Spring Web / Servlet Infrastructure</pre><p>This is one reason it is useful to understand that Spring Boot itself isn’t simply “receiving the request.” There is a web server underneath the Spring application.</p><h3>3. Enter the DispatcherServlet</h3><p>Now we reach one of the most important components in Spring MVC,</p><p>DispatcherServlet.</p><p>You can think of DispatcherServlet as the <strong>front controller</strong> of a Spring MVC application. Its responsibility is to coordinate the processing of incoming requests.</p><p>Conceptually:</p><pre>HTTP Request<br>      │<br>      ▼<br>DispatcherServlet<br>      │<br>      ├── Find appropriate handler<br>      ├── Invoke controller<br>      ├── Process result<br>      └── Create response</pre><p>Instead of every request directly finding a controller by itself, requests enter through this central mechanism. This is why DispatcherServlet is such an important part of understanding Spring MVC.</p><h3>4. How Does Spring Know Which Controller Should Handle the Request?</h3><p>Suppose we have this controller:</p><pre>@RestController<br>@RequestMapping(&quot;/api/customers&quot;)<br>public class CustomerController {<br><br>    @GetMapping(&quot;/{id}&quot;)<br>    public CustomerResponse getCustomer(@PathVariable Long id) {<br>        return customerService.getCustomer(id);<br>    }<br>}</pre><p>And the client sends:</p><pre>GET /api/customers/10</pre><p>How does Spring know that this request should execute:</p><pre>CustomerController.getCustomer()</pre><p>This is where <strong>HandlerMapping</strong> comes into the picture.</p><p>Spring maintains mappings between incoming requests and the appropriate handlers.</p><p>Conceptually:</p><pre>GET /api/customers/10<br>          │<br>          ▼<br>    HandlerMapping<br>          │<br>          ▼<br>CustomerController.getCustomer(10)</pre><p>Spring examines things such as:</p><ul><li>HTTP method</li><li>URL path</li><li>controller mappings</li><li>path variables</li><li>other request conditions</li></ul><p>and determines which handler should process the request.</p><h3>5. What Happens to the Path Variable?</h3><p>Our request contains:</p><pre>GET /api/customers/10</pre><p>Our controller contains:</p><pre>@GetMapping(&quot;/{id}&quot;)<br>public CustomerResponse getCustomer(@PathVariable Long id) {<br>    ...<br>}</pre><p>Spring extracts:</p><pre>id = 10</pre><p>and provides it to the method.</p><p>So:</p><pre>/api/customers/10<br>       │<br>       ▼<br>{id} = 10<br>       │<br>       ▼<br>@PathVariable Long id</pre><p>This is an example of Spring MVC handling request data and binding it to Java method parameters.</p><h3>6. What About Request Bodies?</h3><p>Path variables aren’t the only type of request data Spring handles.</p><p>Consider a POST request:</p><pre>POST /api/customers<br>Content-Type: application/json</pre><p>with:</p><pre>{<br>    &quot;name&quot;: &quot;Kaveesha&quot;,<br>    &quot;email&quot;: &quot;kaveesha@example.com&quot;<br>}</pre><p>Our controller might look like:</p><pre>@PostMapping<br>public CustomerResponse createCustomer(@RequestBody CustomerRequest request) {<br>             return customerService.createCustomer(request);<br>}</pre><p>But the request body is JSON, while our method expects a Java object.</p><p>How does that conversion happen?</p><p>This is where <strong>Jackson</strong> commonly comes into play.</p><p>Conceptually:</p><pre>JSON Request Body<br>       │<br>       ▼<br>     Jackson<br>       │<br>       ▼<br>CustomerRequest Java Object<br>       │<br>       ▼<br>   Controller</pre><p>So when we use:</p><pre>@RequestBody CustomerRequest request</pre><p>Spring uses its HTTP message conversion infrastructure to convert the incoming JSON into the Java object.</p><h3>7. Validation Happens Before Business Logic</h3><p>Suppose we don’t want an empty customer name.</p><p>We can define:</p><pre>public class CustomerRequest {<br>    @NotBlank<br>    private String name;<br>    @Email<br>    private String email;<br>}</pre><p>And then:</p><pre>@PostMapping<br>public CustomerResponse createCustomer(@Valid @RequestBody CustomerRequest request) {<br>return customerService.createCustomer(request);<br>}</pre><p>Now the flow can become:</p><pre>JSON<br> │<br> ▼<br>Jackson<br> │<br> ▼<br>Java Object<br> │<br> ▼<br>Validation<br> │<br> ├── Invalid → Error Response<br> │<br> └── Valid<br>       │<br>       ▼<br>   Controller</pre><p>If validation fails, the request may never reach the business logic.</p><p>For example, an invalid request could result in:</p><pre>400 Bad Request</pre><p>This is an important concept:</p><p><em>Not every request that reaches your application reaches your service layer.</em></p><p>There are several processing stages where a request can be rejected.</p><h3>8. The Controller Calls the Service</h3><p>Assuming the request is valid, our controller can call the service:</p><pre>@RestController<br>@RequestMapping(&quot;/api/customers&quot;)<br>public class CustomerController {<br><br>    private final CustomerService customerService;<br><br>    public CustomerController(CustomerService customerService) {<br>        this.customerService = customerService;<br>    }<br><br>    @GetMapping(&quot;/{id}&quot;)<br>    public CustomerResponse getCustomer(@PathVariable Long id) {<br>        return customerService.getCustomer(id);<br>    }<br>}</pre><p>The flow is now:</p><pre>Controller<br>    │<br>    ▼<br>Service</pre><p>Why do we usually separate these responsibilities?</p><p>Because the controller should primarily deal with the HTTP layer, while the service should contain the application’s business logic.</p><p>For example:</p><pre>Controller<br>    ↓<br>Receive request<br>    ↓<br>Validate/bind input<br>    ↓<br>Call service<br>    ↓<br>Return response</pre><p>while:</p><pre>Service<br>    ↓<br>Business rules<br>    ↓<br>Calculations<br>    ↓<br>Decisions<br>    ↓<br>Database operations through repositories</pre><p>This separation makes the application easier to maintain and test.</p><h3>9. But How Did Spring Provide the Service to the Controller?</h3><p>Look again at this:</p><pre>private final CustomerService customerService;<br><br>public CustomerController(CustomerService customerService) {<br>    this.customerService = customerService;<br>}</pre><p>We didn’t write:</p><pre>CustomerService service = new CustomerService();</pre><p>So who created it? Spring.</p><p>This is where <strong>Dependency Injection</strong> comes in.</p><p>If our service is:</p><pre>@Service<br>public class CustomerService {<br>    ...<br>}</pre><p>Spring detects it as a bean during application startup.</p><p>Conceptually:</p><pre>Application Startup<br>        │<br>        ▼<br>Spring scans components<br>        │<br>        ▼<br>Creates and manages beans<br>        │<br>        ▼<br>CustomerService bean<br>        │<br>        ▼<br>Injected into CustomerController</pre><p>This is one of the fundamental ideas behind the Spring Framework. The application doesn’t need to manually construct every dependency. The Spring container manages these objects and their relationships.</p><h3>10. The Service Calls the Repository</h3><p>Now our service might contain:</p><pre>@Service<br>public class CustomerService {<br><br>    private final CustomerRepository customerRepository;<br><br>    public CustomerService(CustomerRepository customerRepository) {<br>        this.customerRepository = customerRepository;<br>    }<br><br>    public CustomerResponse getCustomer(Long id) {<br>        Customer customer = customerRepository<br>                .findById(id)<br>                .orElseThrow(() -&gt;<br>                        new CustomerNotFoundException(id));<br>        return mapToResponse(customer);<br>    }<br>}</pre><p>The flow becomes:</p><pre>Controller<br>     │<br>     ▼<br> Service<br>     │<br>     ▼<br>Repository</pre><p>The repository is responsible for data access.</p><p>For example:</p><pre>public interface CustomerRepository extends JpaRepository&lt;Customer, Long&gt; {<br>}</pre><p>We didn’t write the implementation of findById() ourselves. Spring Data JPA provides the infrastructure behind it. And now things become more interesting.</p><h3>11. What Happens Behind findById()?</h3><p>When we write:</p><pre>customerRepository.findById(id);</pre><p>it looks very simple. But internally, several layers may be involved.</p><p>A simplified view is:</p><pre>CustomerRepository<br>        │<br>        ▼<br>Spring Data JPA<br>        │<br>        ▼<br>       JPA<br>        │<br>        ▼<br>    Hibernate<br>        │<br>        ▼<br>       JDBC<br>        │<br>        ▼<br>     Database</pre><p>Let’s understand these layers.</p><h3>12. Spring Data JPA</h3><p>Spring Data JPA provides repository abstractions that make database access much easier. Instead of writing repetitive data-access code, we can define:</p><pre>public interface CustomerRepository<br>        extends JpaRepository&lt;Customer, Long&gt; {<br>}</pre><p>and use methods such as:</p><pre>findById()<br>findAll()<br>save()<br>delete()</pre><p>We can also define query methods such as:</p><pre>findByEmail(String email)</pre><p>Spring Data can derive queries from method names in many common cases. This significantly reduces boilerplate code. But Spring Data JPA isn’t itself the database driver. Something still needs to communicate with the database.</p><h3>13. Hibernate Enters the Picture</h3><p>Hibernate is commonly used as the JPA implementation in Spring Boot applications. JPA is a specification. Hibernate is one implementation of that specification.</p><p>This distinction is important.</p><p>Think of it as:</p><pre>JPA<br> ↓<br>Specification / API<br> ↓<br>Hibernate<br> ↓<br>Implementation</pre><p>When we work with entities:</p><pre>@Entity<br>public class Customer {<br><br>    @Id<br>    @GeneratedValue<br>    private Long id;<br>    private String name;<br>    private String email;<br>}</pre><p>Hibernate manages the mapping between the Java object and the database representation.</p><p>Conceptually:</p><pre>Customer Java Object<br>        ↕<br>     Hibernate<br>        ↕<br>Customer Database Row</pre><h3>14. Hibernate Eventually Needs JDBC</h3><p>Hibernate doesn’t directly reinvent the low-level database communication protocol.</p><p>At the lower level, JDBC provides the standard Java API for communicating with relational databases.</p><p>The simplified stack looks like:</p><pre>Your Code<br>   ↓<br>Spring Data JPA<br>   ↓<br>  JPA<br>   ↓<br>Hibernate<br>   ↓<br>  JDBC<br>   ↓<br>Database Driver<br>   ↓<br>Database</pre><p>The exact internals can vary depending on the application and configuration, but this gives us a useful mental model.</p><h3>15. The Database Executes the Query</h3><p>Eventually, the database receives a SQL query.</p><p>Conceptually, something like:</p><pre>SELECT *<br>FROM customer<br>WHERE id = 10;</pre><p>The database processes the query and returns the result. The response then travels back through the stack:</p><pre>Database<br>   │<br>   ▼<br>  JDBC<br>   │<br>   ▼<br>Hibernate<br>   │<br>   ▼<br>JPA / Spring Data<br>   │<br>   ▼<br>Customer Entity</pre><p>Hibernate can materialize the database result into a Java entity.</p><p>For example:</p><pre>Database Row<br>     ↓<br>Customer Entity</pre><h3>16. The Result Travels Back to the Service</h3><p>Our service receives the entity:</p><pre>Customer customer = customerRepository.findById(id).orElseThrow(...);</pre><p>The service can then apply business logic.</p><p>For example:</p><pre>return mapToResponse(customer);</pre><p>The service might convert:</p><pre>Customer Entity<br>       ↓<br>CustomerResponse DTO</pre><p>This separation between database entities and API response models can help prevent internal persistence details from leaking directly into the API.</p><h3>17. The Controller Returns the Result</h3><p>Eventually, the controller receives the response object:</p><pre>@GetMapping(&quot;/{id}&quot;)<br>public CustomerResponse getCustomer(@PathVariable Long id) {<br>    return customerService.getCustomer(id);<br>}</pre><p>Suppose the returned object contains:</p><pre>CustomerResponse(<br>    10,<br>    &quot;Kaveesha&quot;,<br>    &quot;kaveesha@example.com&quot;<br>)</pre><p>But the client expects JSON. So another conversion needs to happen.</p><h3>18. Java Object Becomes JSON</h3><p>This is where Jackson commonly comes back into the picture.</p><p>Conceptually:</p><pre>CustomerResponse<br>       │<br>       ▼<br>     Jackson<br>       │<br>       ▼<br>     JSON</pre><p>The client might receive:</p><pre>{<br>    &quot;id&quot;: 10,<br>    &quot;name&quot;: &quot;Kaveesha&quot;,<br>    &quot;email&quot;: &quot;kaveesha@example.com&quot;<br>}</pre><p>Spring’s HTTP message conversion infrastructure handles this object-to-HTTP-response conversion. So the journey is now almost complete.</p><h3>19. The HTTP Response Goes Back to the Client</h3><p>The final response might look like:</p><pre>HTTP/1.1 200 OK<br>Content-Type: application/json</pre><pre>{<br>    &quot;id&quot;: 10,<br>    &quot;name&quot;: &quot;Kaveesha&quot;,<br>    &quot;email&quot;: &quot;kaveesha@example.com&quot;<br>}</pre><p>And the client receives it.</p><p>The complete journey is now:</p><pre>Client<br>  │<br>  │ GET /api/customers/10<br>  ▼<br>Tomcat<br>  │<br>  ▼<br>DispatcherServlet<br>  │<br>  ▼<br>HandlerMapping<br>  │<br>  ▼<br>Controller<br>  │<br>  ▼<br>Service<br>  │<br>  ▼<br>Repository<br>  │<br>  ▼<br>Spring Data JPA<br>  │<br>  ▼<br>Hibernate<br>  │<br>  ▼<br>JDBC<br>  │<br>  ▼<br>Database<br>  │<br>  │ Result<br>  ▼<br>Hibernate<br>  │<br>  ▼<br>Entity<br>  │<br>  ▼<br>Service<br>  │<br>  ▼<br>Controller<br>  │<br>  ▼<br>Jackson<br>  │<br>  ▼<br>HTTP Response<br>  │<br>  ▼<br>Client</pre><p>And all of this can happen because we wrote a relatively small amount of application code.</p><h3>20. What Happens When Something Goes Wrong?</h3><p>So far, we’ve looked at the happy path. Real applications aren’t always this cooperative. A request can fail at many different stages.</p><h3>Invalid JSON</h3><pre>Client<br>  ↓<br>Invalid JSON<br>  ↓<br>Request parsing fails<br>  ↓<br>400 Bad Request</pre><h3>Validation Failure</h3><pre>Request<br>  ↓<br>Validation<br>  ↓<br>Invalid data<br>  ↓<br>400 Bad Request</pre><h3>Resource Doesn’t Exist</h3><pre>Controller<br>  ↓<br>Service<br>  ↓<br>Repository<br>  ↓<br>No Customer Found<br>  ↓<br>CustomerNotFoundException<br>  ↓<br>404 Not Found</pre><h3>Unexpected Application Error</h3><pre>Application Error<br>      ↓<br>Exception<br>      ↓<br>Exception Handler<br>      ↓<br>500 Internal Server Error</pre><p>This is why exception handling is an important part of a Spring Boot application.</p><h3>21. Where Does @RestControllerAdvice Fit?</h3><p>Instead of handling every exception inside every controller, we can centralize exception handling.</p><p>For example:</p><pre>@RestControllerAdvice<br>public class GlobalExceptionHandler {<br><br>    @ExceptionHandler(CustomerNotFoundException.class)<br>    public ResponseEntity&lt;?&gt; handleCustomerNotFound(<br>            CustomerNotFoundException ex) {<br>        return ResponseEntity<br>                .status(HttpStatus.NOT_FOUND)<br>                .body(ex.getMessage());<br>    }<br>}</pre><p>Now the flow can be:</p><pre>Controller<br>    ↓<br>Service<br>    ↓<br>Exception<br>    ↓<br>@RestControllerAdvice<br>    ↓<br>HTTP Error Response</pre><p>This keeps controllers cleaner and gives us a consistent API error structure.</p><h3>22. What About Authentication and Authorization?</h3><p>In real-world applications, the request may also pass through a security layer before reaching the controller.</p><p>For example:</p><pre>Client<br>  │<br>  ▼<br>HTTP Request<br>  │<br>  ▼<br>Security Filters<br>  │<br>  ├── Authentication<br>  ├── Authorization<br>  └── Security checks<br>  │<br>  ▼<br>DispatcherServlet<br>  │<br>  ▼<br>Controller</pre><p>If the request doesn’t contain valid authentication credentials, it may never reach the controller.</p><p>For example:</p><pre>401 Unauthorized</pre><p>or:</p><pre>403 Forbidden</pre><p>depending on the situation. This is another good reminder that the controller is only one part of the request lifecycle.</p><h3>23. The Request Lifecycle Is More Than Controller → Service → Repository</h3><p>A common simplified diagram is:</p><pre>Controller<br>   ↓<br>Service<br>   ↓<br>Repository<br>   ↓<br>Database</pre><p>This is useful for understanding application architecture.</p><p>But the actual request lifecycle is broader.</p><p>There can be:</p><ul><li>Web server processing</li><li>Servlet filters</li><li>Spring Security filters</li><li>DispatcherServlet</li><li>HandlerMapping</li><li>Interceptors</li><li>Argument resolution</li><li>Validation</li><li>Message conversion</li><li>Controller invocation</li><li>Service logic</li><li>Repository operations</li><li>Hibernate/JPA</li><li>JDBC</li><li>Database interaction</li><li>Exception handling</li><li>Response serialization</li></ul><p>So when we say: <em>“The request hits the controller.”</em></p><p>that’s really only describing one point in a much larger pipeline.</p><h3>24. One Request, Many Layers</h3><p>Let’s put everything together one final time.</p><pre>┌──────────────────────────────┐<br>│          CLIENT              │<br>└──────────────┬───────────────┘<br>               │<br>               │ HTTP Request<br>               ▼<br>┌──────────────────────────────┐<br>│       EMBEDDED TOMCAT        │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│       FILTERS / SECURITY     │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│      DISPATCHERSERVLET       │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│       HANDLER MAPPING        │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│         CONTROLLER           │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│           SERVICE            │<br>│       Business Logic         │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│          REPOSITORY          │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│       SPRING DATA JPA        │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│          HIBERNATE           │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│            JDBC              │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│          DATABASE            │<br>└──────────────┬───────────────┘<br>               │<br>               │ Result<br>               ▼<br>        ...same journey back...<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│           JACKSON            │<br>│      Java Object → JSON      │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│        HTTP RESPONSE         │<br>└──────────────┬───────────────┘<br>               │<br>               ▼<br>┌──────────────────────────────┐<br>│           CLIENT             │<br>└──────────────────────────────┘</pre><h3>Final Thoughts</h3><p>The next time you write:</p><pre>@GetMapping(&quot;/{id}&quot;)</pre><p>remember that you’re only seeing the surface. Behind that one annotation is a complete request-processing pipeline.</p><p>A request can travel through:</p><p><strong>Web Server → Filters → DispatcherServlet → HandlerMapping → Controller → Service → Repository → JPA/Hibernate → JDBC → Database</strong></p><p>and then travel back through another set of mechanisms before becoming an HTTP response.</p><p>Understanding this lifecycle changes the way you debug and design Spring Boot applications.</p><p>When an API is slow, you can start asking:</p><p><em>Is the problem in the controller?</em></p><p>Or:</p><p><em>Is the database query slow?</em></p><p>Or:</p><p><em>Is Hibernate generating an inefficient query?</em></p><p>Or:</p><p><em>Is the request spending time in an external API?</em></p><p>Or:</p><p><em>Is connection pooling causing the delay?</em></p><p>Similarly, when a request returns an unexpected status code, you can ask:</p><p><em>At which stage did the request actually fail?</em></p><p>That’s the real benefit of understanding what’s happening underneath Spring Boot.</p><p><strong>Don’t just learn which annotation to use. Understand what happens after you use it.</strong></p><h3>What to Remember ?</h3><p>If you remember only one diagram from this article, remember this:</p><pre>HTTP Request<br>     ↓<br>Web Server<br>     ↓<br>DispatcherServlet<br>     ↓<br>Controller<br>     ↓<br>Service<br>     ↓<br>Repository<br>     ↓<br>JPA / Hibernate<br>     ↓<br>    JDBC<br>     ↓<br>  Database<br>     ↓<br>  Result<br>     ↓<br>  Service<br>     ↓<br>  Controller<br>     ↓<br>  Jackson<br>     ↓<br>HTTP Response</pre><p>Once you understand this journey, many Spring Boot concepts that initially seem unrelated start to fit together. And that’s when Spring Boot becomes much easier to understand, not as a collection of annotations, but as a framework coordinating a complete request-processing pipeline.</p><p><strong>If you found this useful, follow me for more practical articles about Java, Spring Boot, backend engineering, automation, and real-world software development.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6a6ee37effe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Airflow for Enterprise Data Pipelines: From ETL Concepts to Real-World Implementation]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/apache-airflow-for-enterprise-data-pipelines-from-etl-concepts-to-real-world-implementation-46407bc6b98a?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/46407bc6b98a</guid>
            <category><![CDATA[workflow-orchestration]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[etl]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 09:41:04 GMT</pubDate>
            <atom:updated>2026-08-11T09:41:04.408Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern applications generate large amounts of data every day. In an enterprise environment, the challenge is not simply storing that data; it is <strong>moving, transforming, validating, and processing it reliably</strong>. This is where data pipelines become important.</p><p>During my work with enterprise systems in the insurance domain, I worked with <strong>Apache Airflow</strong> to build and manage an ETL pipeline involving <strong>MariaDB and PostgreSQL</strong>, using Docker-based infrastructure.</p><p>This article introduces Apache Airflow from an engineering perspective and then connects its concepts to a real-world ETL implementation.</p><h4>What is Apache Airflow ?</h4><p><a href="https://airflow.apache.org/">Apache Airflow</a> is an open-source platform for <strong>developing, scheduling, and monitoring batch-oriented workflows</strong>.</p><p>Instead of manually executing a sequence of scripts or database operations, Airflow allows us to define workflows programmatically and manage their execution through a central platform.</p><p>A simplified workflow might look like:</p><pre>Source Database<br>      ↓<br>   Extract<br>      ↓<br>   Transform<br>      ↓<br>     Load<br>      ↓<br>Target Database</pre><p>But in a real enterprise environment, a data pipeline usually involves much more:</p><pre>                    ┌───────────────┐<br>                    │   Scheduler   │<br>                    └───────┬───────┘<br>                            │<br>                            ▼<br>                    ┌───────────────┐<br>                    │   Airflow DAG │<br>                    └───────┬───────┘<br>                            │<br>              ┌─────────────┼─────────────┐<br>              ▼             ▼             ▼<br>          Extract        Transform       Load<br>              │             │             │<br>              ▼             ▼             ▼<br>          MariaDB       Processing     PostgreSQL</pre><p>This orchestration layer is what makes Airflow particularly useful for complex data workflows.</p><h3>Why use Airflow for ETL ?</h3><p>A simple ETL script can work perfectly well when the requirements are small.</p><p>However, as the system grows, several questions appear:</p><ul><li>When should the pipeline run?</li><li>What happens if one task fails?</li><li>How do we retry a failed operation?</li><li>How do we monitor executions?</li><li>Which tasks depend on other tasks?</li><li>How do we prevent unnecessary processing?</li><li>How can we troubleshoot historical executions?</li><li>How do we manage multiple pipelines?</li></ul><p>Airflow provides mechanisms for handling these concerns.</p><p>It gives us:</p><ul><li>Workflow orchestration</li><li>Scheduling</li><li>Task dependencies</li><li>Retry mechanisms</li><li>Monitoring</li><li>Logging</li><li>Execution history</li><li>Parameterization</li><li>Extensibility</li></ul><p>The important distinction is that <strong>Airflow is primarily an orchestration platform, not an ETL engine itself</strong>.</p><p>It coordinates the work performed by databases, Python code, APIs, Spark, cloud services, and other systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*6uScq9LdVitTeZ2QNsI7dw.png" /></figure><h3>Understanding the Core Concept: DAG</h3><p>One of the most important concepts in Airflow is the <strong>DAG (Directed Acyclic Graph)</strong>.</p><p>A DAG represents a workflow and defines:</p><ul><li>What tasks need to execute</li><li>The order in which they execute</li><li>Dependencies between tasks</li><li>Scheduling information</li></ul><p>For example:</p><pre>Extract Data<br>     ↓<br>Validate Data<br>     ↓<br>Transform Data<br>     ↓<br>Load Data<br>     ↓<br>Validate Load</pre><p>Each step can be represented as an individual Airflow task. The DAG describes the relationship between those tasks.</p><h3>What is an Airflow Task?</h3><p>A task represents an individual unit of work inside a DAG.</p><p>For example:</p><pre>* extract_data<br>* transform_data<br>* load_data</pre><p>Each task should ideally have a clearly defined responsibility.</p><p>A simplified example:</p><pre>from airflow import DAG<br>from airflow.operators.python import PythonOperator<br>from datetime import datetime<br><br>def extract_data():<br>    print(&quot;Extracting data...&quot;)<br>def transform_data():<br>    print(&quot;Transforming data...&quot;)<br>def load_data():<br>    print(&quot;Loading data...&quot;)<br>with DAG(<br>    dag_id=&quot;example_etl&quot;,<br>    start_date=datetime(2026, 1, 1),<br>    schedule=&quot;@daily&quot;,<br>    catchup=False<br>) as dag:<br>    extract = PythonOperator(<br>        task_id=&quot;extract_data&quot;,<br>        python_callable=extract_data<br>    )<br>    transform = PythonOperator(<br>        task_id=&quot;transform_data&quot;,<br>        python_callable=transform_data<br>    )<br>    load = PythonOperator(<br>        task_id=&quot;load_data&quot;,<br>        python_callable=load_data<br>    )<br>    extract &gt;&gt; transform &gt;&gt; load</pre><p>The important part here is:</p><pre>extract &gt;&gt; transform &gt;&gt; load</pre><p>This defines the dependency:</p><pre>Extract → Transform → Load</pre><p>Airflow can therefore understand which task needs to execute first.</p><h3>Scheduling: One of Airflow’s most useful features</h3><p>Without orchestration, a developer might have to manually execute scripts or configure separate operating-system jobs. Airflow allows workflows to be scheduled centrally.</p><p>For example:</p><pre>schedule=&quot;@daily&quot;</pre><p>means the workflow can be scheduled to run daily. Other scheduling strategies can be used depending on the business requirement. This becomes particularly useful in enterprise environments where data processing must happen consistently without manual intervention.</p><h3>My Real-World ETL Scenario</h3><p>In my implementation, the objective was to move and process data between <strong>MariaDB </strong>and <strong>PostgreSQL</strong> using an Airflow-managed pipeline.</p><p>The high-level architecture was:</p><pre>                 Apache Airflow<br>                       │<br>                       ▼<br>                 ┌───────────┐<br>                 │    DAG    │<br>                 └─────┬─────┘<br>                       │<br>              ┌────────┴────────┐<br>              ▼                 ▼<br>          MariaDB           PostgreSQL<br>           Source              Target</pre><p>The pipeline was containerized using <strong>Docker</strong>, allowing the required components to run in a controlled and reproducible environment. This approach also made it easier to isolate the services and configure their connections.</p><h3>Docker-Based Airflow Environment</h3><p>A typical Airflow environment can contain several components.</p><p>For example:</p><pre>┌─────────────────────────────┐<br>│          Docker             │<br>│                             │<br>│  ┌───────────────┐          │<br>│  │ Airflow       │          │<br>│  │ Scheduler     │          │<br>│  └───────────────┘          │<br>│                             │<br>│  ┌───────────────┐          │<br>│  │ Airflow       │          │<br>│  │ Webserver     │          │<br>│  └───────────────┘          │<br>│                             │<br>│  ┌───────────────┐          │<br>│  │ MariaDB       │          │<br>│  └───────────────┘          │<br>│                             │<br>│  ┌───────────────┐          │<br>│  │ PostgreSQL    │          │<br>│  └───────────────┘          │<br>│                             │<br>└─────────────────────────────┘</pre><p>Running these components through Docker provides several advantages:</p><ul><li>Consistent environments</li><li>Easier setup and teardown</li><li>Service isolation</li><li>Reproducibility</li><li>Simplified dependency management</li></ul><p>However, Docker also introduces another important engineering consideration: <strong>networking</strong>.</p><p>For example, when one container needs to communicate with another container, using localhost does not generally refer to the other container. Instead, Docker service names or appropriate network configuration should be used.</p><p>This is a small configuration detail that can cause significant debugging time when building containerized data pipelines.</p><h3>Extracting Data from MariaDB</h3><p>The extraction stage is responsible for reading data from the source database.</p><p>Conceptually:</p><pre>MariaDB<br>   │<br>   │ SQL Query<br>   ▼<br>Extracted Dataset</pre><p>In a production-style implementation, the query should not simply retrieve everything blindly.</p><p>The extraction strategy should consider:</p><ul><li>Required columns</li><li>Filtering</li><li>Incremental processing</li><li>Indexes</li><li>Data volume</li><li>Query performance</li><li>Connection management</li></ul><p>This becomes particularly important when dealing with millions of records.</p><p>During my implementation, the extraction query involved <strong>millions of records</strong>, which highlighted an important lesson:</p><p><em>A data pipeline that works for thousands of records is not necessarily a pipeline that will work efficiently for millions.</em></p><h3>The Challenge of Large Data Volumes</h3><p>One of the most important considerations in ETL is data volume.</p><p>Suppose a query returns:</p><pre>10,000 records</pre><p>A straightforward approach may work without noticeable problems.</p><p>Now imagine:</p><pre>10,000,000 + records</pre><p>The same approach can create problems involving:</p><ul><li>Memory consumption</li><li>Network traffic</li><li>Query execution time</li><li>Database locks</li><li>Transaction duration</li><li>Airflow task execution time</li></ul><p>Therefore, ETL design needs to consider <strong>how much data is processed at once</strong>.</p><p>Possible strategies include:</p><h4>Batch Processing</h4><p>Instead of processing everything at once:</p><pre>10M records<br>     ↓<br> ┌───┼───┬───┬───┐<br> ▼   ▼   ▼   ▼   ▼<br>Batch Batch Batch Batch ...</pre><p>Data can be processed in manageable chunks.</p><h4>Incremental Processing</h4><p>Rather than repeatedly processing historical data, the pipeline can identify new or changed records.</p><p>For example:</p><pre>Last successful timestamp<br>          ↓<br>Extract only newer records<br>          ↓<br>      Transform<br>          ↓<br>        Load</pre><p>This can significantly reduce unnecessary processing.</p><h4>Loading Data into PostgreSQL</h4><p>After extraction and transformation, the data is loaded into the target PostgreSQL database.</p><p>The simplified process is:</p><pre>MariaDB<br>   ↓<br>Extract<br>   ↓<br>Transform<br>   ↓<br>Validate<br>   ↓<br>PostgreSQL</pre><p>However, loading data safely requires more than simply executing an INSERT.</p><p>Important considerations include:</p><ul><li>Duplicate records</li><li>Primary keys</li><li>Constraints</li><li>Transaction handling</li><li>Data type compatibility</li><li>Failed records</li><li>Performance</li><li>Retry behavior</li></ul><p>For large datasets, the loading strategy can have a significant impact on overall pipeline performance.</p><h3>Error handling is not optional</h3><p>One of the biggest differences between a simple script and an enterprise workflow is <strong>failure handling</strong>.</p><p>Imagine this workflow:</p><pre> Extract<br>   ↓<br>Transform<br>   ↓<br>  Load</pre><p>If the Load task fails, what happens?</p><p>A robust workflow should allow us to:</p><ul><li>Detect the failure</li><li>Capture logs</li><li>Identify the failed task</li><li>Retry when appropriate</li><li>Investigate the root cause</li><li>Resume safely</li></ul><p>Airflow provides task-level execution states and logging that make this easier to manage.</p><p>For example:</p><pre>  Extract     SUCCESS<br>     ↓<br>Transform     SUCCESS<br>     ↓<br>   Load       FAILED<br>     ↓<br>   Retry<br>     ↓<br>   Load       SUCCESS</pre><p>This is one of the reasons orchestration becomes increasingly important as workflows become more complex.</p><h3>Monitoring through the Airflow UI</h3><p>Another major advantage of Airflow is its web interface.</p><p>Instead of checking multiple scripts manually, developers can inspect:</p><ul><li>DAG status</li><li>Task status</li><li>Execution history</li><li>Logs</li><li>Task duration</li><li>Failed executions</li><li>Retry attempts</li></ul><p>A typical workflow might show:</p><pre>DAG<br> │<br> ├── Extract      ✓<br> │<br> ├── Transform    ✓<br> │<br> ├── Load         ✗<br> │<br> └── Validation   -</pre><p>This provides a centralized view of the pipeline’s health.</p><p>For enterprise applications, observability is not just a convenience, it is an important part of operational reliability.</p><h3>Airflow vs Traditional Scheduled Scripts</h3><p>A common question is: <strong>Why not simply use cron jobs or scheduled scripts?</strong></p><p>Cron can be perfectly suitable for simple workloads.</p><p>For example:</p><pre>Cron<br>  ↓<br>Python Script<br>  ↓<br>Database</pre><p>But as workflows become more complex:</p><pre>Extract<br>  ↓<br>Validate<br>  ↓<br>Transform<br>  ↓<br>Load<br>  ↓<br>Validate<br>  ↓<br>Notify</pre><p>Managing dependencies, retries, monitoring, logs, and execution history manually becomes increasingly difficult.</p><p>Airflow provides an orchestration layer around these processes. This does not mean Airflow should replace every cron job. The right tool depends on the complexity and requirements of the workload.</p><h3>Lessons from Implementing ETL with Airflow</h3><p>Working with Airflow and a database-to-database ETL pipeline reinforced several important engineering principles.</p><h4>1. Data volume should influence architecture</h4><p>The pipeline design should consider the size of the dataset from the beginning. Millions of records require a different strategy from thousands.</p><h4>2. Orchestration and processing are different responsibilities</h4><p>Airflow coordinates the workflow.</p><p>The actual data processing can happen in:</p><ul><li>SQL</li><li>Python</li><li>Spark</li><li>APIs</li><li>Database procedures</li><li>External services</li></ul><p>Understanding this distinction helps prevent using Airflow for responsibilities it was not designed to handle.</p><h4>3. Failure handling should be designed upfront</h4><p>Retries, logging, validation, and recovery should not be afterthoughts. They should be part of the pipeline design.</p><h4>4. Containerization introduces networking considerations</h4><p>Docker makes environments reproducible, but developers need to understand how containers communicate with each other.</p><h4>5. ETL performance starts with the database</h4><p>Poor extraction queries can become the bottleneck before Airflow itself becomes an issue. Indexes, filtering, batching, and query design matter significantly.</p><h3>Where Airflow Fits in Enterprise Architecture</h3><p>A modern enterprise architecture may contain multiple systems:</p><pre>               Enterprise Applications<br>                          │<br>             ┌────────────┼────────────┐<br>             ▼            ▼            ▼<br>          APIs         Databases      Files<br>             │            │            │<br>             └────────────┼────────────┘<br>                          ▼<br>                    Data Pipelines<br>                          │<br>                          ▼<br>                    Apache Airflow<br>                          │<br>             ┌────────────┼────────────┐<br>             ▼            ▼            ▼<br>        Transform       Validate       Load<br>             │            │            │<br>             └────────────┼────────────┘<br>                          ▼<br>                    Data Platform</pre><p>Airflow can sit between operational systems and downstream data platforms, orchestrating the movement and processing of data.</p><p>In an insurance environment, this can support scenarios such as:</p><ul><li>Transaction data processing</li><li>Policy-related data pipelines</li><li>Claims data integration</li><li>Reporting data preparation</li><li>Data synchronization</li><li>Analytical workloads</li><li>Scheduled data processing</li></ul><p>The exact architecture depends on the organization’s systems and business requirements.</p><h3>n8n and Airflow: Different Problems, Different Strengths</h3><p>After working with both <strong>n8n and Apache Airflow</strong>, one important distinction becomes clear. They can both orchestrate workflows, but they are optimized for different types of problems.</p><h3>n8n</h3><p>Best suited for:</p><ul><li>API integrations</li><li>Business process automation</li><li>Notifications</li><li>SaaS integrations</li><li>Event-driven workflows</li><li>Low-code automation</li></ul><p>Example:</p><pre>API<br> ↓<br>Process<br> ↓<br>Database<br> ↓<br>Send SMS</pre><h3>Apache Airflow</h3><p>Best suited for:</p><ul><li>Batch data pipelines</li><li>ETL/ELT</li><li>Data engineering workflows</li><li>Scheduled processing</li><li>Complex task dependencies</li><li>Data platform orchestration</li></ul><p>Example:</p><pre>Database<br> ↓<br>Extract<br> ↓<br>Transform<br> ↓<br>Validate<br> ↓<br>Load<br> ↓<br>Analytics</pre><p>The important point is that these tools are not necessarily competitors. They can complement each other within a larger enterprise architecture.</p><h3>Final Thoughts</h3><p>Apache Airflow is more than a scheduler. It provides a framework for <strong>orchestrating reliable, observable, and maintainable data workflows</strong>.</p><p>My experience implementing a MariaDB-to-PostgreSQL ETL pipeline reinforced that building a data pipeline is not simply about moving records from one database to another.</p><p>A production-ready pipeline requires consideration of:</p><ul><li>Data volume</li><li>Query performance</li><li>Task dependencies</li><li>Error handling</li><li>Retries</li><li>Monitoring</li><li>Data validation</li><li>Containerization</li><li>Database design</li><li>Operational reliability</li></ul><p>The technology is only one part of the solution.</p><p>The bigger challenge is designing a workflow that can continue to operate reliably as <strong>data volume, business requirements, and system complexity increase</strong>. That is where workflow orchestration becomes valuable.</p><p>And that is ultimately what Apache Airflow brings to the table: <strong>a structured way to turn individual data-processing steps into manageable, observable workflows.</strong></p><h3>Technologies Covered</h3><p><strong>Apache Airflow · Python · Docker · MariaDB · PostgreSQL · SQL · ETL · Data Engineering · Workflow Orchestration · Enterprise Systems</strong></p><p><em>This article describes technical concepts and implementation patterns based on my experience working with enterprise data workflows. Specific organizational data, business rules, and confidential implementation details have been intentionally omitted.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46407bc6b98a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond Drag-and-Drop: Using n8n for Enterprise Workflow Automation in the Insurance Industry]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/beyond-drag-and-drop-using-n8n-for-enterprise-workflow-automation-in-the-insurance-industry-ed8d340c958f?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed8d340c958f</guid>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[enterprise-architecture]]></category>
            <category><![CDATA[n8n]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Wed, 05 Aug 2026 09:11:38 GMT</pubDate>
            <atom:updated>2026-08-05T09:11:38.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVuZsgzsbBAaC8lRpvdivg.jpeg" /></figure><p>Workflow automation has become a critical capability for organizations that manage high volumes of repetitive, rule-based business processes. In industries such as insurance, where customer communication, policy servicing, payment reminders, and operational monitoring occur continuously, automation is no longer just a productivity enhancement, it is an operational requirement.</p><p>As an <strong>Associate Software Engineer working in the insurance domain</strong>, my primary responsibilities involve backend development, API integration, database operations, and enterprise application support. While Java and Spring Boot remain the foundation of many of the systems I work with, I recently had the opportunity to design and implement workflow automation using <strong>n8n</strong>, an open-source workflow orchestration platform.</p><p>What initially appeared to be a simple automation tool proved to be a practical solution for building reliable, production-ready workflows that interact with databases, REST APIs, scheduling systems, and external messaging services.</p><h3>Why Workflow Automation Matters in Insurance ?</h3><p>Insurance systems typically involve multiple interconnected processes.</p><p>A single business operation may require:</p><ul><li>Retrieving records from a database</li><li>Evaluating business conditions</li><li>Triggering customer notifications</li><li>Updating operational statuses</li><li>Recording audit logs</li><li>Handling failures and retries</li></ul><p>Traditionally, these tasks are implemented through scheduled backend services or custom integration modules. While that approach works well, it often requires additional development effort, deployment cycles, and maintenance overhead for workflows that are primarily orchestration rather than business logic.</p><p>This is where <strong>n8n</strong> becomes valuable. It allows developers to orchestrate existing services, APIs, and databases without replacing the underlying enterprise architecture.</p><h3>The Architecture I Worked With</h3><p>In my implementation, n8n was deployed using <strong>Docker</strong> and integrated with an existing backend ecosystem consisting of <strong>Java Spring Boot services, MySQL databases, and external SMS APIs</strong>.</p><p>The workflow was designed to automate customer SMS notifications based on business conditions stored in the database.</p><p>A simplified architecture looked like this:</p><p>Schedule Trigger -&gt; MySQL Query -&gt; Business Condition Evaluation -&gt; HTTP Request (SMS API) -&gt; Database Update -&gt; Success / Failure Logging</p><p>The objective was not simply to send SMS messages. The workflow needed to ensure that every attempt was traceable, every failure was recorded, and downstream systems remained synchronized.</p><h3>Implementing the Workflow</h3><p>The workflow begins with a <strong>scheduled trigger</strong>, executing at predefined intervals.</p><p>The first step retrieves eligible records from the database using a MySQL query. These records are then evaluated using conditional logic to determine whether an SMS notification should be sent.</p><p>For records that satisfy the business criteria, n8n invokes an external SMS service through an HTTP request. Based on the API response, the workflow updates the corresponding database records and inserts audit logs indicating success or failure.</p><p>This approach allowed the entire orchestration layer to be managed visually while keeping the core business logic within existing backend services.</p><h3>Engineering Challenges Encountered</h3><p>Although n8n provides a visual development environment, building production-ready workflows required the same engineering discipline expected in any enterprise application.</p><h3>Data Integrity and Undefined Values</h3><p>One of the first issues encountered was the propagation of missing values through workflow nodes. Certain database insert operations were receiving undefined values, resulting in SQL errors.</p><p>The root cause was not the database itself, but the structure of data flowing between nodes. This reinforced the importance of validating payloads and understanding how workflow outputs are consumed by downstream components.</p><h3>Docker Networking</h3><p>Since n8n was deployed inside Docker while backend services were running separately, network communication required proper container-aware configuration.</p><p>Using localhost inside a container does not reference the host machine; it references the container itself. Resolving this required configuring the correct host networking strategy and endpoint addressing.</p><p>This was a reminder that workflow automation platforms still operate within the same infrastructure constraints as traditional backend applications.</p><h3>Scheduled Execution vs Manual Execution</h3><p>Another important distinction was the behavior of <strong>scheduled workflows</strong>.</p><p>A workflow that executes successfully when triggered manually may behave differently when executed by a scheduler due to differences in execution context, environment configuration, credentials, or data availability.</p><p>Monitoring execution history and validating scheduled runs became an essential part of the deployment process.</p><h3>The Most Important Feature</h3><p>In an enterprise insurance environment, automation cannot be treated as a black box. Every automated action must be auditable.</p><p>The workflow was therefore designed with explicit logging for both successful and failed operations. Failure logs included sufficient metadata to support troubleshooting, operational reporting, and controlled retry mechanisms.</p><p>This proved to be one of the most valuable aspects of the implementation.</p><p>Automation is only useful when organizations can trust it, monitor it, and recover from failures effectively.</p><h3>What n8n Added to My Engineering Perspective</h3><p>Working with n8n did not replace backend development; it expanded it.</p><p>The platform reinforced several engineering principles that are equally relevant in traditional software development:</p><ul><li>Workflow orchestration</li><li>API integration</li><li>Data validation</li><li>Error handling</li><li>Idempotent operations</li><li>Scheduling</li><li>Audit logging</li><li>Operational monitoring</li></ul><p>The visual interface accelerates workflow development, but the underlying challenges remain fundamentally software engineering problems.</p><h3>Where n8n Fits in an Enterprise Architecture</h3><p>Based on my experience, n8n is particularly effective for:</p><ul><li>Process automation</li><li>System-to-system integration</li><li>Notification workflows</li><li>Scheduled operational tasks</li><li>Data synchronization</li><li>Approval and business process orchestration</li></ul><p>For complex domain logic, high-performance transactional processing, or core business services, traditional application development remains essential.</p><p>The strongest approach is not choosing between code and low-code, it is <strong>using workflow orchestration to complement existing enterprise systems</strong>.</p><h3>Conclusion</h3><p>Implementing n8n within an insurance domain environment demonstrated that modern workflow automation platforms can provide significant operational value when integrated with established backend technologies.</p><p>By combining <strong>Java Spring Boot, MySQL, Docker, and n8n</strong>, it was possible to build an automation layer that was maintainable, observable, and aligned with enterprise reliability requirements.</p><p>In my next article, I will explore another orchestration platform that significantly influenced my understanding of backend automation and data engineering: <strong>Apache Airflow</strong>, and how it differs from n8n when building ETL pipelines and large scale data workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed8d340c958f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Power of Planning: How Small Decisions Shape Your Future ?]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/the-power-of-planning-how-small-decisions-shape-your-future-04204ed8a10d?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/04204ed8a10d</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[career-growth]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 04:23:44 GMT</pubDate>
            <atom:updated>2026-06-18T04:23:44.396Z</atom:updated>
            <content:encoded><![CDATA[<p>Most people think planning is something we do for major life events, a career change, buying a house, or starting a business.</p><p>I used to think the same way.</p><p>Over time, however, I realized that the biggest impact on our future often comes from the smallest decisions we make every day. The way we manage our time, prepare for opportunities, handle risks, and make choices when things don’t go according to plan can shape our lives more than any single big decision.</p><p>Planning has become one of the most valuable habits in my life.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVgiSz5y3LJ_vPE7zXDkdA.png" /></figure><h3>😉 Planning Is More Than Creating a To-Do List</h3><p>When people hear the word “planning,” they often imagine schedules, calendars, and checklists.</p><p>While those tools are useful, planning is really about creating clarity.</p><p>Before I start something important, I usually write it down. It doesn’t matter whether it’s a professional goal, a financial decision, a learning objective, or a personal project. Writing things down helps me organize my thoughts and see the bigger picture.</p><p>A plan turns an idea into something tangible.</p><p>Instead of saying, “I want to achieve this someday,” you begin asking, “What is my first step?”</p><h3>😎 Small Decisions Create Big Outcomes</h3><p>Many of the opportunities we experience are influenced by decisions that seem insignificant at the time.</p><p><em>Choosing to learn a new skill.<br>Saving a little money each month.<br>Applying for an opportunity even when you feel uncertain.<br>Spending an extra hour preparing instead of relying on luck.</em></p><p>These decisions rarely produce immediate results.</p><p>However, months or years later, they often become the reason we are able to move forward when new opportunities appear.</p><p>Success is rarely built overnight. More often, it is built through small actions repeated consistently over time.</p><h3>📍 The Importance of Thinking About Risk</h3><p>One lesson I have learned is that every decision carries some level of risk.</p><p>Ignoring risk does not make it disappear.</p><p>Instead of asking, “What if this goes wrong?” and becoming afraid, I prefer asking:</p><p>“If this goes wrong, what will I do next?”</p><p>That simple shift in mindset changes everything.</p><p>When we think about possible challenges beforehand, we become less dependent on perfect circumstances.</p><p>Preparation creates confidence.</p><h3>🤔 Why I Always Have a Plan B ?</h3><p>Life rarely follows our original plan.</p><p><em>Projects change.<br>Opportunities disappear.<br>Unexpected situations arise.</em></p><p>Because of this, I have developed a habit of always having an alternative option.</p><p>Having a Plan B is not a sign of pessimism.</p><p>It is a sign of readiness.</p><p>Knowing there is another path available makes it easier to make decisions and take calculated risks. It allows us to move forward without being paralyzed by uncertainty.</p><p>Sometimes the first plan works.</p><p>Sometimes the second plan leads to an even better outcome.</p><h3>🤓 Planning Creates Confidence</h3><p>One of the greatest benefits of planning is confidence.</p><p>Confidence is often misunderstood as believing everything will work perfectly.</p><p>In reality, confidence comes from knowing that even if things do not go as expected, you are prepared to adapt.</p><p>When you have thought through your options, considered potential risks, and created alternatives, uncertainty becomes easier to manage.</p><p>You stop fearing change and start preparing for it.</p><h3>Final Thoughts</h3><p>The future is not shaped only by major milestones.</p><p>It is shaped by the small decisions we make every day.</p><p>Planning will not eliminate every challenge, and no plan is ever perfect. However, planning gives us direction, reduces unnecessary risk, and helps us make better decisions when opportunities appear.</p><p>The habit of writing things down, thinking ahead, and preparing alternatives has helped me approach life with greater clarity and confidence.</p><p><strong><em>Sometimes the most powerful thing you can do is not to predict the future, but to prepare yourself for whatever future arrives.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04204ed8a10d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Used AI Every Day for 90 Days as a Software Engineer. Here’s What Actually Changed]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/i-used-ai-every-day-for-90-days-as-a-software-engineer-heres-what-actually-changed-199f77b8622c?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/199f77b8622c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[career-development]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 06:38:47 GMT</pubDate>
            <atom:updated>2026-06-02T06:38:47.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RwBDSp7CSO2LBPfKGnS6Ew.png" /></figure><p>Most discussions about AI fall into one of two categories: Either AI is going to replace software engineers, or AI is just another tool that developers are over hyping.</p><p>After using AI every single day for the past 90 days, I believe the truth lies somewhere in the middle.</p><p>As a software engineer, I decided to intentionally integrate AI into my daily workflow. Not occasionally. Not when I got stuck.</p><p>Every day.</p><p>I used AI for coding, debugging, documentation, architecture discussions, SQL optimization, API development, requirement analysis, and even technical training preparation.</p><p>Three months later, I noticed something interesting. The biggest change wasn’t my coding speed. It was the way I think about solving problems.</p><h3>🧐 Why I started this experiment ?</h3><p>Like many developers, I was suspicious at first.</p><p>I had already seen AI generate impressive code snippets. But I had also seen it confidently produce completely incorrect solutions. So instead of debating whether AI was useful, I decided to test it in real-world development work.</p><p>For 90 days, AI became part of my daily workflow.</p><p>Whenever I faced a problem, I asked myself:</p><p>“Can AI help me solve this faster, better, or differently?”</p><h3>🤷‍♀️ What AI was surprisingly good at ?</h3><h3>1. Explaining Unfamiliar Technologies</h3><p>One of AI’s strongest abilities is reducing the learning curve.</p><p>Whenever I encountered unfamiliar frameworks, libraries, or concepts, AI helped me understand:</p><ul><li>Architecture patterns</li><li>Technology comparisons</li><li>Configuration options</li><li>Best practices</li><li>Common mistakes</li></ul><p>Instead of spending hours jumping between documentation pages, I could get a structured explanation in seconds.</p><p>Documentation is still essential. But AI often acted as a translator between complex documentation and practical understanding.</p><h3>2. Debugging</h3><p>This was the biggest surprise. Not because AI always found the answer. But because it helped me think through problems faster.</p><p>When facing:</p><ul><li>API failures</li><li>SQL query issues</li><li>Docker problems</li><li>ETL pipeline errors</li><li>Backend integration bugs</li></ul><p>AI often suggested troubleshooting paths I hadn’t considered.</p><p>Even when the solution was wrong, the questions it raised helped me narrow down the actual problem.</p><p>Debugging became less about searching for answers and more about accelerating investigation.</p><h3>3. Documentation</h3><p>Most developers enjoy building. Very few enjoy writing documentation.</p><p>AI dramatically reduced the time needed for:</p><ul><li>API documentation</li><li>Technical specifications</li><li>Release notes</li><li>User guides</li><li>Project summaries</li></ul><p>Instead of starting from a blank page, I could start with a draft and improve it. The quality improved because I spent more time reviewing and refining rather than writing everything from scratch.</p><h3>🤔 Where AI failed ?</h3><p>This part is important.</p><p>AI is useful. But it is not magic.</p><h3>1. Understanding business context</h3><p>AI can understand code. It struggles with business reality.</p><p>Many software decisions depend on:</p><ul><li>Company processes</li><li>Customer requirements</li><li>Industry regulations</li><li>Organizational constraints</li></ul><p>These factors rarely exist in the training data.</p><p>The best solution technically is not always the best solution for the business. That judgment still belongs to humans.</p><h3>2. Complex Production Issues</h3><p>AI performs well when information is available. It performs poorly when information is missing.</p><p>Real production incidents often involve:</p><ul><li>Incomplete logs</li><li>Unexpected behaviour</li><li>Multiple interconnected systems</li><li>Hidden dependencies</li></ul><p>In these situations, engineering experience matters far more than AI-generated suggestions.</p><h3>3. Trust</h3><p>One lesson became clear very quickly:</p><p>Never assume AI is correct. Some responses were brilliant. Others were confidently incorrect.</p><p>The engineers who benefit most from AI are not those who trust it blindly. They are those who verify everything.</p><h3>The biggest change wasn’t productivity</h3><p>Everyone talks about productivity. Yes, I became faster.</p><p>But that’s not the biggest transformation. The biggest change was cognitive. AI reduced the time spent on repetitive thinking.</p><p>Instead of spending an hour figuring out how to start a task, I could spend that hour evaluating solutions.</p><p>The role shifted from: “How do I build this?” to “Which approach should I choose?”</p><p>That subtle difference changes everything.</p><h3>What this means for Software Engineers ?</h3><p>I don’t believe AI will replace software engineers. I do believe it will replace certain tasks performed by software engineers.</p><p>The value of developers is moving away from writing every line of code manually.</p><p>The value is moving toward:</p><ul><li>Problem solving</li><li>System design</li><li>Critical thinking</li><li>Validation</li><li>Business understanding</li><li>Decision making</li></ul><p>AI can generate code.</p><p>It cannot fully understand organizational context, stakeholder priorities, or long-term technical trade-offs.</p><p>At least not today.</p><h3>💡 My final take after 90 days</h3><p>Before this experiment, I viewed AI as a coding assistant. After 90 days, I view it as a thinking assistant. It helps me learn faster. It helps me explore alternatives faster. It helps me communicate ideas faster. But it does not replace engineering judgement.</p><p>The most successful developers in the coming years won’t be the ones who avoid AI. And they won’t be the ones who depend on it completely.</p><p>They’ll be the ones who learn how to work alongside it effectively.</p><p>The future isn’t AI versus software engineers.</p><p>It’s software engineers who know how to leverage AI versus those who don’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199f77b8622c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How AI is Changing the Role of Software Engineers in 2026 ?]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/how-ai-is-changing-the-role-of-software-engineers-in-2026-599042944b57?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/599042944b57</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[career-development]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 04:47:08 GMT</pubDate>
            <atom:updated>2026-04-22T04:53:05.129Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence is no longer a future concept. It is already transforming the way software is built, tested, deployed, and maintained.</p><p>From startups to enterprise companies, AI tools are becoming part of daily engineering workflows. Code generation, debugging assistance, test automation, documentation creation, and system monitoring are now faster than ever.</p><p>This raises one important question: <strong>What does this mean for software engineers in 2026?</strong></p><p>The answer is clear: AI is not replacing software engineers. It is redefining the role.</p><h4>From Coding to Problem Solving</h4><p>For many years, software engineering focused heavily on writing code manually.</p><p>Today, AI can generate functions, create APIs, suggest fixes, and even optimize logic. Because of this, the value of an engineer is shifting from simply writing code to solving real business problems.</p><p>Modern engineers are expected to:</p><ul><li>Understand user needs</li><li>Design scalable solutions</li><li>Review AI-generated code</li><li>Improve system performance</li><li>Communicate with teams clearly</li><li>Deliver business value quickly</li></ul><p>Coding still matters, but thinking matters more.</p><h4>AI as a daily engineering partner</h4><p>The best engineers are not competing with AI. They are learning how to work with it.</p><p>AI can help engineers by:</p><ul><li>Generating boilerplate code</li><li>Explaining unfamiliar codebases</li><li>Writing unit tests</li><li>Refactoring legacy systems</li><li>Detecting bugs early</li><li>Creating technical documentation</li></ul><p>Used correctly, AI increases productivity and allows engineers to focus on higher-value work.</p><h4>Skills that matter more than ever</h4><p>As automation grows, certain skills become even more valuable.</p><h4>Technical Skills</h4><ul><li>System design</li><li>Cloud platforms</li><li>APIs and integrations</li><li>Databases</li><li>Security practices</li><li>Performance optimization</li></ul><h4>Human Skills</h4><ul><li>Communication</li><li>Critical thinking</li><li>Leadership</li><li>Requirement analysis</li><li>Team collaboration</li><li>Decision making</li></ul><h4>AI Skills</h4><ul><li>Prompt engineering</li><li>Validating AI outputs</li><li>Workflow automation</li><li>AI-assisted development practices</li></ul><p>The strongest engineers in 2026 combine all three areas.</p><h4>What AI still cannot replace</h4><p>Despite rapid progress, AI still struggles with many real-world challenges.</p><p>It cannot fully replace:</p><ul><li>Ownership and accountability</li><li>Product judgment</li><li>Handling ambiguity</li><li>Stakeholder communication</li><li>Team leadership</li><li>Business context understanding</li><li>Creative trade-off decisions</li></ul><p>These remain human strengths.</p><h4>The new definition of a great engineer</h4><p>In the past, success was often measured by:</p><ul><li>Lines of code written</li><li>Speed of development</li><li>Number of tasks completed</li></ul><p>Now success is measured by:</p><ul><li>Problems solved</li><li>Customer impact</li><li>Reliability delivered</li><li>Systems improved</li><li>Time saved</li><li>Revenue supported</li></ul><p>That is a major shift.</p><h4>💡 Final Thoughts</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98tsUeQB5E-zgHwsT_cgWg.png" /></figure><p>AI is not ending software engineering. It is removing repetitive work and raising the standard of what engineers can achieve.</p><p>The engineers who adapt, learn continuously, and use AI wisely will grow faster than ever before.</p><p><em>The future belongs to engineers who combine technical skill with smart thinking.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=599042944b57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 AI Tools Every Software Engineer Should Use in 2026]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/7-ai-tools-every-software-engineer-should-use-in-2026-0ddd481a3aa8?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ddd481a3aa8</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[github-copilot]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 03:41:53 GMT</pubDate>
            <atom:updated>2026-04-17T03:41:53.244Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>Software engineering is changing faster than ever.</p><p>In 2026, AI is no longer a “nice-to-have” tool. It has become a serious productivity advantage. Developers who know how to use AI effectively can code faster, debug smarter, write better documentation, and focus more on solving real problems.</p><p>The best engineers won’t be replaced by AI. They’ll be <strong>amplified by AI</strong>.</p><p>In this article, I’ll share <strong>7 AI tools every software engineer should know in 2026</strong> and how they can be used in real workflows.</p><h4>1. OpenAI ChatGPT</h4><p>Still one of the most versatile tools for engineers.</p><h4>Best uses:</h4><ul><li>Debugging errors</li><li>Explaining legacy code</li><li>Writing SQL queries</li><li>API design suggestions</li><li>Refactoring messy code</li><li>Writing technical docs</li></ul><h4>Real example:</h4><p>Instead of spending 40 minutes debugging a regex issue, explain the problem clearly and get multiple solution approaches instantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0dVblFv14b-aSzoK9cM2Q.jpeg" /></figure><h4>2. GitHub GitHub Copilot</h4><p>Excellent for coding inside your IDE.</p><h4>Best uses:</h4><ul><li>Auto-completing functions</li><li>Writing repetitive boilerplate</li><li>Unit tests generation</li><li>Suggesting implementations</li><li>Speeding up CRUD work</li></ul><h4>Why it matters:</h4><p>Great for reducing repetitive coding fatigue.</p><h4>3. Google Gemini</h4><p>Strong for ecosystem integration and research tasks.</p><h4>Best uses:</h4><ul><li>Comparing technical options</li><li>Summarizing documentation</li><li>Brainstorming architecture ideas</li><li>Productivity workflows</li></ul><h4>4. Anthropic Claude</h4><p>Very strong when working with long technical documents.</p><h4>Best uses:</h4><ul><li>Reviewing large codebases</li><li>Summarizing long specs</li><li>PRD analysis</li><li>Technical writing</li></ul><h4>5. Notion Notion AI</h4><p>Useful for engineers who manage both coding and planning.</p><h4>Best uses:</h4><ul><li>Sprint notes</li><li>Documentation</li><li>Meeting summaries</li><li>Product thinking</li><li>Personal knowledge base</li></ul><h4>6. JetBrains AI Features</h4><p>Many modern IDEs now include AI assistance.</p><h4>Best uses:</h4><ul><li>Smart navigation</li><li>Code explanations</li><li>Refactoring help</li><li>Context-aware suggestions</li></ul><p>If you use IntelliJ or WebStorm, these tools save serious time.</p><h4>7. Amazon Amazon CodeWhisperer</h4><p>Strong for cloud-focused developers.</p><h4>Best uses:</h4><ul><li>AWS development</li><li>Security suggestions</li><li>Infrastructure scripting</li><li>Code recommendations</li></ul><h4>How Smart Engineers Use AI (The Right Way)</h4><p>AI should not replace thinking.</p><p>Use it for:</p><p>✅ Repetitive work<br> ✅ First drafts<br> ✅ Learning unfamiliar concepts<br> ✅ Debugging ideas<br> ✅ Documentation<br> ✅ Code review assistance</p><p>Do <strong>not</strong> blindly copy outputs into production. Always validate.</p><h4>My Personal Rule</h4><p>Use AI to save time on tasks that don’t deserve your best mental energy.</p><p>Use your brain for:</p><ul><li>Architecture decisions</li><li>Tradeoffs</li><li>Security thinking</li><li>Business logic</li><li>User experience</li></ul><p>That’s where engineers create real value.</p><h4>What will matter most in 2026?</h4><p>The best software engineers won’t be those who ignore AI.</p><p>They’ll be the ones who know:</p><ul><li>Which tool to use</li><li>When to use it</li><li>How to verify results</li><li>How to combine AI with real engineering judgment</li></ul><h4>💡 Final Thoughts</h4><p>AI tools are now part of the modern developer toolkit. Learning to use them wisely can multiply your output, improve learning speed, and free time for deeper work.</p><p>The future belongs to engineers who combine:</p><p><strong>Technical skill + Critical thinking + AI leverage</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ddd481a3aa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Made Simple: From Zero to Containerizing Your Angular Application]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/docker-made-simple-from-zero-to-containerizing-your-angular-application-a67f61c8417c?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/a67f61c8417c</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 04:05:15 GMT</pubDate>
            <atom:updated>2026-03-31T04:05:15.165Z</atom:updated>
            <content:encoded><![CDATA[<h4>Introduction</h4><p>If you’ve ever run into the frustrating issue: <em>“It works on my machine, but not in production…”</em></p><p>Then Docker is exactly what you need.</p><p>Docker helps developers package applications along with all their dependencies into a standardized unit called a <strong>container</strong>. This ensures your application runs consistently across development, testing, and production environments.</p><p>In this article, you’ll learn:</p><ul><li>What Docker is ? (in simple terms)</li><li>Key concepts: Images and Containers</li><li>How to dockerize an application</li><li>A real-world example using Angular</li></ul><h4>What is Docker ?</h4><p>Docker is a platform that allows you to build, ship, and run applications inside <strong>containers</strong>.</p><p>Think of containers as:</p><p><em>Lightweight, fast, and portable environments that include everything your application needs to run.</em></p><p>Unlike virtual machines, containers share the host OS, making them much more efficient.</p><h4>Core concepts you must understand</h4><h4>Docker Image</h4><p>A <strong>Docker Image</strong> is a blueprint of your application.</p><p>It includes:</p><ul><li>Application code</li><li>Runtime (Node.js, Java, etc.)</li><li>Libraries and dependencies</li></ul><h4>Docker Container</h4><p>A <strong>container</strong> is a running instance of a Docker image.</p><p>👉 Image = Blueprint<br>👉 Container = Running application</p><h4>Dockerfile</h4><p>A <strong>Dockerfile</strong> is a script that contains step-by-step instructions to build a Docker image.</p><h4>How Docker Works (Quick Overview)</h4><ol><li>You write a <strong>Dockerfile</strong></li><li>Docker builds an <strong>image</strong></li><li>The image runs as a <strong>container</strong></li></ol><p>This process ensures consistency across all environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*BX2HTfhbvsgfF6mFJyvmtg.jpeg" /></figure><h4>Dockerizing an angular application (Step-by-Step)</h4><p>Let’s walk through a real-world example using Angular.</p><h4>Step 1: Create an Angular Application</h4><p>If you don’t already have one:</p><pre>ng new my-angular-app<br>cd my-angular-app<br>ng serve</pre><p>Open your browser:<br> 👉 <a href="http://localhost:4200/">http://localhost:4200</a></p><h4>Step 2: Create a Dockerfile</h4><p>For Angular applications, we use a <strong>multi-stage build</strong>:</p><ul><li>Stage 1 → Build the Angular app</li><li>Stage 2 → Serve it using Nginx</li></ul><pre># Stage 1: Build Angular app<br>FROM node:18 AS build</pre><pre>WORKDIR /app<br>COPY package*.json ./<br>RUN npm install</pre><pre>COPY . .<br>RUN npm run build --prod</pre><pre># Stage 2: Serve using Nginx<br>FROM nginx:alpine</pre><pre>COPY --from=build /app/dist/my-angular-app /usr/share/nginx/html</pre><pre>EXPOSE 80</pre><pre>CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]</pre><h4>Step 3: Build the Docker Image</h4><pre>docker build -t angular-app .</pre><h4>Step 4: Run the Container</h4><pre>docker run -p 4200:80 angular-app</pre><p>Now open:<br> 👉 <a href="http://localhost:4200/">http://localhost:4200</a></p><h4>What happens behind the scenes ?</h4><ul><li>Angular app is built using Node.js</li><li>Production files are generated inside /dist</li><li>Nginx serves the static files</li><li>Docker maps container port 80 → local port 4200</li></ul><h4>Why Multi-Stage Builds Matter ?</h4><p>Without multi-stage builds:</p><ul><li>Your Docker image becomes large</li><li>Includes unnecessary build dependencies</li></ul><p>With multi-stage builds:</p><ul><li>Smaller, optimized images</li><li>Better performance and security</li></ul><h4>Use a .dockerignore File (Important)</h4><pre>node_modules<br>dist<br>.git<br>.gitignore<br>README.md</pre><p>This prevents unnecessary files from being copied into the image.</p><h4>Best Practices for Docker + Angular</h4><ul><li>Always build with production configuration</li><li>Use Nginx instead of ng serve in production</li><li>Keep images small by using lightweight base images</li><li>Avoid running containers as root</li><li>Use environment-specific configurations when needed</li></ul><h4>Optional: Fix Angular Routing with Nginx</h4><p>If your app uses Angular routing, add this config:</p><pre>server {<br>  listen 80;</pre><pre>  location / {<br>    root /usr/share/nginx/html;<br>    index index.html;<br>    try_files $uri $uri/ /index.html;<br>  }<br>}</pre><h4>Why Docker Matters in Modern Development ?</h4><p>Docker is not just a tool, it’s a <strong>fundamental skill</strong>.</p><p>It helps you:</p><ul><li>Eliminate environment issues</li><li>Simplify deployments</li><li>Build scalable applications</li><li>Integrate easily with CI/CD pipelines</li><li>Prepare for tools like Kubernetes</li></ul><h4>Final Thoughts</h4><p>Learning Docker opens the door to modern software development practices.</p><p>By combining tools like Angular with Docker, you can:</p><ul><li>Build once, run anywhere</li><li>Deliver consistent user experiences</li><li>Deploy faster and more reliably</li></ul><p>If you’re serious about becoming a better developer, Docker is a must-have in your toolkit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a67f61c8417c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Idempotency is the Secret to Reliable APIs ?]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/why-idempotency-is-the-secret-to-reliable-apis-9fcfca39d356?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fcfca39d356</guid>
            <category><![CDATA[api-design]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Fri, 20 Mar 2026 04:41:48 GMT</pubDate>
            <atom:updated>2026-03-20T04:41:48.078Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Hidden Problem Behind “Retry”</h4><p>In modern applications, failures are not rare, they are <strong>expected</strong>.</p><p>A mobile user taps “Pay Now.”<br>The request goes through… but the response doesn’t arrive due to a network glitch.</p><p>What does the client do?</p><p>👉 It retries.</p><p>Now your system receives the <strong>same request twice</strong>.</p><p>If your API is not designed carefully, this simple retry can lead to:</p><ul><li>Duplicate payments</li><li>Multiple orders</li><li>Inconsistent system state</li></ul><p>This is not a rare edge case, this is <strong>real-world behavior</strong> in distributed systems and this is exactly why <strong>idempotency</strong> is critical.</p><h4>🔍 What is Idempotency?</h4><p>Idempotency is a concept from mathematics and computer science, but in APIs it has a very practical meaning:</p><blockquote><strong><em>An operation is idempotent if performing it multiple times produces the same result as performing it once.</em></strong></blockquote><p>In other words:</p><ul><li>One request → effect happens once</li><li>Same request repeated → no additional side effects</li></ul><p>This ensures your system behaves <strong>predictably</strong>, even under retries.</p><h4>💡 Why Idempotency is Non-Negotiable in Modern Systems ?</h4><p>Let’s break down why this matters so much today.</p><h4>1. Retries Are Everywhere</h4><p>Retries happen automatically due to:</p><ul><li>API gateways</li><li>Load balancers</li><li>Mobile apps</li><li>SDKs</li><li>Microservices communication</li></ul><p>Even if you didn’t design retries, <strong>something in your system will retry</strong>.</p><h4>2. Networks are Unreliable</h4><p>Distributed systems operate over networks that can:</p><ul><li>Drop packets</li><li>Timeout</li><li>Duplicate requests</li></ul><p>So your system must assume:</p><blockquote><em>“This request might arrive more than once.”</em></blockquote><h4>3. Financial and Critical Operations Demand Accuracy</h4><p>In domains like:</p><ul><li>Payments</li><li>Banking</li><li>Order management</li></ul><p>Even a single duplicate action can cause:</p><ul><li>Financial loss</li><li>Customer dissatisfaction</li><li>Legal issues</li></ul><h4>⚙️ Real-World Scenario: Payment API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dA_hOpvLQSoO1cIGMqYd9g.jpeg" /></figure><h4>❌ Without Idempotency</h4><pre>POST /payments<br>{<br>  &quot;amount&quot;: 5000,<br>  &quot;currency&quot;: &quot;LKR&quot;<br>}</pre><p>If the request is retried:</p><ul><li>Payment is processed multiple times</li><li>User gets charged multiple times</li></ul><h4>✅ With Idempotency</h4><pre>POST /payments<br>Idempotency-Key: 7f3a9c21-8b2e-4d1c<br>{<br>  &quot;amount&quot;: 5000,<br>  &quot;currency&quot;: &quot;LKR&quot;<br>}</pre><p>Now:</p><ul><li>First request → payment processed</li><li>Retry → same response returned</li></ul><p>No duplicate charges.</p><h4>🧠 How Idempotency Works Internally ?</h4><p>At a high level, idempotency relies on <strong>tracking requests</strong>.</p><h4>Step-by-Step Flow</h4><ol><li><strong>Client generates a unique Idempotency Key</strong></li></ol><ul><li>Usually a UUID</li><li>One key per logical operation</li></ul><p><strong>2. Server receives the request</strong></p><ul><li>Checks if the key already exists</li></ul><p><strong>3. If key does NOT exist</strong></p><ul><li>Process the request</li><li>Store: Key, Request payload, Response</li></ul><p><strong>4. If key EXISTS</strong></p><ul><li>Validate request payload (important!)</li><li>Return stored response</li></ul><h4>🗄️ What Do You Store?</h4><p>A typical idempotency record includes:</p><ul><li>idempotency_key</li><li>request_hash (to ensure same request)</li><li>response_body</li><li>status_code</li><li>created_at</li></ul><h4>🏗️ Implementation Strategies</h4><p>There’s no single way to implement idempotency, here are the most common approaches.</p><h4>1. Idempotency Key Store (Recommended)</h4><p>Store keys in:</p><ul><li>Redis (fast, temporary)</li><li>Database (persistent)</li></ul><p><strong>Pros:</strong></p><ul><li>Flexible</li><li>Works with POST requests</li><li>Easy to implement</li></ul><p><strong>Cons:</strong></p><ul><li>Requires storage management</li><li>Needs cleanup (TTL)</li></ul><h4>2. Database Constraints</h4><p>Use:</p><ul><li>Unique indexes (e.g., transaction_id)</li></ul><p><strong>Example:</strong></p><pre>UNIQUE(transaction_id)</pre><p><strong>Pros:</strong></p><ul><li>Simple</li><li>Strong consistency</li></ul><p><strong>Cons:</strong></p><ul><li>Limited flexibility</li><li>Harder to return same response</li></ul><h4>3. Stateless Idempotency</h4><p>Design APIs so operations are naturally idempotent.</p><p>Example:</p><pre>PUT /users/123</pre><ul><li>Replacing the same resource → same result</li></ul><p><strong>Pros:</strong></p><ul><li>No extra storage</li><li>Clean design</li></ul><p><strong>Cons:</strong></p><ul><li>Not suitable for all operations (e.g., payments)</li></ul><h4>⚠️ Common Mistakes that Break Idempotency</h4><h4>1. Not Validating Request Payload</h4><p>Same key + different payload = <strong>serious bug</strong></p><p>👉 Always compare request hash</p><h4>2. Not Storing Response</h4><p>If you only store the key:</p><ul><li>You can’t return the original response</li></ul><h4>3. Short Expiry (TTL)</h4><p>If keys expire too soon:</p><ul><li>Retries may create duplicates again</li></ul><h4>4. Ignoring Concurrency</h4><p>Two identical requests arriving simultaneously can:</p><ul><li>Both pass the “not exists” check</li></ul><p>👉 Solution:</p><ul><li>Use locking (DB/Redis)</li><li>Atomic operations</li></ul><h4>🔐 Handling Concurrency</h4><p>In high-throughput systems:</p><p>Problem: Two requests with same key arrive at the same time.</p><p>Without protection:</p><ul><li>Both get processed → duplicate action</li></ul><p>Solutions:</p><ul><li>Database transactions with unique constraints</li><li>Redis SETNX (set if not exists)</li><li>Distributed locks</li></ul><h4>When Should You Use Idempotency?</h4><p>Use idempotency when:</p><ul><li>Operations must not be duplicated</li></ul><h4>Critical Use Cases:</h4><ul><li>💳 Payments</li><li>📦 Order creation</li><li>✈️ Ticket booking</li><li>🧾 Invoice generation</li><li>🔁 Retry-heavy systems</li></ul><h4>🏛️ Idempotency in Microservices Architecture</h4><p>In microservices:</p><ul><li>One request can trigger multiple services</li><li>Failures can happen at any step</li></ul><p>Without idempotency:</p><ul><li>Partial failures → inconsistent data</li></ul><p>With idempotency:</p><ul><li>Safe retries across services</li><li>Easier recovery from failures</li></ul><h4>📌 Best Practices</h4><ul><li>Always use UUID for idempotency keys</li><li>Store both request and response</li><li>Validate payload consistency</li><li>Use proper TTL (based on business need)</li><li>Handle concurrency explicitly</li><li>Log idempotency behavior for debugging</li></ul><h4>Final Thoughts</h4><p>Idempotency is not just a “nice-to-have” feature, it is a <strong>core reliability mechanism</strong>.</p><p>In a world of:</p><ul><li>Distributed systems</li><li>Unreliable networks</li><li>Automatic retries</li></ul><p>You cannot avoid duplicate requests. But you <em>can</em> control their impact.</p><blockquote><strong><em>Idempotency transforms retries from a risk into a guarantee.</em></strong></blockquote><p><em>“In distributed systems, failure is inevitable.<br> Idempotency ensures those failures don’t become disasters.”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fcfca39d356" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Circuit Breaker Pattern in Microservices: Protecting Systems from Cascading Failures]]></title>
            <link>https://medium.com/@kaveeshasanduni200066/circuit-breaker-pattern-in-microservices-protecting-systems-from-cascading-failures-7f887c8601a2?source=rss-d4b1406bac60------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f887c8601a2</guid>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Kaveesha Sanduni Kodikara]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 06:31:54 GMT</pubDate>
            <atom:updated>2026-03-10T06:31:54.782Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern applications rarely exist as a single system.</p><p>Instead, they are composed of multiple services communicating with each other APIs, databases, message queues, and external systems. While this architecture brings flexibility and scalability, it also introduces a major risk, <strong>cascading failures</strong>.</p><p>A single failing service can quickly impact many others, eventually affecting the entire system. This is where the <strong>Circuit Breaker Pattern</strong> becomes essential.</p><h4>What is a Cascading Failure?</h4><p>A cascading failure occurs when one failing component causes other components to fail as well.</p><p>Consider a simple example:</p><p>Service A → calls → Service B → calls → Database</p><p>If the database becomes slow or unavailable:</p><p>• Service B starts timing out<br>• Service A continues sending requests<br>• Threads become blocked<br>• Resource usage increases<br>• Eventually, multiple services slow down or crash</p><p>The problem spreads across the system.</p><p>This is exactly what the <strong>Circuit Breaker Pattern</strong> is designed to prevent.</p><h4>What is the Circuit Breaker Pattern?</h4><p>The Circuit Breaker Pattern acts like an electrical circuit breaker.</p><p>In electrical systems, a circuit breaker stops the flow of electricity when something goes wrong to prevent damage. Similarly, in software systems, a circuit breaker <strong>stops requests to a failing service</strong> before the failure spreads.</p><p>Instead of continuously retrying a failing operation, the system temporarily blocks requests and allows the failing service time to recover.</p><h4>The Three States of a Circuit Breaker</h4><p>A circuit breaker typically operates in three states.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPfd-ZC6Dw4jVI0rQkjvrw.png" /></figure><h4>1. Closed State</h4><p>This is the normal operating state. Requests flow normally between services. The circuit breaker monitors failures and response times.</p><h4>2. Open State</h4><p>If failures exceed a defined threshold, the circuit breaker <strong>opens</strong>.</p><p>When the circuit is open, Requests are immediately rejected or redirected to fallback logic. This prevents further load on the failing service.</p><h4>3. Half-Open State</h4><p>After a cooldown period, the circuit breaker allows <strong>a limited number of requests</strong> to pass through. If these requests succeed, the circuit closes again. If they fail, the circuit returns to the open state.</p><h4>Real-World Example</h4><p>Imagine an e-commerce platform.</p><p>Order Service → calls → Payment Service.</p><p>If the Payment Service becomes unavailable:</p><p>Without a circuit breaker:</p><p>• Order Service continues sending requests<br>• Requests timeout<br>• Threads become blocked<br>• The system becomes slow for all users</p><p>With a circuit breaker:</p><p>• Requests to the payment service are temporarily stopped<br>• Users receive a graceful fallback message<br>• The payment service gets time to recover</p><p>The rest of the system stays healthy.</p><h4>Benefits of the Circuit Breaker Pattern</h4><p>Implementing a circuit breaker provides several advantages.</p><p><strong>Prevents cascading failures</strong><br>Failures remain isolated instead of spreading across services.</p><p><strong>Improves system resilience</strong><br>Services can recover without being overwhelmed by retries.</p><p><strong>Protects system resources</strong><br>Threads and connections are not wasted waiting for failing services.</p><p><strong>Enables graceful fallbacks</strong><br>Users receive controlled responses instead of system crashes.</p><h4>Common Tools that Implement Circuit Breakers</h4><p>Many frameworks already support this pattern.</p><p>Popular examples include:</p><p>• <strong>Resilience4j</strong><br>• <strong>Hystrix (legacy but influential)</strong><br>• <strong>Spring Cloud Circuit Breaker</strong><br>• <strong>Istio service mesh policies</strong></p><p>These tools help configure thresholds, fallback behavior, and monitoring.</p><h4>Best Practices for Using Circuit Breakers</h4><p>To get the most value from this pattern, consider these practices:</p><p>Monitor failure rates carefully<br>Choose sensible thresholds for opening the circuit</p><p>Combine with retries and timeouts<br>These patterns work best together when configured properly</p><p>Provide fallback responses<br>Graceful degradation improves user experience during failures</p><p>Track circuit breaker metrics<br>Observability helps identify unstable dependencies.</p><h4>💡 Final Thoughts</h4><p>Distributed systems are powerful but fragile. Failures are inevitable, and without protective patterns, they can quickly spread across services.</p><p>The <strong>Circuit Breaker Pattern</strong> helps contain failures, protect resources, and maintain system stability.</p><p>In resilient architectures, preventing cascading failures is just as important as handling them.</p><p>Designing with patterns like circuit breakers ensures that when something goes wrong, the entire system does not go down with it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f887c8601a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>