<?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>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>
    <item>
      <title>WalkQuest AI: Turning Screen Time into Outdoor Adventures 🌿</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sun, 11 Oct 2026 08:04:23 +0000</pubDate>
      <link>https://dev.to/shitanshu686/walkquest-ai-turning-screen-time-into-outdoor-adventures-4gom</link>
      <guid>https://dev.to/shitanshu686/walkquest-ai-turning-screen-time-into-outdoor-adventures-4gom</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Hacktoberfest Open-Source AI Challenge — Week 1: Touch Grass&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What if AI didn't try to keep you on your screen, but actually encouraged you to step away from it?&lt;/p&gt;

&lt;p&gt;That question inspired &lt;strong&gt;WalkQuest AI&lt;/strong&gt;, a small project built around a simple idea: turn a user's available time, interests, and mood into a short outdoor quest.&lt;/p&gt;
&lt;h2&gt;
  
  
  🌱 What is WalkQuest?
&lt;/h2&gt;

&lt;p&gt;WalkQuest AI helps people take small breaks from screens and reconnect with the world around them. Instead of scrolling through another feed, users can generate a simple outdoor activity plan for walking, gardening, mindfulness, nature observation, or exploration.&lt;/p&gt;

&lt;p&gt;The goal isn't to replace the outdoors with another app. It's to make the time spent using the app short, useful, and purposeful.&lt;/p&gt;
&lt;h2&gt;
  
  
  ✨ Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI-generated quests:&lt;/strong&gt; Describe what you feel like doing and how much time you have.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple activity categories:&lt;/strong&gt; Walking, gardening, mindfulness, nature, exploration, and observation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three-step quests:&lt;/strong&gt; Break an outdoor break into three manageable activities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Phone Pocket:&lt;/strong&gt; A reminder to put the phone away and focus on the real world.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quest timer and completion flow:&lt;/strong&gt; Start an outdoor session, return, and reflect on the experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Progress tracking:&lt;/strong&gt; Keep track of completed quests and related activity stats.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🧠 How I built it
&lt;/h2&gt;

&lt;p&gt;WalkQuest uses &lt;strong&gt;Gemma 3 1B through Ollama&lt;/strong&gt; for local AI inference. The application is built with Java and Spring Boot, with a browser-based frontend.&lt;/p&gt;

&lt;p&gt;The backend sends a structured prompt to the local model and processes the generated quest into a title, duration, category, difficulty, and three activities.&lt;/p&gt;

&lt;p&gt;I also worked on fallback behavior so that Hinglish requests can receive predictable, understandable activities when generated language quality is unreliable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java and Spring Boot&lt;/li&gt;
&lt;li&gt;Gemma 3 1B&lt;/li&gt;
&lt;li&gt;Ollama for local inference&lt;/li&gt;
&lt;li&gt;HTML, CSS, and JavaScript&lt;/li&gt;
&lt;li&gt;Maven&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🎬 Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Watch the WalkQuest AI demo:&lt;/strong&gt; Upload/embed the attached &lt;br&gt;
Demo Video: &lt;a href="https://youtu.be/PcGwOobycqA" rel="noopener noreferrer"&gt;https://youtu.be/PcGwOobycqA&lt;/a&gt; video here.&lt;/p&gt;

&lt;p&gt;The demo shows the quest-generation flow and the app's outdoor-session experience.&lt;/p&gt;
&lt;h2&gt;
  
  
  🌍 Why open innovation matters
&lt;/h2&gt;

&lt;p&gt;An app designed to help people spend less time on screens should not depend entirely on a remote AI service.&lt;/p&gt;

&lt;p&gt;Using an open-weight model with local inference gives developers more control over how AI is run, how prompts are designed, and how the model fits into the application. Once the model has been downloaded, inference can run locally through Ollama, without sending each generation request to a hosted model API.&lt;/p&gt;

&lt;p&gt;It also makes experimentation more accessible: developers can inspect the code, change the prompts, improve fallback behavior, and explore other compatible models instead of being locked into one closed service.&lt;/p&gt;

