<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shitanshu Jha</title>
    <description>The latest articles on DEV Community by Shitanshu Jha (@shitanshu686).</description>
    <link>https://dev.to/shitanshu686</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4089061%2Fdf0bb2f6-2ea8-4a39-acbf-b290296a5e68.jpg</url>
      <title>DEV Community: Shitanshu Jha</title>
      <link>https://dev.to/shitanshu686</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shitanshu686"/>
    <language>en</language>
    <item>
      <title>Taking ShopEase to 1,000 Concurrent Users: High-Concurrency Load Testing with k6</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Tue, 17 Nov 2026 02:24:44 +0000</pubDate>
      <link>https://dev.to/shitanshu686/taking-shopease-to-1000-concurrent-users-high-concurrency-load-testing-with-k6-2fgd</link>
      <guid>https://dev.to/shitanshu686/taking-shopease-to-1000-concurrent-users-high-concurrency-load-testing-with-k6-2fgd</guid>
      <description>&lt;p&gt;Overview&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd4op96h95n884e726a8t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd4op96h95n884e726a8t.png" alt=" " width="800" height="412"&gt;&lt;/a&gt;&lt;br&gt;
A backend application may work correctly during normal development and functional testing, but its real behavior becomes clearer when multiple requests arrive simultaneously.&lt;/p&gt;

&lt;p&gt;As part of my ShopEase e-commerce backend project, I performed high-concurrency load testing using k6 to evaluate how the application handled increasing request loads.&lt;/p&gt;

&lt;p&gt;The objective was to simulate concurrent users, generate a significant number of HTTP requests, and observe whether the backend could continue responding successfully during the test execution.&lt;/p&gt;

&lt;p&gt;This testing milestone helped me move beyond checking whether individual APIs work and start evaluating backend behavior under concurrent traffic.&lt;/p&gt;

&lt;p&gt;Project Architecture&lt;/p&gt;

&lt;p&gt;ShopEase is a full-stack e-commerce application built around a Java and Spring Boot backend.&lt;/p&gt;

&lt;p&gt;The testing environment used a containerized backend setup involving:&lt;/p&gt;

&lt;p&gt;Java &amp;amp; Spring Boot: Backend application and REST API processing.&lt;/p&gt;

&lt;p&gt;MySQL: Relational database for application data.&lt;/p&gt;

&lt;p&gt;Redis: Caching layer.&lt;/p&gt;

&lt;p&gt;Docker: Containerized infrastructure.&lt;/p&gt;

&lt;p&gt;k6: Load testing and traffic simulation.&lt;/p&gt;

&lt;p&gt;The purpose of this test was to evaluate the backend under concurrent request execution within this environment.&lt;/p&gt;

&lt;p&gt;Why High-Concurrency Testing?&lt;/p&gt;

&lt;p&gt;Functional testing generally verifies whether an API returns the expected response for a given request.&lt;/p&gt;

&lt;p&gt;However, it does not necessarily reveal how the application behaves when hundreds of virtual users send requests at the same time.&lt;/p&gt;

&lt;p&gt;Some important questions I wanted to investigate were:&lt;/p&gt;

&lt;p&gt;Can the backend continue processing requests as concurrency increases?&lt;/p&gt;

&lt;p&gt;Does the application return successful HTTP responses during the test?&lt;/p&gt;

&lt;p&gt;Are there dropped connections or server crashes?&lt;/p&gt;

&lt;p&gt;Can the application handle a substantial number of requests during a short testing window?&lt;/p&gt;

&lt;p&gt;These questions motivated the use of k6 for load testing.&lt;/p&gt;

&lt;p&gt;Load Testing with k6&lt;/p&gt;

&lt;p&gt;I used k6 to simulate concurrent virtual users against the ShopEase backend.&lt;/p&gt;

&lt;p&gt;The test was configured with a gradual ramp-up period, allowing the number of virtual users to increase rather than immediately applying the maximum load.&lt;/p&gt;

&lt;p&gt;Test Configuration&lt;/p&gt;

&lt;p&gt;Parameter&lt;/p&gt;

&lt;p&gt;Test Result&lt;/p&gt;

&lt;p&gt;Testing Tool&lt;/p&gt;

&lt;p&gt;k6&lt;/p&gt;

&lt;p&gt;Maximum Virtual Users&lt;/p&gt;

&lt;p&gt;1,000&lt;/p&gt;

&lt;p&gt;Ramp-up Duration&lt;/p&gt;

&lt;p&gt;3 minutes&lt;/p&gt;

&lt;p&gt;Total Requests&lt;/p&gt;

&lt;p&gt;15,946+&lt;/p&gt;

&lt;p&gt;Reported Success Rate&lt;/p&gt;

&lt;p&gt;100%&lt;/p&gt;

&lt;p&gt;HTTP Response&lt;/p&gt;

&lt;p&gt;200 OK&lt;/p&gt;

&lt;p&gt;Reported Dropped Connections&lt;/p&gt;

&lt;p&gt;0&lt;/p&gt;

&lt;p&gt;Server Crashes&lt;/p&gt;

&lt;p&gt;0&lt;/p&gt;

&lt;p&gt;The test reached up to 1,000 concurrent Virtual Users and generated more than 15,946 requests during execution.&lt;/p&gt;

&lt;p&gt;Test Results&lt;/p&gt;

&lt;p&gt;The observed results were:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Concurrent Virtual Users&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The test simulated up to 1,000 virtual users, creating concurrent request traffic against the backend.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Request Processing&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;More than 15,946 requests were processed during the test execution.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Successful HTTP Responses&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The reported success rate was 100%, with successful HTTP 200 responses.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connection Stability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No dropped connections were reported during the execution.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Server Stability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No server crashes were observed during the test.&lt;/p&gt;

&lt;p&gt;These results provided a useful indication of how the current ShopEase setup behaved under the tested workload.&lt;/p&gt;

&lt;p&gt;What I Learned&lt;/p&gt;

&lt;p&gt;This exercise helped me understand that performance testing involves more than simply sending a large number of requests.&lt;/p&gt;

&lt;p&gt;Some important concepts I explored include:&lt;/p&gt;

&lt;p&gt;Virtual Users (VUs): How load testing tools simulate concurrent users.&lt;/p&gt;

&lt;p&gt;Concurrency: How multiple requests can be processed during overlapping execution periods.&lt;/p&gt;

&lt;p&gt;Ramp-up: Why gradually increasing load is useful when observing application behavior.&lt;/p&gt;

&lt;p&gt;HTTP Success Rate: How successful responses can be tracked during a test.&lt;/p&gt;

&lt;p&gt;Backend Resilience: Why server stability and connection handling matter under load.&lt;/p&gt;

&lt;p&gt;Performance Testing: Why functional correctness and performance behavior need separate evaluation.&lt;/p&gt;

&lt;p&gt;It also reinforced the importance of measuring application behavior instead of assuming that a backend can handle increased traffic simply because its APIs work correctly.&lt;/p&gt;

&lt;p&gt;Important Scope and Limitations&lt;/p&gt;

&lt;p&gt;The results represent one load-testing execution in the tested environment.&lt;/p&gt;

&lt;p&gt;A 100% reported success rate does not automatically establish production readiness or guarantee that the application can sustain 1,000 concurrent users indefinitely.&lt;/p&gt;

&lt;p&gt;A more complete performance evaluation would also require additional measurements, including:&lt;/p&gt;

&lt;p&gt;Average response time.&lt;/p&gt;

&lt;p&gt;p90 and p95 latency.&lt;/p&gt;

&lt;p&gt;p99 latency.&lt;/p&gt;

&lt;p&gt;Requests per second (RPS).&lt;/p&gt;

&lt;p&gt;CPU and memory utilization.&lt;/p&gt;

&lt;p&gt;JVM performance and garbage collection.&lt;/p&gt;

&lt;p&gt;Database connection pool utilization.&lt;/p&gt;

&lt;p&gt;MySQL query performance.&lt;/p&gt;

&lt;p&gt;Redis behavior under increasing load.&lt;/p&gt;

&lt;p&gt;These measurements would help identify bottlenecks and provide a more complete picture of the system's performance.&lt;/p&gt;

&lt;p&gt;What's Next?&lt;/p&gt;

&lt;p&gt;The next stage of performance testing for ShopEase will focus on deeper analysis rather than only request success.&lt;/p&gt;

&lt;p&gt;Planned areas of investigation include:&lt;/p&gt;

&lt;p&gt;Response-time distribution and latency analysis.&lt;/p&gt;

&lt;p&gt;Database connection pool monitoring.&lt;/p&gt;

&lt;p&gt;JVM resource utilization.&lt;/p&gt;

&lt;p&gt;Identifying potential bottlenecks.&lt;/p&gt;

&lt;p&gt;Longer-duration stress and endurance testing.&lt;/p&gt;

&lt;p&gt;Comparing performance across different load profiles.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;This load-testing exercise was an important step in the development of ShopEase.&lt;/p&gt;

&lt;p&gt;Using k6, I simulated up to 1,000 concurrent Virtual Users and processed 15,946+ requests, with a reported 100% success rate and no reported dropped connections or server crashes during the test.&lt;/p&gt;

