<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Engineering on Tech Blog</title>
    <link>https://yashsachdeva.com/categories/engineering/</link>
    <description>Recent content in Engineering on Tech Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© 2026 Yash Sachdeva</copyright>
    <lastBuildDate>Sat, 11 Apr 2026 10:56:08 +0530</lastBuildDate><atom:link href="https://yashsachdeva.com/categories/engineering/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Order Management System</title>
      <link>https://yashsachdeva.com/posts/order-management-system/</link>
      <pubDate>Sat, 11 Apr 2026 10:56:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/order-management-system/</guid>
      <description>&lt;p&gt;As part of this post, we&amp;rsquo;ll be covering the design of a modern, production-grade Order Management System (OMS) with a focus on multi-fulfillment, cancellations, refunds, inventory synchronization, and multi-region deployment.&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s first start with the requirements.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Requirements&#xA;    &lt;div id=&#34;requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Functional Requirements&#xA;    &lt;div id=&#34;functional-requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#functional-requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Core order lifecycle&lt;/strong&gt;: Create order with multiple line items, shipping options, and payment methods.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Order state machine&lt;/strong&gt;: Support states such as PENDING → CONFIRMED → PARTIALLY_FULFILLED → FULFILLED → CANCELLED → REFUNDED.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Split shipments&lt;/strong&gt;: Support split shipments and partial fulfillment when items originate from multiple locations or arrive at different times.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cancellations&lt;/strong&gt;: Allow customer and system-initiated cancellations in various states (pre-fulfillment, mid-fulfillment) with clear rules.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Refunds&lt;/strong&gt;: Support refunds (full and partial), including multi-payment or mixed-method scenarios (card, wallet, store credit).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multi-fulfillment&lt;/strong&gt;: Route each line item to an optimal fulfillment node (warehouse, store, 3PL, marketplace drop-shipper).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multiple shipments&lt;/strong&gt;: Track multiple shipments per order with independent tracking IDs and statuses.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Backorders and preorders&lt;/strong&gt;: Support delayed fulfillment while the order remains active.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Inventory and payments&lt;/strong&gt;: Reserve inventory atomically as part of the order creation saga; release on failure or cancellation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Inventory sync&lt;/strong&gt;: Prevent overselling across channels with near real-time inventory sync and event-driven updates.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Payment gateways&lt;/strong&gt;: Integrate with one or more payment gateways for authorization, capture, and refund.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multi-channel and integrations&lt;/strong&gt;: Receive orders from internal checkout, marketplaces, and POS; normalize into a canonical order model.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Fulfillment updates&lt;/strong&gt;: Push fulfillment updates and cancellations back to channels and customer notification systems.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multi-region deployment&lt;/strong&gt;: Deploy OMS in multiple regions, each with a full stack of services fronted by a global load balancer.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data synchronization&lt;/strong&gt;: Keep critical data (orders, payments, inventory) synchronized across regions using a mix of strong and eventual consistency depending on domain constraints.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Non-Functional Requirements&#xA;    &lt;div id=&#34;non-functional-requirements&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#non-functional-requirements&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;High Availability and resilience&lt;/strong&gt;: One failure in a downstream flow should not take down the entire order flow.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Capable of handling peak events such as flash sales and promotions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Clear consistency model for orders and inventory (strong vs eventual consistency).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Observability&lt;/strong&gt;: Comprehensive logging, monitoring, and tracing.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Extensibility&lt;/strong&gt;: Easy to add new fulfillment types, payment methods, or regions without major rewrites.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;High Level Design&#xA;    &lt;div id=&#34;high-level-design&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#high-level-design&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;img src=&#34;oms_component_diagram.png&#34; alt=&#34;OMS Component Diagram&#34; max-width=&#34;100%&#34; height=&#34;auto&#34;/&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Order Lifecycle and Domain Model&#xA;    &lt;div id=&#34;order-lifecycle-and-domain-model&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#order-lifecycle-and-domain-model&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&#xA;&lt;h4 class=&#34;relative group&#34;&gt;Order Lifecycle Stages&#xA;    &lt;div id=&#34;order-lifecycle-stages&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#order-lifecycle-stages&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h4&gt;&#xA;&lt;p&gt;A typical e-commerce order lifecycle contains the following high-level stages:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Mobile Wallet Payment System</title>
      <link>https://yashsachdeva.com/posts/mobile-wallet-payment-system/</link>
      <pubDate>Thu, 09 Apr 2026 19:39:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/mobile-wallet-payment-system/</guid>
      <description>&lt;p&gt;As part of this post, we&amp;rsquo;ll be covering the design of a mobile wallet payment system that supports -&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Top-ups (add money to wallet from bank/card)&lt;/li&gt;&#xA;&lt;li&gt;P2P transfers (wallet -&amp;gt; wallet)&lt;/li&gt;&#xA;&lt;li&gt;Basic fraud detection&lt;/li&gt;&#xA;&lt;li&gt;Concurrency with clear trade-offs between strong and eventual consistency at scale.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s start with a basic design and then we can scale it up.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Mastering Concurrency In Java - Part 4: Deep Dives and Modern Patterns</title>
      <link>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-4-deep-dives-and-modern-patterns/</link>
      <pubDate>Wed, 08 Apr 2026 20:04:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-4-deep-dives-and-modern-patterns/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-1/&#34; &gt;Part 1&lt;/a&gt;, &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-2/&#34; &gt;Part 2&lt;/a&gt;, and &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-3/&#34; &gt;Part 3&lt;/a&gt;, we covered hazards, primitives, and execution models. In this final part, we will focus on structured concurrency, fan-out/fan-in, fail-fast cancellations, timeout propagation, resource scoping, and observability with thread dumps and Java Flight Recorder (JFR), emphasizing when to choose which pattern.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Mastering Concurrency In Java - Part 3: Execution Models</title>
      <link>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-3-execution-models/</link>
      <pubDate>Tue, 07 Apr 2026 20:04:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-3-execution-models/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-1/&#34; &gt;Part 1&lt;/a&gt; and &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-2/&#34; &gt;Part 2&lt;/a&gt;, we covered the fundamentals and building blocks of concurrency. In this part, we will discuss the execution models of concurrency - classic thread pools, task queues, Future/Callable, CompletableFuture, and, from Java 21+, virtual threads and virtual-thread-per-task executors. Choosing among them is ultimately about latency, throughput, and operational simplicity, not about syntax.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Mastering Concurrency In Java - Part 2: The Fundamentals</title>
      <link>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-2-the-fundamentals/</link>
      <pubDate>Mon, 06 Apr 2026 20:04:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-2-the-fundamentals/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;https://yashsachdeva.com/posts/2026/04/concurrency-part-1/&#34; &gt;Part 1&lt;/a&gt;, we discussed the core concurrency hazards and control concepts in Java: race conditions, visibility, atomicity, deadlocks, starvation, livelock, contention, backpressure, interruption, and cancellation.&lt;/p&gt;&#xA;&lt;p&gt;In this part, we will discuss the coordination primitives - synchronized, volatile, Atomics, Locks, Semaphores, Blocking Queues, and Concurrent Collections.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Mastering Concurrency In Java - Part 1: The Fundamentals</title>
      <link>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-1-the-fundamentals/</link>
      <pubDate>Sun, 05 Apr 2026 11:26:08 +0530</pubDate>
      
      <guid>https://yashsachdeva.com/posts/mastering-concurrency-in-java-part-1-the-fundamentals/</guid>
      <description>&lt;h2 class=&#34;relative group&#34;&gt;Introduction&#xA;    &lt;div id=&#34;introduction&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#introduction&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Here, we will discuss the core concurrency hazards and control concepts in Java: race conditions, visibility, atomicity, deadlocks, starvation, livelock, contention, backpressure, interruption, and cancellation.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Race Conditions&#xA;    &lt;div id=&#34;race-conditions&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#race-conditions&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;A race condition occurs when the correctness of a task depends on the relative timing or interleaving of threads accessing shared mutable state. The bug is not “thread A ran before B”, it is “if they interleave in this specific way, invariants break.”&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