&lt;p&gt;Local inference does not automatically make every part of an application offline, but it gives this project a foundation for more private and flexible AI experiences.&lt;/p&gt;
&lt;h2&gt;
  
  
  🛠️ Run it locally
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/Shitanshu686/walkquest" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/walkquest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java 17 or later&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Ollama installed&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;gemma3:1b&lt;/code&gt; model downloaded&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clone the repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Shitanshu686/walkquest.git
&lt;span class="nb"&gt;cd &lt;/span&gt;walkquest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download the model and start Ollama:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma3:1b
ollama serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In another terminal, launch the application using the repository's &lt;code&gt;run-walkquest.bat&lt;/code&gt; script on Windows, or use the Maven wrapper:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./mvnw spring-boot:run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the local address and port printed by the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 What's next?
&lt;/h2&gt;

&lt;p&gt;I'd like to improve multilingual generation quality, expand the available quest types, and make outdoor progress tracking more useful without adding unnecessary screen time.&lt;/p&gt;

&lt;p&gt;WalkQuest is an experiment in building AI that helps people do something beyond interacting with AI itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build with open AI. Step outside. Touch grass. 🌿&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prize categories:&lt;/strong&gt; Best Use of Gemma&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; #devchallenge #hf26challenge #opensource #ai #java&lt;/p&gt;

&lt;h2&gt;
  
  
  🎬 WalkQuest AI — Live Demo
&lt;/h2&gt;

&lt;p&gt;Watch the demo to see WalkQuest AI in action, including outdoor quest generation and the screen-free activity flow.&lt;br&gt;
Demo Video: &lt;a href="https://youtu.be/PcGwOobycqA" rel="noopener noreferrer"&gt;https://youtu.be/PcGwOobycqA&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;▶️ &lt;strong&gt;&lt;a href="![%20](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/u4795fhipe1rzgmroiut.png)"&gt;Watch WalkQuest AI Demo on YouTube&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The demo showcases how WalkQuest turns a simple request into an outdoor activity experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code:&lt;/strong&gt; &lt;a href="https://github.com/Shitanshu686/walkquest" rel="noopener noreferrer"&gt;https://github.com/Shitanshu686/walkquest&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>Handling Concurrent Requests and Duplicate Checkouts in Spring Boot</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Sat, 10 Oct 2026 05:52:34 +0000</pubDate>
      <link>https://dev.to/shitanshu686/handling-concurrent-requests-and-duplicate-checkouts-in-spring-boot-386e</link>
      <guid>https://dev.to/shitanshu686/handling-concurrent-requests-and-duplicate-checkouts-in-spring-boot-386e</guid>
      <description>&lt;p&gt;&lt;strong&gt;While building ShopEase, my e-commerce backend project, I reached a stage where implementing CRUD endpoints was no longer enough.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I needed to think about what happens when multiple customers try to update the same inventory or submit the same checkout request simultaneously.&lt;/p&gt;

&lt;p&gt;That led me to work on a new backend milestone focused on high-concurrency handling and idempotency protection.&lt;/p&gt;

&lt;p&gt;Here are the key implementations and what I learned from them.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Atomic SQL Updates for Inventory&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Consider a product with five units in stock. Multiple purchase requests may arrive at almost the same time.&lt;/p&gt;

&lt;p&gt;Reading the stock in Java, subtracting a quantity, and saving the entity can introduce race conditions if competing requests read the same initial value.&lt;/p&gt;

&lt;p&gt;I added a conditional atomic SQL update:&lt;/p&gt;

&lt;p&gt;UPDATE products&lt;br&gt;
SET stock = stock - :qty&lt;br&gt;
WHERE id = :id&lt;br&gt;
  AND stock &amp;gt;= :qty;&lt;/p&gt;

&lt;p&gt;The database performs the stock check and deduction as one statement.&lt;/p&gt;

&lt;p&gt;The affected-row count indicates whether the update succeeded, allowing the application to handle insufficient stock.&lt;/p&gt;