&lt;p&gt;More importantly, this exercise helped me understand how to evaluate backend behavior under concurrent workloads and why measurable performance testing is an essential part of backend engineering.&lt;/p&gt;

&lt;p&gt;Project: ShopEase&lt;br&gt;
Backend: &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app-backend&lt;/a&gt;&lt;br&gt;
Frontend: &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #K6 #LoadTesting #PerformanceTesting #BackendDevelopment #SystemDesign #MySQL #Redis #Docker
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>k6</category>
      <category>loadtesting</category>
    </item>
    <item>
      <title>Local Infrastructure, Real Engineering: Setting Up Kafka &amp; Redis for ShopEase</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Mon, 16 Nov 2026 02:27:07 +0000</pubDate>
      <link>https://dev.to/shitanshu686/local-infrastructure-real-engineering-setting-up-kafka-redis-for-shopease-334b</link>
      <guid>https://dev.to/shitanshu686/local-infrastructure-real-engineering-setting-up-kafka-redis-for-shopease-334b</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyvfskymbfvubgcvsi9zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyvfskymbfvubgcvsi9zw.png" alt=" " width="787" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;Building a modern e-commerce backend involves more than developing REST APIs and connecting a database. As an application grows, handling asynchronous operations, managing frequently accessed data, and understanding distributed infrastructure become equally important.&lt;/p&gt;

&lt;p&gt;While developing ShopEase, I worked on setting up and running essential infrastructure components in my local environment, particularly Apache Kafka and Redis.&lt;/p&gt;

&lt;p&gt;The objective was to move beyond mock implementations and understand how these technologies work together in a real backend development environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Apache Kafka — Asynchronous Event Streaming&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Apache Kafka is an important component of the ShopEase backend architecture.&lt;/p&gt;

&lt;p&gt;It supports asynchronous event streaming and order-processing workflows, allowing services to communicate through events rather than depending entirely on synchronous execution.&lt;/p&gt;

&lt;p&gt;Working with Kafka helped me understand:&lt;/p&gt;

&lt;p&gt;Event-driven architecture.&lt;/p&gt;

&lt;p&gt;Producer and consumer communication.&lt;/p&gt;

&lt;p&gt;Asynchronous message processing.&lt;/p&gt;

&lt;p&gt;Kafka topics and event flow.&lt;/p&gt;

&lt;p&gt;Decoupling operations between backend components.&lt;/p&gt;

&lt;p&gt;Running Kafka locally also provided practical experience with the infrastructure required for message-driven applications.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Redis — Distributed Caching&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Redis is another important component configured in the ShopEase environment.&lt;/p&gt;

&lt;p&gt;It provides an in-memory caching layer that helps reduce repeated database reads for frequently accessed information.&lt;/p&gt;

&lt;p&gt;In ShopEase, Redis is used for caching and catalog optimization.&lt;/p&gt;

&lt;p&gt;Some important concepts explored through this implementation include:&lt;/p&gt;

&lt;p&gt;Distributed caching.&lt;/p&gt;

&lt;p&gt;Cache retrieval and storage.&lt;/p&gt;

&lt;p&gt;Reducing repeated database queries.&lt;/p&gt;

&lt;p&gt;Cache expiration and TTL.&lt;/p&gt;

&lt;p&gt;Understanding cache consistency.&lt;/p&gt;

&lt;p&gt;This helped me understand how caching fits into backend performance optimization.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Moving Beyond Mock Infrastructure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the important parts of this work was setting up actual infrastructure components locally instead of relying only on mock implementations.&lt;/p&gt;

&lt;p&gt;Working with Kafka and Redis in a containerized development environment provided practical exposure to:&lt;/p&gt;

&lt;p&gt;Running infrastructure services locally.&lt;/p&gt;

&lt;p&gt;Managing service configurations.&lt;/p&gt;

&lt;p&gt;Connecting backend applications with external infrastructure.&lt;/p&gt;

&lt;p&gt;Understanding communication between distributed components.&lt;/p&gt;

&lt;p&gt;Working with Docker-based development environments.&lt;/p&gt;

&lt;p&gt;These experiences helped connect backend application code with the infrastructure required to run it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Key Engineering Takeaways&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This implementation strengthened my understanding of several backend engineering concepts:&lt;/p&gt;

&lt;p&gt;Event-Driven Architecture: How asynchronous messaging helps separate application workflows.&lt;/p&gt;

&lt;p&gt;Distributed Caching: How Redis can reduce repeated database access.&lt;/p&gt;

&lt;p&gt;System Design: How different infrastructure components contribute to an application's architecture.&lt;/p&gt;

&lt;p&gt;Fault Tolerance: Understanding how distributed systems need to account for service failures.&lt;/p&gt;

&lt;p&gt;Concurrency: Understanding the challenges associated with asynchronous execution and multiple processing threads.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Setting up Kafka and Redis locally was more than just configuring two technologies. It provided a practical opportunity to understand how messaging and caching contribute to modern backend architecture.&lt;/p&gt;

&lt;p&gt;ShopEase continues to evolve, and this infrastructure work is an important part of building a stronger foundation for upcoming performance and load-engineering activities.&lt;/p&gt;

&lt;p&gt;The goal is simple: understand the architecture, implement it properly, and validate improvements through actual testing.&lt;/p&gt;

&lt;p&gt;Project: ShopEase — Full-Stack E-Commerce Application&lt;/p&gt;

&lt;p&gt;Technologies: Java, Spring Boot, Apache Kafka, Redis, Docker&lt;/p&gt;

&lt;p&gt;GitHub Repositories:&lt;/p&gt;

&lt;p&gt;Backend: &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app-backend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend: &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  About ShopEase
&lt;/h2&gt;

&lt;p&gt;ShopEase is a full-stack e-commerce application developed by &lt;strong&gt;Shitanshu Jha&lt;/strong&gt;, built using Java, Spring Boot, and modern backend technologies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;Backend&lt;/a&gt; | &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;Frontend&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #ApacheKafka #Redis #Docker #BackendEngineering #SystemDesign
&lt;/h1&gt;

</description>
      <category>springboot</category>
      <category>apachekafka</category>
      <category>backendengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>Building ShopEase: From Distributed Architecture to Performance &amp; Load Engineering</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sun, 15 Nov 2026 03:30:01 +0000</pubDate>
      <link>https://dev.to/shitanshu686/building-shopease-from-distributed-architecture-to-performance-load-engineering-4flp</link>
      <guid>https://dev.to/shitanshu686/building-shopease-from-distributed-architecture-to-performance-load-engineering-4flp</guid>
      <description>&lt;p&gt;When designing an enterprise-grade e-commerce backend, writing clean code is only half the battle—the system must also be scalable, fault-tolerant, fully traceable, and high-performing. In this article, we explore the production-ready architecture already implemented in ShopEase and outline our upcoming roadmap for Performance and Load Engineering.&lt;br&gt;
🚀 Part 1: What Is Already Implemented (The Enterprise Foundation)&lt;br&gt;
ShopEase incorporates top-tier system design and distributed architecture patterns right into its core codebase:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Polyglot Persistence &amp;amp; Advanced DB Pooling (HikariCP)&lt;/li&gt;
&lt;li&gt;MySQL serves as the primary relational database for users and orders, backed by HikariCP connection pooling (maximum-pool-size=20, minimum-idle=10) to eliminate connection starvation under load.&lt;/li&gt;
&lt;li&gt;MongoDB manages flexible product catalogs, while PostgreSQL handles dedicated audit logs (shopping_db_audit), preventing heavy logging writes from slowing down primary transactional flows.&lt;/li&gt;
&lt;li&gt;High-Performance Caching Architecture&lt;/li&gt;
&lt;li&gt;A distributed Redis caching layer (spring.cache.type=redis) with a 10-minute TTL (600000ms) offloads frequent catalog reads from MySQL, boosting overall throughput and reducing database latency.&lt;/li&gt;
&lt;li&gt;Event-Driven Messaging with Apache Kafka &amp;amp; Distributed Tracing&lt;/li&gt;
&lt;li&gt;Order state changes leverage Apache Kafka event choreography (order-placed-topic) instead of synchronous blocking calls.&lt;/li&gt;
&lt;li&gt;Configured with Manual Acknowledgement (MANUAL_IMMEDIATE) and a Dead Letter Queue (DLQ) recovery pipeline for bulletproof reliability.&lt;/li&gt;
&lt;li&gt;Distributed Tracing &amp;amp; Correlation ID Propagation: We bridged synchronous HTTP/REST entry points with asynchronous Kafka background threads. Using custom ProducerRecord header injection and consumer RecordInterceptor hooks, the active correlationId flows seamlessly across thread boundaries into MDC, making multi-threaded log aggregation effortless.&lt;/li&gt;
&lt;li&gt;Microservices Communication &amp;amp; Fault Tolerance&lt;/li&gt;
&lt;li&gt;Low-latency internal service-to-service communication is achieved via gRPC and Protocol Buffers (.proto).&lt;/li&gt;
&lt;li&gt;Resilience4j Circuit Breakers and automated fallbacks protect downstream services and payment gateways from cascading failures.
🎯 Part 2: What's Next — Performance &amp;amp; Load Engineering (Module 42)
With a robust architectural foundation in place, our next major milestone is Load Engineering. We are shifting our focus to testing and optimizing how the system behaves under intense, real-world traffic spikes.
Our Load Testing Roadmap:&lt;/li&gt;
&lt;li&gt;Graduated Traffic Simulation Stages:

