Software Design Patterns

Explore top LinkedIn content from expert professionals.

  • View profile for Vitaly Friedman
    Vitaly Friedman Vitaly Friedman is an Influencer

    Practical insights for better UX • Running “Measure UX” and “Design Patterns For AI” • Founder of SmashingMag • Speaker • Loves writing, checklists and running workshops on UX. 🍣

    232,087 followers

    🎢 Onboarding UX Playbook (+ Decision Trees). Practical techniques for better onboarding UX, design patterns, kits and Figma templates — on mobile and desktop. 🚫 Users often skip tutorials/walkthroughs entirely. 🚫 Never block the UI with full-page onboarding modals. 🚫 Avoid long multi-step tutorials with 5+ steps. ✅ Ask customers what goals they are trying to achieve. ✅ Allow users to hide walkthroughs and restore them later. ✅ Focus on bringing users to first success moments fast. ✅ Structure your onboarding suggestions in bite-sized chunks. ✅ Explain features when users slow down or make mistakes. ✅ Show features when users lose time with repetitive tasks. ✅ Prevent failure with an early warning system for new users. ✅ Collapsible checklists work well for onboarding. ✅ Personalized onboarding works even better. ✅ Design sets of filters, templates and empty states. ✅ Show starter kits based on user’s profile and interests. ✅ Consider short video guides and email drip campaigns. Good onboarding can’t be generic. It has to be relevant and valuable. Define your user segments first. Design a set of presets to help them get to success moments faster. Think of the questions you need to ask to customize their experience. Think about filters and presets they might need. Onboarding tutorials often appear once and get instantly dismissed, nowhere to be found again. Allow users to find them when they need it. Bring them up when users slow down or make mistakes. And test the discoverability of your features continuously. If a feature is obvious, you might not need to explain it at all. And if it isn’t, perhaps onboarding won’t solve this problem either. Useful resources: How to Choose Onboarding Methods and Components, by NewsKit 👍 Methods: https://lnkd.in/eWn5FPWA Decision Tree: https://lnkd.in/e8TmMDFf Design Patterns: https://lnkd.in/ed7HjzkW Onboarding UX Playbook, by Eleana Gkogka https://lnkd.in/edcDfMFG Complete Onboarding UX Guide (free eBook), by Intercom https://lnkd.in/eAxT6ZM4 User Onboarding Best Practices, by Taras Bakusevych https://lnkd.in/eRwr2tEc Guide to Onboarding, by Phil Byrne https://lnkd.in/esEavgw7 How Spotify Organizes Onboarding in Figma, by Barton Smith, Cliona O'Sullivan https://lnkd.in/ei434tqq Mobile Onboarding Wireframe Flows (Figma template) https://lnkd.in/ekhzWFJz UX Onboarding Patterns, by Eve Weinberg https://lnkd.in/e7_M4kDv #ux #design

  • View profile for Onkar Ojha
    Onkar Ojha Onkar Ojha is an Influencer

    Software Engineer @ Amazon | Distributed Systems | Backend Engineering | Java | Golang | Microservices | AWS

    14,741 followers

    🧩 Distributed Transactions in Microservices – The Hidden Nightmare Let’s say you're building an e-commerce platform. You’ve broken down your monolith into decoupled microservices: 🛒 Order Service (PostgreSQL) 📦 Inventory Service (MongoDB) 💰 Payment Service (MySQL) 🚚 Shipping Service (Cassandra) Each service manages its own database. Life is good... until it’s not. 😱 The Problem A user places an order. Here's what needs to happen: Order is created ✅ Inventory is reserved ✅ Payment is deducted ✅ Shipping is scheduled ❌ Suddenly, the Shipping Service fails maybe due to a timeout, a network error, or an unavailable carrier. Now what? You’ve already deducted payment and reserved inventory. There’s no easy way to rollback across multiple databases and services. Distributed transactions are not natively supported across microservices. Using 2-phase commits? Forget it's slow, complex, and breaks under scale. 🔄 Enter the SAGA Pattern SAGA solves this by breaking the transaction into a sequence of local transactions – each with a compensating action in case something fails. Let’s walk through the same scenario with SAGA: 🛒 Order Service creates the order → emits OrderCreated event 📦 Inventory Service reserves items → emits InventoryReserved or rolls back via ReleaseInventory 💰 Payment Service deducts amount → emits PaymentSuccessful or compensates via RefundPayment 🚚 Shipping Service fails to schedule → emits ShippingFailed → triggers compensating actions: •RefundPayment •ReleaseInventory •CancelOrder Each service maintains local state and knows how to undo its step if needed. 💡 Two Approaches: Choreography – Services listen to and act on domain events. Orchestration – A central orchestrator coordinates the flow. 🧱 SAGA DB Design Behind the Scenes In an orchestration-based saga: saga_instance → tracks the entire flow saga_step_log → logs each step’s status (SUCCESS / FAILED / COMPENSATED) Each microservice stores its part of the transaction locally (idempotency + recovery) ✅ Key Benefits No need for distributed transactions Works with independent databases Allows graceful rollback with compensation Keeps systems event-driven and loosely coupled

  • View profile for Tomer Aharon

    Co-Founder & CEO @ Poptin, Chatway, Premio & Prospero

    6,255 followers

    A few years ago, we spotted something interesting on monday.com’s signup page: A blurred version of their dashboard is in the background of the signup form. It looked great - but did it work? We A/B tested it in a couple of our products. No major impact (for us - though it might work differently for you). Fast forward to a few months ago: We decided to try it again - this time in Poptin’s onboarding flow as part of our new UI. 👉 We added a blurred version of the user dashboard behind each onboarding screen. 👉 We removed one of the questions (Less friction, even though it was pre-filled) 👉 We removed the progress bar (We might a/b test more versions with it later) 👉 We tracked the entire flow in the database, both before and after the change. 👉 We tested each version with approximately 10K signups. The result? It blew us away: 🔵 Before (solid color background): 35% of signups completed onboarding 🟢 After (blurred dashboard background): 51% completed onboarding That’s a 45% increase 🚀 💡 Pro tip: As users progress through onboarding, gradually reduce the blur or dark overlay to signal they’re getting closer to the finish line. (For context: popup creation rate and plan purchase rate stayed about the same - but total numbers were significantly higher due to better onboarding completion.) Sometimes, the smallest UX tweaks make the biggest difference. ____________ Gal and I started to post SaaS growth hacks & strategies on a weekly basis. You'll be able to check them out by clicking on #TomerAndGal #ux #onboarding #cro #poptin #signup

  • View profile for Aman Sahni

    Java Full Stack Engineer | Building HungryCoders.com | 10+ Years of Experience

    47,182 followers

    If your payment succeeded but order creation failed, and you can't rollback across microservices - you need SAGA pattern. Imagine an e-commerce order flow across 3 services: -> Payment Service charges $100 -> Inventory Service reserves items -> Order Service creates order record Without SAGA: -> Payment succeeds -> Inventory fails (out of stock) -> Payment can't be rolled back (different DB) -> Customer charged but no order -> Manual refunds SAGA Pattern solves distributed transaction failures, below are the two SAGA Implementation Patterns: a) Orchestration -> Central coordinator manages the flow -> Easier to understand and debug -> Single point of failure -> Use when workflow is complex with many steps b) Choreography -> Services react to events using Kafka or RabbitMQ -> No central coordinator -> Better decoupling but harder to track -> Use when simple workflows in event-driven architecture Key SAGA Principles: a) Compensating Transactions: Every action must have an undo operation b) Idempotency: Same saga can be retried safely c) State Management: Track saga progress in database d) Eventual Consistency: Not ACID transactions Your distributed transactions need orchestration. #springboot #backend #hungrycoders

  • View profile for Kolle Anil Kumar

    Full Stack Java Developer | Spring Boot · Microservices · Kafka · AWS · Angular | 5.7 YOE Building Scalable, Event Driven Systems | SDE @Infor | Open to Java & Angular Role

    4,985 followers

    🔥 @Transactional vs SAGA Pattern — When & Why to Use Them? 🔥 In distributed systems, data consistency is critical — but the approach depends on architecture. 1️⃣ @Transactional (Local ACID Transactions) ✅ What it is @Transactional manages database transactions within a single service / database. @Transactional public void placeOrder() { orderRepository.save(order); paymentRepository.save(payment); } ✔ ACID compliant ✔ Automatic rollback on failure ✔ Simple & reliable. 🕒 How it works (Real Time) 1. Transaction starts 2. All DB operations execute 3. If any exception occurs → rollback 4. If successful → commit. 📌 Where to Use @Transactional ✅ Monolithic applications ✅ Single microservice ✅ One database ✅ Strong consistency required. ❌ Where NOT to Use ❌ Multiple microservices ❌ Multiple databases ❌ Distributed systems. 🧠 Interview Tip @Transactional does NOT work across services. 2️⃣ SAGA Pattern (Distributed Transactions) ✅ What it is SAGA handles business transactions across multiple microservices using event-driven steps. Each step has a compensating action. 🧩 Example (Order Flow) Order Service → Payment Service → Inventory Service. Each service has its own database. 🕒 How SAGA Works (Real Time). Step 1: Order Service ✔ Create order → ORDER_CREATED Step 2: Payment Service ✔ Payment success → PAYMENT_SUCCESS ❌ Payment failed → PAYMENT_FAILED Step 3: Inventory Service ✔ Reserve stock → STOCK_RESERVED ❌ Failure → trigger compensation. 🔁 Compensation Example Inventory Failed → Payment Refund → Order Cancel 🧠 No rollback — only business compensation. 📌 Where to Use SAGA ✅ Microservices architecture ✅ Multiple databases ✅ Event-driven systems ✅ Eventual consistency acceptable. 4️⃣ Real-World Usage 🏦 Banking (Monolith) ✔ Fund transfer inside one service → @Transactional 🛒 E-Commerce (Microservices) ✔ Order + Payment + Inventory → SAGA Pattern #SpringBoot #Microservices #SystemDesign #Java #BackendDevelopment #EnterpriseArchitecture #SpringData #SpringJPA #transactional #saga

  • View profile for Raja Anand

    Lead Java Engineer · Spring Boot & Microservices · Building Scalable Backend Systems at HCL Technologies

    17,814 followers

    🚀 Understanding the hashtag #SAGAPATTERN in Microservices Managing transactions across multiple microservices is not easy. What happens if one service succeeds and another fails midway? That’s where the Saga Pattern helps. ✅ A Saga is a sequence of local transactions where: ➡️ each service completes its own transaction ➡️ and if a failure occurs, previously completed steps are compensated (rolled back) in reverse order. 📌 Example: Order Service → Payment Service → Inventory Service → Shipping Service If Shipping fails: 🔁 Release Inventory 🔁 Refund Payment 🔁 Cancel Order This provides: ✔ Data consistency across services ✔ Structured rollback ✔ Better resiliency in distributed systems ✔ An alternative to distributed transactions 💡 Key Insight: - Use Choreography for loosely coupled event-driven systems - Use Orchestration for complex workflows needing centralized control Which approach have you used in your projects — Choreography or Orchestration? 👇 #Microservices #Java #SpringBoot #DistributedSystems #SoftwareArchitecture #BackendDevelopment #SagaPattern #EventDrivenArchitecture #LetsLearnTogether #SimplifiedLearning

  • View profile for Julio Casal

    .NET • Azure • Agentic AI • Platform Engineering • DevOps • Ex-Microsoft

    76,362 followers

    Order saved. Payment failed. No alert. That's distributed partial failure. And it's silent. In a monolith, you wrap everything in one transaction. It commits or rolls back. The database handles the rest. Add a second service with its own database and that guarantee disappears. ACID only holds within one database. Cross-service consistency is your problem to solve. Here's how to solve it: 𝗧𝗵𝗲 𝗖𝗼𝗻𝘀𝘁𝗿𝗮𝗶𝗻𝘁 Each service owns its database. One service, one database, one transaction. The moment Order Service commits and Payment Service fails, you have partial completion with no automatic rollback and no exception thrown. 𝗪𝗵𝘆 𝗧𝘄𝗼-𝗣𝗵𝗮𝘀𝗲 𝗖𝗼𝗺𝗺𝗶𝘁 𝗙𝗮𝗶𝗹𝘀 2PC coordinates a prepare and commit phase across all participants. In practice it adds tight coupling, blocks every resource until all participants vote, and collapses when any node is slow or unavailable. Cloud-native systems running mixed databases, message brokers, and third-party APIs can't use it cleanly. ❌ Don't add 2PC hoping a distributed system will behave like a monolith. 𝗧𝗵𝗲 𝗢𝘂𝘁𝗯𝗼𝘅 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 Write your business data and an outbox event in the same local transaction. A background relay reads the outbox table and publishes to the broker. If the broker is down, the relay retries. If the relay crashes, it picks up where it stopped. → Single DB transaction: order row + outbox row, atomic → Relay polls for unsent records, publishes, marks as sent on confirmation → Eliminates the "database updated but event lost" problem → Consumers must be idempotent — delivery is at-least-once ❌ Don't write to the DB and publish to the broker as two separate steps. One will fail eventually. 𝗧𝗵𝗲 𝗦𝗮𝗴𝗮 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 A saga breaks a cross-service workflow into a sequence of local transactions. Each step commits locally and emits an event or command to trigger the next. If a later step fails, compensating actions undo the earlier work. → Order Created → Payment Reserved → Inventory Reserved → Confirmation Sent → Inventory fails: trigger Refund Payment, then Cancel Order → Compensation is business logic, not a database rollback → Orchestrated via a coordinator, or choreographed through events ❌ Don't build a saga without mapping every failure path. Stuck partial states with no recovery path are worse than the original problem. 𝗘𝘃𝗲𝗻𝘁𝘂𝗮𝗹 𝗖𝗼𝗻𝘀𝗶𝘀𝘁𝗲𝗻𝗰𝘆 Services will temporarily disagree while messages are in flight. Design for it. → Show users a "pending" or "processing" state while the system converges → Build retries, deduplication, and idempotent consumers from day one → Use explicit status models: pending, processing, failed, compensated, completed → Monitor event queue depth and processing lag, not just uptime Design for converging state, not instant state. Get my free .NET Backend Blueprint 👇 https://lnkd.in/gnQhKDDC

  • View profile for Amritanjali .

    Microsoft

    347,865 followers

    A lot of people get confused when they first hear the term Saga Pattern because it sounds much more complicated than it actually is. But the idea is pretty simple once you relate it to a real-life situation. Imagine you are ordering food online. When you place an order, multiple things happen one after another: -> Your order gets created -> Payment gets deducted -> Restaurant confirms the food -> Delivery partner gets assigned Now think 🤔 about this: What if the payment succeeds, but the restaurant suddenly says the item is unavailable? The system cannot just leave things half completed. It has to undo the previous step by refunding your money. That is exactly where the Saga Pattern comes in. Instead of treating the entire process as one giant transaction, the Saga Pattern breaks it into multiple small transactions. Each service does its own work independently. For example: Order Service → creates the order Payment Service → deducts payment Inventory Service → reserves stock If every step succeeds, the workflow completes successfully. But if any step fails, the system performs something called a compensating transaction. Example: Payment deducted → refund payment Stock reserved → release stock Order created → cancel order This approach is heavily used in modern microservices architectures because, in distributed systems, maintaining one single database transaction across all services is difficult and inefficient. There are mainly two ways to implement Saga Pattern: 1. Choreography Services communicate using events. Each service listens and reacts automatically. Example: Order Created Event Payment Service listens and processes payment Inventory Service listens and reserves stock 2. Orchestration A central controller manages the entire flow and tells each service what to do next. Both approaches are used in real-world systems depending on complexity and scalability needs. The biggest advantage of Saga Pattern is that it helps maintain consistency in distributed systems without locking everything into one massive transaction. So in simple words: Saga Pattern = A way to manage distributed transactions step-by-step with rollback support if something fails. Once you understand the “online order + refund” example, the whole concept becomes much easier to visualize.

  • View profile for Elleuch Mohamed Yessin

    Software Engineer 🚀 | Back-End Developer 🧑💻 | java | Spring boot | Angular

    27,349 followers

    Saga Pattern Topic: Saga — Manage Distributed Transactions Without 2PC (Java + Spring Boot) Peak traffic. 10,000 orders per minute.Then the inventory service went down for 4 minutes. When it came back — we had a crisis. 😰 4,000 orders were in a state nobody could explain. Order Service said: CONFIRMED Payment Service said: CHARGED Inventory Service said: UNKNOWN 4,000 customers charged. No stock reserved. No way to know which ones.The support team was flooded. Refunds took 3 days to process manually.The root cause was painfully simple.We had no distributed transaction strategy. Our order flow was: 1. Save order → DB ✅ 2. Charge payment → Stripe ✅ 3. Reserve inventory → crashes ❌ Steps 1 and 2 completed. Step 3 never did. And we had no way to roll back steps 1 and 2. There's no BEGIN TRANSACTION across 3 microservices on 3 different databases. That's the fundamental problem of distributed systems. The fix was the Saga Pattern. Instead of trying to make 3 services atomic — we make each step reversible. Step 1: Create order ✅ Step 2: Charge payment ✅ Step 3: Reserve inventory ❌ (out of stock) → Compensate Step 2: Refund payment → Compensate Step 1: Cancel order → User sees: "Out of stock — you haven't been charged" java // Payment service reacts to OrderCreated @KafkaListener(topics = "order.created") public void onOrderCreated(OrderCreatedEvent event, Acknowledgment ack) { try { Payment p = paymentService.charge(event.getUserId(), event.getAmount()); kafka.send("payment.completed", new PaymentCompletedEvent(p)); } catch (PaymentFailedException ex) { // Compensation — tell Order Service to cancel kafka.send("order.cancel", new OrderCancelEvent(event.getOrderId(), ex.getMessage())); } ack.acknowledge(); } // When inventory fails — refund and cancel @KafkaListener(topics = "payment.refund") public void refundPayment(PaymentRefundEvent event, Acknowledgment ack) { paymentService.refund(event.getPaymentId(), event.getAmount()); // ← compensation kafka.send("order.cancel", new OrderCancelEvent(event.getOrderId())); ack.acknowledge(); } Two types of Saga — pick based on complexity 👇 🟣 Choreography — services react to each other's events. No coordinator. Loose coupling. Good for 2-3 steps. 🟠 Orchestration — a central Saga Orchestrator tells each service what to do. Easy to visualise. Good for complex flows. The two rules I follow without exception: 🔵 Compensations MUST be idempotent. If a refund is called twice — money is refunded once, not twice. 🟠 Always persist saga state. If the orchestrator crashes mid-saga, it needs to resume from where it left off — not start over. If a business operation spans 2+ services — it needs a Saga. There is no 2PC in microservices. #SystemDesign #Saga #Java #SpringBoot #Microservices #DistributedSystems #SoftwareArchitecture

  • View profile for Amritpal Singh

    Principal Software Engineer at PKWare

    6,823 followers

    Saga Pattern for Distributed Transactions While working with microservices, when you have database per service, Saga pattern is used to perform transactions that span across boundaries of different services. Saga defines a mechanism where you define a sequence of Local Transactions in each service that becomes the part of one bigger distributed transaction. Each service performs an action and implements its local transaction for its database. If the transaction is successful, it publishes a message and the service who is registered for the message, then performs its own actions/transactions and again publishes a message for the next services in the sequence. At any point, if a service fails or an issue occurs, the services would have a series of compensating Transactions that should be raised in reverse sequence to reverse all the actions in previous services and remove all the entries from all the previous local databases, respectively. In the example below, we have a checkout process of an ecommerce website with each microservice performing its task, committing a local transaction Tn and then publishing a message for the next service to perform its action. At any time, if there is any error at any step (any microservice), the microservice raises a Compensating Transation Cn that reverses the most recently performed action and again publishes a message for the previous service in the sequence in order for that service to perform the compensating action as well. The Saga Pattern can be implemented in two ways: Orchestration: One centralized service/Component is responsible to communicate with all the other services and provide notifications on what transactions to perform. Choreography: Each Microservice performs its own transactions and sends message via a Message Bus and the registered services receive the message and perform its own local transactions and so on. #microservices #saga #distributedsystems #transactions #eventdrivenarchitecture

Explore categories