&lt;p&gt;This approach reduces unnecessary application-side read-modify-write operations. It does not mean the database performs the operation without any internal locking.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Pessimistic vs. Optimistic Locking&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I worked with both locking strategies in DatabaseConcurrencyService.&lt;/p&gt;

&lt;p&gt;Pessimistic locking&lt;/p&gt;

&lt;p&gt;Pessimistic locking requests a write lock on a database record while the transaction performs its work.&lt;/p&gt;

&lt;p&gt;With JPA, this can be implemented using LockModeType.PESSIMISTIC_WRITE.&lt;/p&gt;

&lt;p&gt;It is useful when conflicting updates are likely, although excessive lock contention can reduce throughput.&lt;/p&gt;

&lt;p&gt;Optimistic locking&lt;/p&gt;

&lt;p&gt;Optimistic locking detects conflicting changes rather than preventing every competing transaction from proceeding.&lt;/p&gt;

&lt;p&gt;I added a JPA version field:&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/version"&gt;@version&lt;/a&gt;&lt;br&gt;
private Long version;&lt;/p&gt;

&lt;p&gt;Hibernate uses the version to detect stale updates. A conflicting update can fail and require the application to handle or retry the operation.&lt;/p&gt;

&lt;p&gt;My takeaway: Both strategies are useful, but they address concurrency differently. The choice depends on the workload and conflict rate.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spring Transaction Proxies and Executor Threads&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One important detail I worked on was self-proxy injection.&lt;/p&gt;

&lt;p&gt;Spring typically applies @Transactional behavior through a proxy. A direct call such as this.someTransactionalMethod() can bypass the proxy and therefore bypass the expected transaction interception.&lt;/p&gt;

&lt;p&gt;Calling the method through the injected Spring proxy allows the transaction interceptor to run.&lt;/p&gt;

&lt;p&gt;There is another important detail: an executor thread does not automatically inherit the caller's transaction. A transactional method invoked through the proxy needs to establish its own transaction as required.&lt;/p&gt;

&lt;p&gt;This was a useful reminder that asynchronous execution and transaction boundaries must be considered together.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Idempotency Protection for Checkout&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Checkout requests can be repeated because of network issues, client retries, or accidental double-clicks.&lt;/p&gt;

&lt;p&gt;I implemented IdempotencyKey validation to detect duplicate checkout requests and return 409 Conflict for duplicates.&lt;/p&gt;

&lt;p&gt;The basic flow is:&lt;/p&gt;

&lt;p&gt;Receive a checkout request with an idempotency key.&lt;/p&gt;

&lt;p&gt;Validate whether the key has already been used.&lt;/p&gt;

&lt;p&gt;Process a new request.&lt;/p&gt;

&lt;p&gt;Reject a duplicate request.&lt;/p&gt;

&lt;p&gt;For reliable production behavior, checking and recording the key must be atomic. A database uniqueness constraint is one common way to enforce this. The design also needs clear rules for retries, failed requests, and payment side effects.&lt;/p&gt;

&lt;p&gt;The goal is to avoid processing the same logical checkout operation more than once.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JPA Versioning and Application Configuration&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I added the version column required for optimistic locking and resolved a Spring bean collision.&lt;/p&gt;

&lt;p&gt;These changes help detect stale database updates and allow the application context to initialize with the intended bean configuration.&lt;/p&gt;

&lt;p&gt;Key Takeaways&lt;/p&gt;

&lt;p&gt;This milestone helped me understand that reliable backend development involves more than writing endpoints.&lt;/p&gt;

&lt;p&gt;Use atomic database operations for conditional inventory updates.&lt;/p&gt;

&lt;p&gt;Choose pessimistic or optimistic locking according to the workload.&lt;/p&gt;

&lt;p&gt;Understand how Spring proxies affect transaction management.&lt;/p&gt;

&lt;p&gt;Design executor-thread work with explicit transaction boundaries.&lt;/p&gt;

&lt;p&gt;Protect checkout side effects against duplicate requests.&lt;/p&gt;