&lt;ul&gt;
&lt;li&gt;Baseline Test: 10 concurrent users&lt;/li&gt;
&lt;li&gt;Moderate Load: 100 concurrent users&lt;/li&gt;
&lt;li&gt;High Load: 1,000 concurrent users&lt;/li&gt;
&lt;li&gt;Stress Peak: 10,000+ requests&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Tooling Integration:

&lt;ul&gt;
&lt;li&gt;Utilizing load testing suites like k6 or JMeter to simulate realistic HTTP and gRPC traffic patterns.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Key Performance Metrics Monitored:

&lt;ul&gt;
&lt;li&gt;Response Time Latency: Tracking p95 and p99 percentiles.&lt;/li&gt;
&lt;li&gt;Throughput (RPS): Measuring successful requests processed per second under pressure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bottleneck Detection &amp;amp; Fine-Tuning:

&lt;ul&gt;
&lt;li&gt;Analyzing JVM garbage collection behavior and memory footprints.&lt;/li&gt;
&lt;li&gt;Tuning Tomcat/Netty thread pool sizes and HikariCP saturation limits.
Conclusion
ShopEase has evolved into a fully realized enterprise-grade distributed backend. With Performance &amp;amp; Load Engineering (Module 42) underway, we are battle-testing the system to ensure it can gracefully handle high-concurrency production workloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stay tuned as we push ShopEase toward handling 10,000+ concurrent requests effortlessly!&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0lcmppnqao619d8wvls.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0lcmppnqao619d8wvls.png" alt=" " width="800" height="893"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>systemdesign</category>
      <category>microservices</category>
    </item>
    <item>
      <title>Beyond Backend Development: Exploring System Design with ShopEase</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sat, 14 Nov 2026 05:39:16 +0000</pubDate>
      <link>https://dev.to/shitanshu686/beyond-backend-development-exploring-system-design-with-shopease-2ml2</link>
      <guid>https://dev.to/shitanshu686/beyond-backend-development-exploring-system-design-with-shopease-2ml2</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;Building a backend application is not just about writing APIs and connecting databases. As an application grows, important questions start appearing:&lt;/p&gt;

&lt;p&gt;How can the system handle increasing traffic?&lt;/p&gt;

&lt;p&gt;What happens when a service becomes unavailable?&lt;/p&gt;

&lt;p&gt;How should databases and caches be used?&lt;/p&gt;

&lt;p&gt;How do different services communicate?&lt;/p&gt;

&lt;p&gt;How can we maintain data consistency?&lt;/p&gt;

&lt;p&gt;In Module 41 — System Design, I focused on understanding these architectural decisions through the ShopEase e-commerce backend.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scalability: Handling Application Growth&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Scalability is the ability of a system to handle increasing workloads.&lt;/p&gt;

&lt;p&gt;Two common approaches are:&lt;/p&gt;

&lt;p&gt;Vertical Scaling: Increasing the resources of an existing server, such as CPU and RAM.&lt;/p&gt;

&lt;p&gt;Horizontal Scaling: Adding more instances of an application to distribute incoming requests.&lt;/p&gt;

&lt;p&gt;Understanding the difference helps in choosing an appropriate scaling strategy as application traffic grows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Availability and Reliability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Availability refers to whether a system is accessible when users need it.&lt;/p&gt;

&lt;p&gt;Reliability focuses on whether the system continues to perform its intended operations correctly.&lt;/p&gt;

&lt;p&gt;These are important considerations for e-commerce applications, where failures in order processing, payments, or inventory operations can affect users.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;CAP Theorem and Data Consistency&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The CAP theorem describes the trade-offs between Consistency, Availability, and Partition Tolerance in distributed data systems.&lt;/p&gt;

&lt;p&gt;I explored how these concepts influence architectural decisions, particularly when multiple services and databases are involved.&lt;/p&gt;

&lt;p&gt;Data consistency is especially important in operations such as order placement, inventory updates, and payment processing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Load Balancing and Database Scaling&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Load balancing distributes incoming requests across multiple application instances.&lt;/p&gt;

&lt;p&gt;Database scaling focuses on handling growing data volumes and query workloads.&lt;/p&gt;

&lt;p&gt;These concepts help explain how backend systems can manage increasing traffic without placing all the workload on a single application instance or database.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Caching Architecture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Caching helps reduce repeated database queries by temporarily storing frequently accessed data.&lt;/p&gt;

&lt;p&gt;In ShopEase, Redis is part of the backend architecture. Understanding caching at the system-design level helped connect cache usage with response time, database workload, and cache consistency.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Message Queues and Microservices Architecture&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Microservices divide an application into smaller services with specific responsibilities.&lt;/p&gt;

&lt;p&gt;Message queues support asynchronous communication between services.&lt;/p&gt;

&lt;p&gt;In ShopEase, Apache Kafka is used as part of the event-driven architecture. This provides a practical context for understanding asynchronous communication and service coordination.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fault Tolerance and High Availability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fault tolerance focuses on how a system handles component failures.&lt;/p&gt;

&lt;p&gt;High availability aims to minimize service interruptions.&lt;/p&gt;

&lt;p&gt;I studied these concepts to understand the architectural approaches used to reduce the impact of failures in distributed applications.&lt;/p&gt;

&lt;p&gt;Key Learnings&lt;/p&gt;

&lt;p&gt;Module 41 helped connect backend development with broader system-design concepts:&lt;/p&gt;

&lt;p&gt;Scalability: Vertical and horizontal scaling.&lt;/p&gt;

&lt;p&gt;Availability and reliability.&lt;/p&gt;

&lt;p&gt;CAP theorem and distributed data consistency.&lt;/p&gt;

&lt;p&gt;Load balancing and database scaling.&lt;/p&gt;

&lt;p&gt;Redis-based caching architecture.&lt;/p&gt;

&lt;p&gt;Kafka and asynchronous messaging.&lt;/p&gt;

&lt;p&gt;Microservices communication.&lt;/p&gt;

&lt;p&gt;Fault tolerance and high availability.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;System design is about understanding the decisions behind an application's architecture, not simply adding more technologies.&lt;/p&gt;

&lt;p&gt;Through ShopEase, I am connecting concepts such as caching, microservices, databases, and messaging with the architectural challenges that appear as an application grows.&lt;/p&gt;

&lt;p&gt;Module 41 marks an important step in understanding not just how to build backend systems, but also how to think about their architecture.&lt;/p&gt;

&lt;p&gt;Project: ShopEase — Full-Stack E-Commerce Application&lt;/p&gt;

&lt;p&gt;GitHub Repositories:&lt;/p&gt;

&lt;p&gt;Backend: &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app-backend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend: &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #SystemDesign #Microservices #BackendDevelopment
&lt;/h1&gt;

</description>
      <category>microservices</category>
      <category>backenddevelopment</category>
      <category>systemdesign</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Building Enterprise-Grade Distributed Tracing in a Spring Boot Event-Driven Architecture (ShopEase)</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Fri, 13 Nov 2026 06:59:08 +0000</pubDate>
      <link>https://dev.to/shitanshu686/building-enterprise-grade-distributed-tracing-in-a-spring-boot-event-driven-architecture-shopease-m09</link>
      <guid>https://dev.to/shitanshu686/building-enterprise-grade-distributed-tracing-in-a-spring-boot-event-driven-architecture-shopease-m09</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ficivmdiw23fcjr16vlf1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ficivmdiw23fcjr16vlf1.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Modern distributed microservices architectures offer incredible scalability, but they introduce a fundamental observability challenge: The Black Box Problem of Asynchronous Messaging.&lt;/p&gt;

&lt;p&gt;When a client makes an HTTP request to an e-commerce platform, tracing the request lifecycle via a unique Correlation ID across REST and gRPC endpoints is relatively straightforward using thread-local storage like SLF4J's MDC (Mapped Diagnostic Context). However, the moment that request triggers a state change—such as placing an order—and pushes an event into an asynchronous message broker like Apache Kafka, that execution jumps across thread boundaries.&lt;/p&gt;

&lt;p&gt;The background consumer thread picking up the message from the queue has no native awareness of the incoming HTTP thread's context. Without explicit propagation, your correlation ID is lost, turning distributed log aggregation and debugging in production into a guessing game.&lt;/p&gt;

&lt;p&gt;In this article, we look at how we solved this architectural hurdle in ShopEase—a production-grade Spring Boot e-commerce backend—by engineering a seamless, non-intrusive Distributed Tracing and Correlation ID Propagation Pipeline across Kafka thread boundaries.&lt;/p&gt;

&lt;p&gt;The Problem: Context Loss Across Asynchronous Boundaries&lt;br&gt;
In ShopEase, our order orchestration relies on an event-driven choreography using Apache Kafka. The lifecycle flows roughly as follows:&lt;/p&gt;

&lt;p&gt;HTTP/REST Request: A client initiates a checkout request. Our custom CorrelationIdInterceptor intercepts the incoming request header (X-Correlation-ID), generates one if missing, and injects it into the SLF4J MDC context.&lt;/p&gt;

&lt;p&gt;Synchronous/Service Execution: Services talk via gRPC and REST, logging actions tied directly to this correlationId.&lt;/p&gt;

&lt;p&gt;The Asynchronous Leap (OrderSagaOrchestrator): An order is placed, and an OrderPlacedEvent is published to Kafka.&lt;/p&gt;

&lt;p&gt;The Break: The publishing thread finishes. A completely separate consumer thread pool picks up the record from the Kafka broker to update inventory or trigger payment processing. Because standard Kafka template sends and standard listener containers do not automatically map MDC contexts across thread handoffs, the correlationId drops to null.&lt;/p&gt;

&lt;p&gt;The Solution: Bridging Kafka Producers and Consumers with MDC&lt;br&gt;
To solve this without cluttering our core business logic, we leveraged Kafka’s built-in Headers mechanism combined with Spring Kafka’s interception hooks. We split the solution into two symmetrical pillars: Producer Injection and Consumer Interception.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Injecting the Correlation ID at the Producer Level
When publishing events via KafkaTemplate, instead of relying on a bare record send, we wrap our payload inside a Kafka ProducerRecord. We read the active correlationId from the thread's MDC context and append it as a Kafka record header:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java&lt;br&gt;
public void publishOrderPlacedEvent(OrderPlacedEvent event) {&lt;br&gt;
    log.info("Publishing OrderPlacedEvent to Kafka topic '{}': {}", KafkaTopicConfig.ORDER_PLACED_TOPIC, event);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// 1. Grab current correlation ID from MDC
String correlationId = MDC.get("correlationId");

ProducerRecord&amp;lt;String, Object&amp;gt; record = new ProducerRecord&amp;lt;&amp;gt;(
    KafkaTopicConfig.ORDER_PLACED_TOPIC, 
    String.valueOf(event.getOrderId()), 
    event
);

// 2. Inject into Kafka headers if present
if (correlationId != null &amp;amp;&amp;amp; !correlationId.isBlank()) {
    record.headers().add("correlationId", correlationId.getBytes(StandardCharsets.UTF_8));
}

this.kafkaTemplate.send(record);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Restoring Context via Consumer Record Interceptors
On the consuming side, when a worker thread picks up the message from the queue, we intercept the incoming record before it reaches any @KafkaListener method. Using ConcurrentKafkaListenerContainerFactory#setRecordInterceptor, we extract the correlationId header and populate the worker thread's MDC context:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Java&lt;br&gt;
&lt;a class="mentioned-user" href="https://dev.to/bean"&gt;@bean&lt;/a&gt;&lt;br&gt;
public ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory(&lt;br&gt;
        ConsumerFactory consumerFactory,&lt;br&gt;
        KafkaTemplate kafkaTemplate) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ConcurrentKafkaListenerContainerFactory&amp;lt;String, Object&amp;gt; factory =
        new ConcurrentKafkaListenerContainerFactory&amp;lt;&amp;gt;();
factory.setConsumerFactory(consumerFactory);

factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);

// Kafka Record Interceptor for Correlation ID Propagation in MDC
factory.setRecordInterceptor(record -&amp;gt; {
    Header header = record.headers().lastHeader("correlationId");
    if (header != null) {
        String correlationId = new String(header.value(), StandardCharsets.UTF_8);
        MDC.put("correlationId", correlationId);
    } else {
        MDC.put("correlationId", UUID.randomUUID().toString());
    }
    return record;
});