&lt;p&gt;Use JPA versioning to detect conflicting updates.&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;Working on ShopEase is helping me connect Java, Spring Boot, database concurrency, and real e-commerce requirements.&lt;/p&gt;

&lt;p&gt;This milestone is a step toward making inventory management and checkout processing more reliable under concurrent load.&lt;/p&gt;

&lt;p&gt;I'm continuing to build and improve ShopEase one backend milestone at a time.&lt;/p&gt;

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

&lt;h1&gt;
  
  
  Java #SpringBoot #BackendDevelopment #MySQL
&lt;/h1&gt;

</description>
      <category>backend</category>
      <category>multithreading</category>
      <category>java</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>ShopEase — Module 32: Solving Inventory Overselling with Concurrency Control</title>
      <dc:creator>Shitanshu Jha</dc:creator>
      <pubDate>Mon, 05 Oct 2026 04:21:33 +0000</pubDate>
      <link>https://dev.to/shitanshu686/shopease-module-32-solving-inventory-overselling-with-concurrency-control-f4k</link>
      <guid>https://dev.to/shitanshu686/shopease-module-32-solving-inventory-overselling-with-concurrency-control-f4k</guid>
      <description>&lt;p&gt;In an e-commerce application, multiple users can try to purchase the same product at exactly the same time.&lt;br&gt;
This creates a common backend problem: Race Conditions.&lt;br&gt;
The Problem&lt;br&gt;
Suppose a product has only 10 items in stock.&lt;br&gt;
Now imagine 50 users place an order simultaneously.&lt;br&gt;
Without proper concurrency handling, multiple threads may read the same stock value before any of them updates it:&lt;br&gt;
Stock = 10&lt;br&gt;
→ Thread 1 reads 10&lt;br&gt;
→ Thread 2 reads 10&lt;br&gt;
→ Thread 3 reads 10&lt;br&gt;
→ ...&lt;br&gt;
→ Multiple threads try to purchase&lt;br&gt;
The result can be incorrect stock updates and overselling, where the system accepts more orders than the available inventory.&lt;br&gt;
This is a serious problem for an e-commerce backend.&lt;br&gt;
The Solution&lt;br&gt;
In ShopEase, I implemented Concurrency, Multithreading &amp;amp; Database Locking to handle these situations safely.&lt;br&gt;
The inventory update process now uses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multithreading for concurrent request testing&lt;/li&gt;
&lt;li&gt;Optimistic Locking using &lt;a class="mentioned-user" href="https://dev.to/version"&gt;@version&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pessimistic Locking using &lt;a class="mentioned-user" href="https://dev.to/lock"&gt;@lock&lt;/a&gt;(LockModeType.PESSIMISTIC_WRITE)&lt;/li&gt;
&lt;li&gt;Database row locking with FOR UPDATE&lt;/li&gt;
&lt;li&gt;Atomic stock deduction&lt;/li&gt;
&lt;li&gt;Proper transaction handling
With pessimistic locking, when one transaction is updating a product's stock, other transactions have to wait instead of modifying the same row simultaneously.
50-Thread Stress Testing
To verify the implementation, I performed concurrent testing with 50 threads trying to purchase the same product.
The test focused on:
50 concurrent requests → Stock validation → Locking → Atomic deduction → Order result
The important result was:
No negative stock.
No overselling.
Concurrent requests handled safely.
What This Module Solved
The main problem solved in this module was protecting inventory from race conditions during simultaneous purchases.
This makes the ShopEase backend more reliable when multiple users interact with the same product at the same time.
Key Takeaway
Concurrency isn't just about running multiple threads. In a real e-commerce system, it is about making sure that multiple operations happening simultaneously still produce a correct and consistent result.
Tech Stack: Java • Spring Boot • Spring Data JPA • Hibernate • MariaDB • Multithreading • Optimistic Locking • Pessimistic Locking
#Java #SpringBoot #Concurrency #Multithreading #DatabaseLocking #Hibernate #MariaDB #BackendDevelopment #ShopEase&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>springboot</category>
      <category>concurrency</category>
      <category>multithreading</category>
    </item>
  </channel>
</rss>