// Error handler &amp;amp; DLQ recoverer setup...
return factory;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
Crucial Production Note: Because consumer threads are pooled and reused across messages, failing to clear or overwrite MDC can cause context leaks (where Message B inherits Message A's trace ID). Always ensure your consumers clear or wrap logging execution contexts cleanly.&lt;/p&gt;

&lt;p&gt;Architectural Impact &amp;amp; Benefits&lt;br&gt;
By implementing this pattern in ShopEase, we achieved:&lt;/p&gt;

&lt;p&gt;End-to-End Observability: A single correlationId now flows seamlessly from the initial HTTP entry point, through gRPC service calls, into Kafka topics, and across downstream consumer workers.&lt;/p&gt;

&lt;p&gt;Zero Business Logic Pollution: Developers writing event listeners don't need to manually pass or unpack tracing headers; logging frameworks pick up the trace context automatically.&lt;/p&gt;

&lt;p&gt;Resilient Debugging: When a transaction fails and hits our Dead Letter Queue (DLQ), we can query our centralized log aggregation tool using the correlation ID and inspect the entire distributed timeline instantly.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Distributed tracing isn't just an afterthought or an APM tool feature—it's an architectural requirement. By leveraging Kafka headers and Spring interceptors, we bridged the gap between synchronous web requests and asynchronous event-driven pipelines, making ShopEase truly enterprise-ready.&lt;/p&gt;

</description>
      <category>springboot</category>
      <category>kafka</category>
      <category>microservices</category>
      <category>distributedtracing</category>
    </item>
    <item>
      <title>Engineering a High-Concurrency E-Commerce Backend: Testing, Concurrency &amp; Resilience at Scale</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Thu, 12 Nov 2026 10:44:06 +0000</pubDate>
      <link>https://dev.to/shitanshu686/engineering-a-high-concurrency-e-commerce-backend-testing-concurrency-resilience-at-scale-192l</link>
      <guid>https://dev.to/shitanshu686/engineering-a-high-concurrency-e-commerce-backend-testing-concurrency-resilience-at-scale-192l</guid>
      <description>&lt;p&gt;Introduction&lt;br&gt;
Modern e-commerce platforms operate under extreme constraints. During flash sales or peak traffic events, backends face massive spikes in concurrent requests, threatening data integrity, inventory accuracy, and system availability.&lt;/p&gt;

&lt;p&gt;In building ShopEase (shopping-app-backend), a Spring Boot 3.x Java 17 e-commerce backend, achieving functional correctness was only half the battle. The true challenge lay in engineering a robust Testing &amp;amp; Quality Engineering pipeline to guarantee thread safety, zero race conditions, and predictable performance under heavy load.&lt;/p&gt;

&lt;p&gt;The Testing &amp;amp; Quality Engineering Strategy&lt;br&gt;
To ensure zero regressions and high availability, our testing architecture covers every critical tier of the application:&lt;/p&gt;

&lt;p&gt;Unit &amp;amp; Slice Testing: Isolating controllers and services using Mockito (OrderControllerTest, ProductControllerTest) to validate HTTP statuses and JSON serialization instantly.&lt;/p&gt;

&lt;p&gt;Integration Testing: Verifying cross-component flows and database interactions (OrderServiceIntegrationTest).&lt;/p&gt;

&lt;p&gt;Concurrency &amp;amp; Race Condition Testing: Simulating multi-threaded contention to prevent inventory overselling and lost updates (InventoryConcurrencyTest).&lt;/p&gt;

&lt;p&gt;Load &amp;amp; Stress Testing: Automating high-traffic simulations via custom Java concurrency harnesses to measure throughput and failure rates under pressure (LoadAndStressTest).&lt;/p&gt;

&lt;p&gt;Key Technical Highlights&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Zero-Mock Concurrency Testing&lt;br&gt;
To prevent race conditions during high-demand operations, we validated thread safety using multi-threaded execution services (ExecutorService), ensuring that simultaneous updates maintain strict data consistency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lightweight Load &amp;amp; Stress Harness&lt;br&gt;
Instead of relying on heavy external CLI tools, we built an integrated Java-based load testing harness using standard HTTP clients to bombard endpoints with concurrent virtual users, measuring real-time latency, success ratios, and system stability under load.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion&lt;br&gt;
By implementing this comprehensive testing suite, we achieved 100% build success across all modules, robust thread safety for inventory management, and high test maintainability. Building resilient systems isn't just about clean code—it's about proving that your architecture holds up under real-world pressure.&lt;/p&gt;

</description>
      <category>java</category>
      <category>concurrency</category>
      <category>loadtesting</category>
      <category>softwaretesting</category>
    </item>
    <item>
      <title>Is Your E-Commerce Backend Secure? ShopEase's JWT, Token Rotation &amp; Checkout Upgrades</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Wed, 11 Nov 2026 02:19:25 +0000</pubDate>
      <link>https://dev.to/shitanshu686/is-your-e-commerce-backend-secure-shopeases-jwt-token-rotation-checkout-upgrades-57jh</link>
      <guid>https://dev.to/shitanshu686/is-your-e-commerce-backend-secure-shopeases-jwt-token-rotation-checkout-upgrades-57jh</guid>
      <description>&lt;p&gt;Recent Backend Engineering Milestones | November 6–11, 2026&lt;br&gt;
Building an e-commerce backend is not just about implementing product listings, shopping carts, and checkout APIs.&lt;/p&gt;

&lt;p&gt;The real engineering challenges begin when security, performance, and data consistency become critical.&lt;/p&gt;

&lt;p&gt;Over the past few days, I focused on strengthening the ShopEase backend across three major areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security and authentication&lt;/li&gt;
&lt;li&gt;Database performance and transaction management&lt;/li&gt;
&lt;li&gt;Reliable order processing under concurrent requests
Here's what changed.&lt;/li&gt;
&lt;li&gt;Advanced Database Transactions — November 11
One of the most important challenges in e-commerce is maintaining data consistency during checkout.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Multiple users may place orders simultaneously, and transaction isolation becomes an important part of handling concurrent database operations.&lt;/p&gt;

&lt;p&gt;What I implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configured REPEATABLE_READ transaction isolation.&lt;/li&gt;
&lt;li&gt;Applied the configuration to OrderService.createOrder.&lt;/li&gt;
&lt;li&gt;Strengthened transaction consistency during order processing.&lt;/li&gt;
&lt;li&gt;Addressed data anomalies associated with concurrent transactions.
The objective was to make checkout operations more reliable when multiple transactions interact with the database simultaneously.&lt;/li&gt;
&lt;li&gt;Security Hardening — November 10
Security cannot be treated as an optional feature in an application that handles user accounts, orders, and payments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I strengthened the application's security configuration.&lt;/p&gt;

&lt;p&gt;What I implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hardened CORS configuration.&lt;/li&gt;
&lt;li&gt;Added startup environment validation for sensitive secrets.&lt;/li&gt;
&lt;li&gt;Integrated HTTP security headers.&lt;/li&gt;
&lt;li&gt;Configured HSTS and FrameOptions in SecurityConfig.
These changes help establish stricter security controls and reduce configuration-related risks.&lt;/li&gt;
&lt;li&gt;JWT Authentication Across Sensitive Endpoints — November 9
Previously, securing individual APIs was not enough. Sensitive operations needed consistent authentication enforcement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I implemented:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforced JWT authentication across cart endpoints.&lt;/li&gt;
&lt;li&gt;Secured order endpoints.&lt;/li&gt;
&lt;li&gt;Protected payment endpoints.&lt;/li&gt;
&lt;li&gt;Strengthened access control for sensitive operations.
The objective was to ensure that these operations require valid authentication.&lt;/li&gt;
&lt;li&gt;Cart Performance Optimization — November 8
Performance optimization is not always about adding more infrastructure. Sometimes, the biggest improvement comes from fixing inefficient database access patterns.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I optimized:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refactored buildCartResponse.&lt;/li&gt;
&lt;li&gt;Replaced table-scan-style retrieval with direct repository queries.&lt;/li&gt;
&lt;li&gt;Improved how cart response data is retrieved.
I also finalized refresh token rotation and completed endpoint wiring with a stable clean build.&lt;/li&gt;
&lt;li&gt;Refresh Token Rotation — November 6–8
Authentication should not depend on a single long-lived access token.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I implemented the refresh token rotation flow to strengthen session management.&lt;/p&gt;

&lt;p&gt;Key changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Implemented token rotation logic.&lt;/li&gt;
&lt;li&gt;Added TokenRefresh request and response DTOs.&lt;/li&gt;
&lt;li&gt;Wired refresh token endpoints.&lt;/li&gt;
&lt;li&gt;Finalized the authentication flow.
This provides a foundation for safer token lifecycle management.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Development Timeline&lt;br&gt;
Date    Milestone&lt;br&gt;
November 6  Refresh token rotation and DTOs&lt;br&gt;
November 8  Cart optimization and endpoint wiring&lt;br&gt;
November 9  JWT authentication enforcement&lt;br&gt;
November 10 CORS, environment validation, HSTS and security headers&lt;br&gt;
November 11 REPEATABLE_READ transaction isolationWhat's Next?&lt;br&gt;
The focus is on continuing to improve ShopEase's backend reliability, security, and performance while validating the implementation through practical testing.&lt;br&gt;
Final Thoughts&lt;br&gt;
These updates represent an important step in evolving ShopEase beyond basic e-commerce functionality.&lt;/p&gt;

&lt;p&gt;The goal is not simply to build APIs that work. It is to build backend systems that handle authentication securely, retrieve data efficiently, and maintain consistency during critical operations.&lt;/p&gt;

&lt;p&gt;Secure authentication. Optimized queries. Reliable transactions.&lt;/p&gt;

&lt;p&gt;That's the direction I'm taking with ShopEase.&lt;/p&gt;

&lt;h3&gt;
  
  
  About ShopEase
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ShopEase&lt;/strong&gt; is a full-stack e-commerce web application designed to provide a complete online shopping experience, from product discovery to cart management, order placement, and payment processing.&lt;/p&gt;

&lt;p&gt;The project is built around a Java Spring Boot backend and integrates multiple technologies to handle different application requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key technologies and capabilities:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java and Spring Boot for backend development.&lt;/li&gt;
&lt;li&gt;Spring Security and JWT for authentication and authorization.&lt;/li&gt;
&lt;li&gt;MySQL for relational business data.&lt;/li&gt;
&lt;li&gt;MongoDB for dynamic product information.&lt;/li&gt;
&lt;li&gt;Redis for caching and low-latency operations.&lt;/li&gt;
&lt;li&gt;PostgreSQL for audit logging.&lt;/li&gt;
&lt;li&gt;REST APIs for frontend-backend communication.&lt;/li&gt;
&lt;li&gt;Docker and other backend technologies for application development and deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ShopEase is an ongoing engineering project through which I am exploring backend architecture, database management, application security, performance optimization, and scalable system design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Backend: &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app-backend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend: &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #BackendDevelopment #JWT #Redis #MySQL #PostgreSQL #DatabaseTransactions #SystemDesign #Ecommerce
&lt;/h1&gt;

</description>
      <category>jwtauthentication</category>
      <category>springsecurity</category>
      <category>backenddevelopment</category>
      <category>databasemanagement</category>
    </item>
    <item>
      <title>My First Contribution to Zerocode: Building a Configurable Delay Executor,I Fixed the Code, But Who's Going to Fix My Sleep Schedule? 💀</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sun, 08 Nov 2026 05:05:35 +0000</pubDate>
      <link>https://dev.to/shitanshu686/my-first-contribution-to-zerocode-building-a-configurable-delay-executori-fixed-the-code-but-460a</link>
      <guid>https://dev.to/shitanshu686/my-first-contribution-to-zerocode-building-a-configurable-delay-executori-fixed-the-code-but-460a</guid>
      <description>&lt;p&gt;Writing&lt;/p&gt;

&lt;p&gt;My First Contribution to Zerocode: Building a Configurable Delay Executor&lt;br&gt;
Introduction&lt;br&gt;
My open-source journey with Zerocode became a practical learning experience when I started working on Issue #810 — Configurable Delay Executor.&lt;/p&gt;

&lt;p&gt;Instead of simply writing a delay using Thread.sleep(), the challenge was to understand how Zerocode handles API execution internally and integrate a dedicated delay executor into its existing architecture.&lt;/p&gt;

&lt;p&gt;I spent approximately 6–7 hours understanding the codebase, implementing the feature, debugging integration points, writing tests, and verifying the final implementation.&lt;br&gt;
The Problem&lt;br&gt;
The requirement was to introduce a configurable delay mechanism that could be used directly inside Zerocode test scenarios.&lt;/p&gt;

&lt;p&gt;A test scenario should be able to request a delay in milliseconds without requiring an external API.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
{&lt;br&gt;
  "name": "wait_for_100_ms",&lt;br&gt;
  "url": "util://DelayExecutor",&lt;br&gt;
  "operation": "DELAY",&lt;br&gt;
  "request": 100,&lt;br&gt;
  "assertions": {&lt;br&gt;
    "status": "Success",&lt;br&gt;
    "delayMillis": 100&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
The challenge was not just waiting for a specified duration. The delay operation needed to work with Zerocode's existing execution flow, dependency injection, API routing, and scenario runner.&lt;br&gt;
What I Implemented&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dedicated Delay Executor
I created a DelayExecutor interface and its implementation, DelayExecutorImpl.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The executor accepts a delay value in milliseconds, validates it, executes the delay, and returns a structured JSON response.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API Routing Integration
I introduced a dedicated DELAY_CALL API type and configured the URL:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;util://DelayExecutor&lt;/p&gt;

&lt;p&gt;This ensures that delay requests are recognized as delay operations instead of being incorrectly routed through the generic Java API execution path.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dependency Injection with Guice
I integrated the new executor into Zerocode's Guice dependency injection configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This allowed the scenario execution layer to access the delay executor through the framework's existing dependency injection mechanism.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scenario Runner Integration
I updated ZeroCodeMultiStepsScenarioRunnerImpl to recognize DELAY_CALL and delegate execution to the API executor.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This made the new functionality available directly inside test scenarios.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validation and Interruption Handling
I implemented handling for:&lt;/li&gt;
&lt;li&gt;Null and empty delay values.&lt;/li&gt;
&lt;li&gt;Invalid numeric values.&lt;/li&gt;
&lt;li&gt;Negative delay values.&lt;/li&gt;
&lt;li&gt;Thread interruption during execution.
When interrupted, the implementation restores the thread's interrupt status before reporting the failure.&lt;/li&gt;
&lt;li&gt;Testing and Documentation
I added unit tests, API routing tests, and an integration scenario.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I also updated the README with usage instructions and an example of the new executor.&lt;br&gt;
Testing Results&lt;br&gt;
The targeted Maven test execution completed successfully:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;19 tests executed.&lt;/li&gt;
&lt;li&gt;0 failures.&lt;/li&gt;
&lt;li&gt;0 errors.&lt;/li&gt;
&lt;li&gt;1 skipped.&lt;/li&gt;
&lt;li&gt;Build: SUCCESS.
The tests covered delay execution, zero delay, invalid inputs, negative values, interruption handling, API routing, and scenario-level integration.
What I Learned
This contribution helped me understand several important concepts in real-world Java development:&lt;/li&gt;
&lt;li&gt;Understanding an existing codebase: How to trace execution across interfaces, implementations, API routing, and scenario runners.&lt;/li&gt;
&lt;li&gt;Dependency Injection: How Guice connects components without tightly coupling their implementations.&lt;/li&gt;
&lt;li&gt;Framework Architecture: Why adding a feature requires integration across multiple layers rather than writing an isolated method.&lt;/li&gt;
&lt;li&gt;Exception Handling: How to handle invalid inputs and thread interruption correctly.&lt;/li&gt;
&lt;li&gt;Unit and Integration Testing: Why testing individual methods is not enough when a feature must work across an entire execution pipeline.&lt;/li&gt;
&lt;li&gt;Open-Source Workflow: How to investigate an issue, work on a fork and feature branch, create commits, push changes, and submit a pull request.
Contribution Status
I submitted my implementation through:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pull Request #814 — [Issue #810] Add configurable delay executor&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/authorjapps/zerocode" rel="noopener noreferrer"&gt;https://github.com/authorjapps/zerocode&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pull Request: &lt;a href="https://github.com/authorjapps/zerocode/pull/814" rel="noopener noreferrer"&gt;https://github.com/authorjapps/zerocode/pull/814&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pull request is currently open and awaiting review.&lt;br&gt;
Final Thoughts&lt;br&gt;
This contribution was a reminder that real software development involves much more than writing code.&lt;/p&gt;

&lt;p&gt;Understanding an unfamiliar codebase, identifying the correct integration points, handling edge cases, writing meaningful tests, and verifying the implementation are all part of the engineering process.&lt;/p&gt;

&lt;p&gt;My goal with open source is to keep learning how production-level projects are structured while contributing useful, tested improvements to the developer community.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>java</category>
      <category>github</category>
      <category>backend</category>
    </item>
    <item>
      <title>MySQL Wasn't Enough! Why I Added MongoDB, Redis &amp; PostgreSQL to ShopEase</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Thu, 05 Nov 2026 10:02:02 +0000</pubDate>
      <link>https://dev.to/shitanshu686/mysql-wasnt-enough-why-i-added-mongodb-redis-postgresql-to-shopease-1hp8</link>
      <guid>https://dev.to/shitanshu686/mysql-wasnt-enough-why-i-added-mongodb-redis-postgresql-to-shopease-1hp8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyml1g0qazifo8c9bajp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyml1g0qazifo8c9bajp5.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;Project: ShopEase — E-Commerce Web Application&lt;/p&gt;

&lt;p&gt;What happens when you try to manage orders, payments, dynamic product specifications, caching, and audit logs using just one database?&lt;/p&gt;

&lt;p&gt;You might end up forcing different types of workloads into a system that wasn't designed to handle all of them equally well.&lt;/p&gt;

&lt;p&gt;While developing ShopEase, I chose a different approach: Polyglot Persistence.&lt;/p&gt;

&lt;p&gt;Instead of depending on a single database, I integrated four different data technologies — MySQL, MongoDB, Redis, and PostgreSQL — and assigned each one a specific responsibility.&lt;/p&gt;

&lt;p&gt;Here's why.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;MySQL — The Transactional Backbone&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;E-commerce applications deal with critical business data: users, orders, payments, and cart records.&lt;/p&gt;

&lt;p&gt;These operations require reliable transactions and strong data consistency.&lt;/p&gt;

&lt;p&gt;That's why I selected MySQL as the primary relational database.&lt;/p&gt;

&lt;p&gt;Why MySQL?&lt;/p&gt;

&lt;p&gt;ACID transaction support.&lt;/p&gt;

&lt;p&gt;Foreign key constraints and relational integrity.&lt;/p&gt;

&lt;p&gt;Efficient joins and structured queries.&lt;/p&gt;

&lt;p&gt;Reliable management of transactional business data.&lt;/p&gt;

&lt;p&gt;MySQL handles the core relational data where consistency matters most.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;MongoDB — Because Products Don't Follow One Fixed Structure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consider two products:&lt;/p&gt;

&lt;p&gt;A smartphone has RAM, storage, processor, and battery specifications.&lt;/p&gt;

&lt;p&gt;A T-shirt has size, color, fabric, and fit.&lt;/p&gt;

&lt;p&gt;Trying to represent every product using the same rigid structure can become difficult as the catalog grows.&lt;/p&gt;

&lt;p&gt;That's where MongoDB comes in.&lt;/p&gt;

&lt;p&gt;Why MongoDB?&lt;/p&gt;

&lt;p&gt;Flexible document-based structure.&lt;/p&gt;

&lt;p&gt;Different products can have different attributes.&lt;/p&gt;

&lt;p&gt;Easier handling of dynamic product specifications.&lt;/p&gt;

&lt;p&gt;Suitable for evolving product catalog requirements.&lt;/p&gt;

&lt;p&gt;MongoDB gives ShopEase the flexibility to manage product-specific information without forcing every category into an identical schema.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Redis — Speed Matters&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repeatedly querying a relational database for frequently accessed information can increase database load and response time.&lt;/p&gt;

&lt;p&gt;For performance-sensitive operations, I integrated Redis.&lt;/p&gt;

&lt;p&gt;Why Redis?&lt;/p&gt;

&lt;p&gt;In-memory data access.&lt;/p&gt;

&lt;p&gt;Low-latency caching.&lt;/p&gt;

&lt;p&gt;Session and frequently accessed data management.&lt;/p&gt;

&lt;p&gt;Support for real-time cart-related operations and rate limiting.&lt;/p&gt;

&lt;p&gt;Redis helps reduce unnecessary database queries and improves responsiveness for frequently accessed data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PostgreSQL — Keeping an Independent Audit Trail&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A production-oriented application also needs to track important system activities.&lt;/p&gt;

&lt;p&gt;Questions such as these matter:&lt;/p&gt;

&lt;p&gt;Who performed an action?&lt;/p&gt;

&lt;p&gt;What action was performed?&lt;/p&gt;

&lt;p&gt;Which entity was affected?&lt;/p&gt;

&lt;p&gt;When did the action happen?&lt;/p&gt;

&lt;p&gt;For this responsibility, I introduced PostgreSQL as a dedicated audit-log database.&lt;/p&gt;

&lt;p&gt;Why PostgreSQL?&lt;/p&gt;

&lt;p&gt;Independent storage for audit records.&lt;/p&gt;

&lt;p&gt;Structured querying of audit history.&lt;/p&gt;

&lt;p&gt;Separation of audit data from core business data.&lt;/p&gt;

&lt;p&gt;Better organization of security and activity tracking.&lt;/p&gt;

&lt;p&gt;This separation helps keep audit data management independent of the primary transactional database.&lt;/p&gt;

&lt;p&gt;The Architecture at a Glance&lt;/p&gt;

&lt;p&gt;Technology&lt;/p&gt;

&lt;p&gt;Responsibility&lt;/p&gt;

&lt;p&gt;MySQL&lt;/p&gt;

&lt;p&gt;Users, orders, payments, and relational data&lt;/p&gt;

&lt;p&gt;MongoDB&lt;/p&gt;

&lt;p&gt;Dynamic product specifications&lt;/p&gt;

&lt;p&gt;Redis&lt;/p&gt;

&lt;p&gt;Caching, sessions, and low-latency operations&lt;/p&gt;

&lt;p&gt;PostgreSQL&lt;/p&gt;

&lt;p&gt;Audit logs and activity tracking&lt;/p&gt;

&lt;p&gt;The Bigger Lesson: Polyglot Persistence&lt;/p&gt;

&lt;p&gt;Using four databases wasn't about adding technologies just to make the architecture look advanced.&lt;/p&gt;

&lt;p&gt;Each database solves a different problem.&lt;/p&gt;

&lt;p&gt;MySQL provides transactional reliability.&lt;/p&gt;

&lt;p&gt;MongoDB provides schema flexibility.&lt;/p&gt;

&lt;p&gt;Redis provides low-latency data access.&lt;/p&gt;

&lt;p&gt;PostgreSQL provides a dedicated audit data store.&lt;/p&gt;

&lt;p&gt;The important engineering decision wasn't choosing four databases. It was understanding which data belongs where and why.&lt;/p&gt;

&lt;p&gt;ShopEase gave me practical experience with designing a multi-database architecture and understanding the trade-offs involved in using different storage technologies within one application.&lt;/p&gt;

&lt;p&gt;One application. Four databases. Four distinct responsibilities.&lt;/p&gt;

&lt;p&gt;That's the idea behind Polyglot Persistence.&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #MySQL #MongoDB #PostgreSQL #Redis #PolyglotPersistence #BackendDevelopment #SystemDesign #Ecommerce #ShitanshuJha
&lt;/h1&gt;

</description>
      <category>mysql</category>
      <category>mongodb</category>
      <category>postgres</category>
      <category>redis</category>
    </item>
    <item>
      <title># Beyond a Single Database: Engineering ShopEase with Polyglot Persistence &amp; Event-Driven Microservices</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Thu, 29 Oct 2026 06:42:43 +0000</pubDate>
      <link>https://dev.to/shitanshu686/-beyond-a-single-database-engineering-shopease-with-polyglot-persistence-event-driven-432o</link>
      <guid>https://dev.to/shitanshu686/-beyond-a-single-database-engineering-shopease-with-polyglot-persistence-event-driven-432o</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumc0lah8jjrm9kckxx6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fumc0lah8jjrm9kckxx6u.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;What happens when an e-commerce backend needs transactional consistency, flexible product data, asynchronous processing, and reliable audit logging—all at the same time?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A single database and tightly coupled services aren't always the best fit for every workload. While working on &lt;strong&gt;ShopEase&lt;/strong&gt;, my full-stack e-commerce project, I worked on a backend architecture that separates storage responsibilities and decouples downstream processing using Apache Kafka.&lt;/p&gt;

&lt;p&gt;This engineering work focuses on three areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Polyglot Persistence Architecture&lt;/li&gt;
&lt;li&gt;CQRS-inspired, event-driven processing&lt;/li&gt;
&lt;li&gt;An isolated asynchronous compliance and audit pipeline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's explore the architecture and the problems these patterns are designed to address.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Polyglot Persistence: The Right Database for the Right Job
&lt;/h2&gt;

&lt;p&gt;Different types of application data have different requirements. Transactional records, dynamic product attributes, and compliance logs don't necessarily benefit from the same storage model.&lt;/p&gt;

&lt;p&gt;For ShopEase, I designed a hybrid storage architecture using three database technologies.&lt;/p&gt;

&lt;h3&gt;
  
  
  MySQL 8.4 — Core Transactional Data
&lt;/h3&gt;

&lt;p&gt;Orders, payments, and inventory require reliable transactional operations and consistency.&lt;/p&gt;

&lt;p&gt;MySQL handles these core transactional workloads, where ACID transactions are important for maintaining data integrity.&lt;/p&gt;

&lt;h3&gt;
  
  
  MongoDB — Dynamic Product Catalog
&lt;/h3&gt;

&lt;p&gt;Product catalogs can contain different attributes depending on the product category. A laptop, a T-shirt, and a smartphone don't necessarily share the same fields.&lt;/p&gt;

&lt;p&gt;MongoDB's BSON document model supports flexible, polymorphic product structures without forcing every product into an identical document shape.&lt;/p&gt;

&lt;h3&gt;
  
  
  PostgreSQL — Compliance and Audit Logs
&lt;/h3&gt;

&lt;p&gt;Audit records have different access and retention requirements from transactional application data.&lt;/p&gt;

&lt;p&gt;For this pipeline, PostgreSQL stores append-only compliance logs using JSONB, with GIN indexing to support queries over relevant JSON fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The architectural principle:&lt;/strong&gt; choose storage based on the workload, data structure, and consistency requirements—not simply because a particular database is popular.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. CQRS-Inspired Processing with Apache Kafka
&lt;/h2&gt;

&lt;p&gt;Checkout workflows can involve several downstream operations: payment processing, inventory updates, notifications, and audit events.&lt;/p&gt;

&lt;p&gt;Coupling all of these operations directly to the checkout request can increase dependencies and make failures harder to isolate.&lt;/p&gt;

&lt;p&gt;In ShopEase, I worked on an event-driven design using Apache Kafka to decouple primary checkout processing from downstream services.&lt;/p&gt;

&lt;p&gt;The high-level flow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A checkout request enters the order-processing workflow.&lt;/li&gt;
&lt;li&gt;The relevant event is published to Kafka.&lt;/li&gt;
&lt;li&gt;Downstream consumers process events for their respective responsibilities.&lt;/li&gt;
&lt;li&gt;Payment, inventory, and notification processing can proceed independently of the synchronous request path where the workflow permits.&lt;/li&gt;
&lt;li&gt;Failed event processing can be routed through retry or Dead Letter Queue (DLQ) handling.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The implementation also uses manual Kafka offset acknowledgements, allowing message acknowledgement to be coordinated with processing outcomes.&lt;/p&gt;

&lt;p&gt;This requires careful handling of retries and duplicate deliveries. Kafka delivery guarantees alone do not automatically make database updates or external payment operations idempotent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where CQRS fits
&lt;/h3&gt;

&lt;p&gt;CQRS separates command responsibilities from query responsibilities. It is not synonymous with Kafka or microservices.&lt;/p&gt;

&lt;p&gt;In ShopEase, the event-driven decoupling supports a CQRS-inspired architectural approach. The exact command/query separation depends on how individual read and write models are implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. An Isolated Asynchronous Audit Pipeline
&lt;/h2&gt;

&lt;p&gt;Audit logging can introduce additional database writes into application workflows. If those writes share critical request-processing resources, they can contribute to contention and additional latency.&lt;/p&gt;

&lt;p&gt;To address this architectural concern, I worked on an asynchronous audit ingestion pipeline using Spring's &lt;code&gt;@Async&lt;/code&gt; and dedicated secondary data sources.&lt;/p&gt;

&lt;p&gt;The intended processing flow is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application events → Audit listener → Asynchronous processing → PostgreSQL audit storage&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This separates audit-write responsibilities from the core transaction-processing path.&lt;/p&gt;

&lt;p&gt;The design aims to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce coupling between core business operations and audit persistence.&lt;/li&gt;
&lt;li&gt;Keep audit ingestion off the main request-processing thread where configured.&lt;/li&gt;
&lt;li&gt;Store structured audit data using PostgreSQL JSONB.&lt;/li&gt;
&lt;li&gt;Support JSON-field queries using appropriate GIN indexes.&lt;/li&gt;
&lt;li&gt;Improve traceability and operational separation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One important engineering consideration is reliability: asynchronous execution alone does not guarantee that every audit event will be persisted. Durable event delivery, retry policies, monitoring, and failure recovery must be considered according to the compliance requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Putting the Architecture Together
&lt;/h2&gt;

&lt;p&gt;The main components of this ShopEase backend architecture are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spring Boot:&lt;/strong&gt; application services and backend APIs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MySQL 8.4:&lt;/strong&gt; core transactional data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MongoDB:&lt;/strong&gt; flexible product catalog documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PostgreSQL:&lt;/strong&gt; compliance and audit records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apache Kafka:&lt;/strong&gt; asynchronous event-driven communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spring &lt;code&gt;@Async&lt;/code&gt;:&lt;/strong&gt; asynchronous audit processing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSONB and GIN indexes:&lt;/strong&gt; structured audit data and JSON-oriented query support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each component has a distinct responsibility, helping the architecture address different data and processing requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Key Engineering Lessons
&lt;/h2&gt;

&lt;p&gt;Working on these architectural patterns reinforced several important backend engineering principles:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database selection is a design decision.&lt;/strong&gt; Multiple databases can be useful when workloads have genuinely different requirements, but they also introduce operational complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asynchronous processing changes failure handling.&lt;/strong&gt; Retries, duplicate events, offset acknowledgement, and dead-letter handling need deliberate design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Audit logging deserves its own reliability strategy.&lt;/strong&gt; Separating audit ingestion can reduce coupling, but durability and recovery must be designed explicitly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distributed systems require observability.&lt;/strong&gt; Logs, metrics, traces, and consumer-lag monitoring help identify problems across service boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;The next step is to strengthen this architecture through integration testing, failure-injection tests, end-to-end tracing, and reproducible performance benchmarks. These help validate not just whether individual components work, but whether the complete system behaves correctly under failures and concurrent workloads.&lt;/p&gt;

&lt;h2&gt;
  
  
  About ShopEase
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ShopEase&lt;/strong&gt; is a full-stack e-commerce application developed by &lt;strong&gt;Shitanshu Jha&lt;/strong&gt;, focused on Java backend engineering, database design, secure transactions, performance optimization, and scalable application architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub repositories:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;ShopEase Backend&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;ShopEase Frontend&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building ShopEase has been a practical journey in understanding the trade-offs behind modern backend systems—and turning architectural concepts into implementation work.&lt;/p&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>kafka</category>
      <category>eventdriven</category>
    </item>
    <item>
      <title>94% Faster Reads! How I Optimized the ShopEase Backend</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sat, 17 Oct 2026 05:45:18 +0000</pubDate>
      <link>https://dev.to/shitanshu686/94-faster-reads-how-i-optimized-the-shopease-backend-jna</link>
      <guid>https://dev.to/shitanshu686/94-faster-reads-how-i-optimized-the-shopease-backend-jna</guid>
      <description>&lt;h1&gt;
  
  
  ShopEase: Optimizing Backend Performance with Redis, Hibernate &amp;amp; MySQL
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;As part of my &lt;strong&gt;ShopEase e-commerce project&lt;/strong&gt;, I worked on improving backend performance by optimizing the catalog and order data pipelines. The goal was to reduce read latency, eliminate inefficient database queries, improve connection management, and make data retrieval more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Optimizations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Redis Cache-Aside
&lt;/h3&gt;

&lt;p&gt;Implemented a Redis Cache-Aside layer for catalog and order pipelines, along with automated cache invalidation to keep cached data consistent with updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reported result:&lt;/strong&gt; Read latency reduced from &lt;strong&gt;1.88 seconds to 110 milliseconds — a 94% reduction.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Hibernate N+1 Query Optimization
&lt;/h3&gt;

&lt;p&gt;Resolved Hibernate N+1 query bottlenecks using &lt;code&gt;JOIN FETCH&lt;/code&gt;, allowing related data to be retrieved more efficiently and reducing unnecessary database round trips.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. HikariCP Connection Pool Tuning
&lt;/h3&gt;

&lt;p&gt;Optimized HikariCP connection pool settings to improve database connection management and resource utilization.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. MySQL Composite B-Tree Indexes
&lt;/h3&gt;

&lt;p&gt;Introduced composite B-Tree indexes to improve query execution efficiency and reduce unnecessary row scans.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reported result:&lt;/strong&gt; MySQL query row-scans reduced by &lt;strong&gt;95%&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technology Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Language:&lt;/strong&gt; Java&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Spring Boot, Hibernate, Spring Data JPA&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database:&lt;/strong&gt; MySQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching:&lt;/strong&gt; Redis&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Connection Pooling:&lt;/strong&gt; HikariCP&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Query Optimization:&lt;/strong&gt; JOIN FETCH and composite B-Tree indexes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;This optimization work reinforced that backend performance depends on multiple layers working together. Caching reduces repeated database reads, efficient ORM queries help avoid unnecessary round trips, connection pooling improves resource management, and indexing makes data retrieval more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Improving ShopEase was not just about adding features; it was also about making existing functionality faster and more efficient. These optimizations strengthened my practical understanding of Java backend development, database performance tuning, caching strategies, and scalable application design.&lt;/p&gt;

&lt;p&gt;Engineered a multi-tier performance optimization for catalog and order pipelines: implemented a Redis Cache-Aside layer cutting read latency by 94% (1.88s → 110ms) with automated cache invalidation, resolved Hibernate N+1 query bottlenecks via JOIN FETCH, tuned HikariCP connection pooling, and introduced composite B-Tree indexes reducing MySQL query row-scans by 95%.&lt;/p&gt;

&lt;p&gt;About ShopEase&lt;br&gt;
ShopEase is a full-stack e-commerce application built with Java, Spring Boot, MySQL, and Redis. It focuses on secure shopping, efficient data management, and high-performance backend architecture.&lt;/p&gt;

&lt;p&gt;Developed by Shitanshu Jha 💻&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; ShopEase — Full-Stack E-Commerce Application&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub — Backend:&lt;/strong&gt; &lt;a href="https://github.com/Shitanshu686/shopping-app-backend" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app-backend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub — Frontend:&lt;/strong&gt; &lt;a href="https://github.com/Shitanshu686/shopping-app" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/shopping-app&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #Redis #MySQL #Hibernate #BackendDevelopment #PerformanceOptimization #E-Commerce
&lt;/h1&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>shopease</category>
      <category>redis</category>
    </item>
    <item>
      <title>I Fixed an Idempotency Bug in My Spring Boot E-Commerce Backend</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Mon, 12 Oct 2026 07:58:30 +0000</pubDate>
      <link>https://dev.to/shitanshu686/i-fixed-an-idempotency-bug-in-my-spring-boot-e-commerce-backend-l4i</link>
      <guid>https://dev.to/shitanshu686/i-fixed-an-idempotency-bug-in-my-spring-boot-e-commerce-backend-l4i</guid>
      <description>&lt;p&gt;Sometimes, the most useful improvements to a project come from someone asking a question you had not fully considered.&lt;/p&gt;

&lt;p&gt;While working on ShopEase, my Spring Boot e-commerce backend, I implemented idempotency protection to prevent duplicate checkout requests.&lt;/p&gt;

&lt;p&gt;My initial approach returned HTTP 409 Conflict whenever an Idempotency-Key was reused.&lt;/p&gt;

&lt;p&gt;Then Andrei Ovcharenko commented on my Dev.to article with an important observation:&lt;/p&gt;

&lt;p&gt;What if the order commits successfully, but the client never receives the HTTP response?&lt;/p&gt;

&lt;p&gt;That question exposed an edge case in my implementation, so I worked on fixing it.&lt;/p&gt;

&lt;p&gt;What Was Wrong With My Original Approach?&lt;/p&gt;

&lt;p&gt;Imagine a checkout request:&lt;/p&gt;

&lt;p&gt;The customer submits an order.&lt;/p&gt;

&lt;p&gt;The backend creates the order and commits the database transaction.&lt;/p&gt;

&lt;p&gt;A network issue prevents the response from reaching the customer.&lt;/p&gt;

&lt;p&gt;The customer retries with the same idempotency key.&lt;/p&gt;

&lt;p&gt;The backend returns 409 Conflict.&lt;/p&gt;

&lt;p&gt;The duplicate order is prevented, but the customer still cannot recover the result of the successful checkout.&lt;/p&gt;

&lt;p&gt;The server knows the order succeeded. The client does not.&lt;/p&gt;

&lt;p&gt;A retry should be able to recover the original result, not just discover that the key has already been used.&lt;/p&gt;

&lt;p&gt;Why Does Multithreading Make This Harder?&lt;/p&gt;

&lt;p&gt;Concurrent requests can arrive using the same idempotency key before the first request finishes.&lt;/p&gt;

&lt;p&gt;If both threads check the key before either one claims it, they may both attempt to process the checkout.&lt;/p&gt;

&lt;p&gt;A reliable implementation needs to distinguish between a completed request and one that is still processing.&lt;/p&gt;

&lt;p&gt;Completed request with an identical payload: replay the stored result.&lt;/p&gt;

&lt;p&gt;Same key with a different payload: reject the request.&lt;/p&gt;

&lt;p&gt;Request already in progress: prevent a second execution from processing it independently.&lt;/p&gt;

&lt;p&gt;This requires atomic state management, not just an if statement checking whether a key exists.&lt;/p&gt;

&lt;p&gt;What Did I Change?&lt;/p&gt;

&lt;p&gt;I updated IdempotencyService.java and ConcurrencyController.java in ShopEase.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Completed-response replay&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a repeated key with the same payload, the backend can now return the previously completed result.&lt;/p&gt;

&lt;p&gt;The original order ID is preserved, so a retry does not create a new order merely because the first HTTP response was lost.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SHA-256 payload fingerprinting&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added SHA-256 fingerprinting to detect when the same key is reused with a different checkout payload.&lt;/p&gt;

&lt;p&gt;A mismatched payload is rejected with HTTP 422 Unprocessable Content.&lt;/p&gt;

&lt;p&gt;This prevents a key originally associated with one checkout from silently being reused for another.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An explicit replay header&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Replayed responses include:&lt;/p&gt;

&lt;p&gt;Idempotency-Replayed: true&lt;/p&gt;

&lt;p&gt;This makes it possible for the client to distinguish a replayed result from a newly executed request.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In-flight request protection&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added protection around the PROCESSING state to stop concurrent duplicate requests from independently starting the same checkout.&lt;/p&gt;

&lt;p&gt;For a multi-instance deployment, the key claim must be coordinated through shared, atomic storage. A local in-memory lock alone is not enough when requests can reach different application instances.&lt;/p&gt;

&lt;p&gt;How Should the Fix Be Tested?&lt;/p&gt;

&lt;p&gt;The most important acceptance test is:&lt;/p&gt;

&lt;p&gt;Submit a checkout request.&lt;/p&gt;

&lt;p&gt;Allow the order transaction to commit.&lt;/p&gt;

&lt;p&gt;Drop the HTTP response.&lt;/p&gt;

&lt;p&gt;Retry using the original key and identical payload.&lt;/p&gt;

&lt;p&gt;Confirm that the original order ID is returned.&lt;/p&gt;

&lt;p&gt;Confirm that only one order was created and stock was decremented only once.&lt;/p&gt;

&lt;p&gt;I would also test concurrent retries and reuse of the same key with a different payload.&lt;/p&gt;

&lt;p&gt;The key lesson is that rejecting a duplicate request does not necessarily make the overall checkout experience reliable.&lt;/p&gt;

&lt;p&gt;What Did I Learn?&lt;/p&gt;

&lt;p&gt;This improvement reminded me that real backend development involves handling failure scenarios, not only successful API calls.&lt;/p&gt;

&lt;p&gt;Idempotency needs to account for network failures, transaction commits, concurrent execution, and retries. The original request may have succeeded even when the client never received its response.&lt;/p&gt;

&lt;p&gt;I'm glad I received this feedback because it helped me identify and improve a real edge case in ShopEase.&lt;/p&gt;

&lt;p&gt;Tech stack: Java, Spring Boot, Spring Data JPA, MySQL, SQL, multithreading.&lt;/p&gt;

&lt;p&gt;What strategies have you used to handle idempotency in concurrent checkout or payment systems?&lt;/p&gt;

&lt;h1&gt;
  
  
  Java #SpringBoot #BackendDevelopment #WebDev #ShopEase #ShitanshuJha
&lt;/h1&gt;

</description>
      <category>springboot</category>
      <category>backenddevelopment</category>
      <category>webdev</category>
      <category>shopease</category>
    </item>
  </channel>
</rss>
