Skip to content

Marketplace Architecture ​

A marketplace platform is not one application β€” it's a system of interconnected services that independently manage supply, demand, matching, transactions, and trust across two sides of a market.

Why This Matters ​

  • 🏒 Owner: Architecture decisions made in the first year determine how fast you can iterate, how reliably you handle peak load, and how expensive it is to operate. Bad architecture becomes visible when it starts costing you money and speed.
  • πŸ’» Dev: You need to build systems where supply-side changes (new listings, availability updates) and demand-side actions (searches, bookings, purchases) can evolve independently. The architecture must handle the unique complexity of coordinating two-sided transactions.
  • πŸ“‹ PM: Understanding architectural boundaries helps you plan features that span multiple services, estimate timelines accurately, and avoid scope creep from hidden dependencies.
  • 🎨 Designer: Architecture defines what data is available on each screen and how fast it loads. The constraints your engineers face directly shape what UX you can design for both buyers and sellers.

The Concept (Simple) ​

Think of a marketplace like a busy farmers market in a town square.

You don't build one giant building to handle everything. Instead, you have separate areas: a section where farmers set up stalls (supply service), an area where shoppers browse and buy (demand service), a central information board that helps shoppers find what they need (search and matching), a cashier station where money changes hands (payment service), and a security office that handles disputes and safety (trust service).

Each area operates independently. If the cashier line gets long, you add more cashiers β€” you don't rebuild the entire market. If you want to add a new type of stall, you modify the supply area without touching the cashier station.

In one sentence: Marketplace architecture separates the platform into independent services for supply, demand, matching, payments, and trust so each can evolve and scale on its own.

How It Works (Detailed) ​

High-Level Marketplace Architecture ​

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    MARKETPLACE PLATFORM ARCHITECTURE                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚  BUYER APP   β”‚    β”‚  SELLER APP  β”‚    β”‚  ADMIN       β”‚          β”‚
β”‚  β”‚  (Web/Mobile) β”‚    β”‚  (Web/Mobile) β”‚    β”‚  DASHBOARD   β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚         β”‚                   β”‚                   β”‚                   β”‚
β”‚  ═══════β•ͺ═══════════════════β•ͺ═══════════════════β•ͺ════════════       β”‚
β”‚         β”‚              API GATEWAY               β”‚                   β”‚
β”‚  ═══════β•ͺ═══════════════════β•ͺ═══════════════════β•ͺ════════════       β”‚
β”‚         β”‚                   β”‚                   β”‚                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚   SEARCH &   β”‚    β”‚   LISTING    β”‚    β”‚    USER      β”‚          β”‚
β”‚  β”‚   DISCOVERY  β”‚    β”‚   SERVICE    β”‚    β”‚   SERVICE    β”‚          β”‚
β”‚  β”‚              β”‚    β”‚              β”‚    β”‚              β”‚          β”‚
β”‚  β”‚ β€’ Query      β”‚    β”‚ β€’ CRUD       β”‚    β”‚ β€’ Auth       β”‚          β”‚
β”‚  β”‚ β€’ Ranking    β”‚    β”‚ β€’ Media      β”‚    β”‚ β€’ Profiles   β”‚          β”‚
β”‚  β”‚ β€’ Filters    β”‚    β”‚ β€’ Categories β”‚    β”‚ β€’ Verify     β”‚          β”‚
β”‚  β”‚ β€’ Recommend  β”‚    β”‚ β€’ Inventory  β”‚    β”‚ β€’ Roles      β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚  TRANSACTION β”‚    β”‚   PAYMENT    β”‚    β”‚   MESSAGING  β”‚          β”‚
β”‚  β”‚   SERVICE    β”‚    β”‚   SERVICE    β”‚    β”‚   SERVICE    β”‚          β”‚
β”‚  β”‚              β”‚    β”‚              β”‚    β”‚              β”‚          β”‚
β”‚  β”‚ β€’ Orders     β”‚    β”‚ β€’ Checkout   β”‚    β”‚ β€’ Inbox      β”‚          β”‚
β”‚  β”‚ β€’ Bookings   β”‚    β”‚ β€’ Escrow     β”‚    β”‚ β€’ Threads    β”‚          β”‚
β”‚  β”‚ β€’ State      β”‚    β”‚ β€’ Payouts    β”‚    β”‚ β€’ Notifs     β”‚          β”‚
β”‚  β”‚ β€’ Fulfillmentβ”‚    β”‚ β€’ Refunds    β”‚    β”‚ β€’ Templates  β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚  β”‚   REVIEW     β”‚    β”‚  TRUST &     β”‚    β”‚  ANALYTICS   β”‚          β”‚
β”‚  β”‚   SERVICE    β”‚    β”‚  SAFETY      β”‚    β”‚  SERVICE     β”‚          β”‚
β”‚  β”‚              β”‚    β”‚              β”‚    β”‚              β”‚          β”‚
β”‚  β”‚ β€’ Ratings    β”‚    β”‚ β€’ Fraud      β”‚    β”‚ β€’ Events     β”‚          β”‚
β”‚  β”‚ β€’ Reviews    β”‚    β”‚ β€’ Moderation β”‚    β”‚ β€’ Metrics    β”‚          β”‚
β”‚  β”‚ β€’ Responses  β”‚    β”‚ β€’ Disputes   β”‚    β”‚ β€’ Reports    β”‚          β”‚
β”‚  β”‚ β€’ Scores     β”‚    β”‚ β€’ Compliance β”‚    β”‚ β€’ Dashboards β”‚          β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Monolith vs Microservices: What to Start With ​

Most marketplaces should start monolith, extract services as needed:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           ARCHITECTURE EVOLUTION                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  STAGE 1: Monolith (Day 0 - ~$1M GMV)                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  Single application                     β”‚           β”‚
β”‚  β”‚  Single database                        β”‚           β”‚
β”‚  β”‚  Fast to build, easy to deploy          β”‚           β”‚
β”‚  β”‚  All features in one codebase           β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚           β”‚                                             β”‚
β”‚           β–Ό                                             β”‚
β”‚  STAGE 2: Modular Monolith (~$1M - $10M GMV)           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  Single deployment, but internal        β”‚           β”‚
β”‚  β”‚  modules with clear boundaries          β”‚           β”‚
β”‚  β”‚  Extract payments & search first        β”‚           β”‚
β”‚  β”‚  Shared database with schema separation β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚           β”‚                                             β”‚
β”‚           β–Ό                                             β”‚
β”‚  STAGE 3: Services (~$10M+ GMV)                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  Extract services along domain lines    β”‚           β”‚
β”‚  β”‚  Independent deployment and scaling     β”‚           β”‚
β”‚  β”‚  Event-driven communication             β”‚           β”‚
β”‚  β”‚  Service-specific databases             β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                                                         β”‚
β”‚  Rule: Don't extract a service until you feel the pain β”‚
β”‚  of it being coupled.                                   β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Domain Services ​

1. Listing Service ​

Manages everything sellers create and maintain:

ResponsibilityDetails
CRUD operationsCreate, read, update, delete listings
Media managementPhoto/video upload, processing, CDN delivery
CategorizationTaxonomy, tagging, attribute schemas per category
InventoryStock levels, availability calendars, booking windows
PricingFixed pricing, dynamic pricing, promotional pricing
VersioningDraft vs published, edit history, moderation queue

2. Search and Discovery Service ​

The matching engine between supply and demand:

ResponsibilityDetails
IndexingReal-time index of all active listings
Query processingParse, expand, spell-correct, intent detection
RankingMulti-factor scoring (relevance, quality, personalization)
FilteringFaceted search, geo-filtering, availability filtering
Recommendations"Similar to", "You might like", "Popular near you"

Tech choices: Elasticsearch or Algolia for search, Redis for caching, ML models for personalization.

3. Transaction Service ​

Orchestrates the lifecycle of orders and bookings:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           TRANSACTION STATE MACHINE                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚ CREATED  │───▢│ PENDING  │───▢│ CONFIRMEDβ”‚         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜         β”‚
β”‚       β”‚               β”‚               β”‚                β”‚
β”‚       β–Ό               β–Ό               β–Ό                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚ EXPIRED  β”‚    β”‚ REJECTED β”‚    β”‚ IN       β”‚         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ PROGRESS β”‚         β”‚
β”‚                                  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                                       β”‚                β”‚
β”‚                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚                          β–Ό            β–Ό            β–Ό   β”‚
β”‚                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”β”‚
β”‚                     β”‚COMPLETED β”‚ β”‚ DISPUTED β”‚ β”‚CANCELβ”‚β”‚
β”‚                     β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”¬β”€β”€β”€β”˜β”‚
β”‚                          β”‚            β”‚          β”‚     β”‚
β”‚                          β–Ό            β–Ό          β–Ό     β”‚
β”‚                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”β”‚
β”‚                     β”‚ REVIEWED β”‚ β”‚ RESOLVED β”‚ β”‚REFUNDβ”‚β”‚
β”‚                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

4. Payment Service ​

Handles money flow between all parties (see Chapter 21 for deep dive):

ResponsibilityDetails
CheckoutPayment capture, payment method management
EscrowHold funds between payment and fulfillment
Split paymentsDivide payment between seller and platform
PayoutsDisburse funds to sellers on schedule
RefundsFull/partial refund processing
ComplianceTax calculation, 1099 generation, KYC

Event-Driven Architecture ​

Marketplace services communicate through events, not direct calls. This keeps services decoupled:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           EVENT-DRIVEN COMMUNICATION                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  Listing Service                                        β”‚
β”‚       β”‚                                                 β”‚
β”‚       β”‚ publishes: "listing.created"                    β”‚
β”‚       β–Ό                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚          EVENT BUS / QUEUE           β”‚              β”‚
β”‚  β”‚     (Kafka, RabbitMQ, SQS, etc)     β”‚              β”‚
β”‚  β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚     β”‚          β”‚          β”‚                             β”‚
β”‚     β–Ό          β–Ό          β–Ό                             β”‚
β”‚  Search     Analytics   Notification                    β”‚
β”‚  Service    Service     Service                         β”‚
β”‚  (reindex)  (track)     (alert seller)                  β”‚
β”‚                                                         β”‚
β”‚  Benefits:                                              β”‚
β”‚  β€’ Services don't know about each other                β”‚
β”‚  β€’ Adding a new consumer doesn't change the publisher  β”‚
β”‚  β€’ Events can be replayed for debugging                β”‚
β”‚  β€’ Services can fail independently                     β”‚
β”‚                                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

API Design for Two-Sided Platforms ​

Marketplaces need separate API surfaces for each audience:

API SurfaceConsumersKey Endpoints
Buyer APIBuyer web/mobile appsSearch, listing detail, booking, checkout, reviews
Seller APISeller web/mobile appsListing management, orders, analytics, payouts
Admin APIInternal toolsModeration, disputes, user management, reporting
Public APIThird-party integrationsListing syndication, booking widgets, data feeds
Webhook APIExternal systemsEvent notifications for partners and integrations

Database Strategy ​

ServiceDatabase TypeWhy
Users/ListingsPostgreSQL (relational)Structured data, complex queries, ACID transactions
SearchElasticsearchFull-text search, geo-queries, faceted filtering
MessagingMongoDB or CassandraHigh write volume, flexible schema, time-series
Sessions/CacheRedisLow latency, ephemeral data, real-time counters
MediaS3 + CDNBlob storage, global distribution, cost-effective
AnalyticsClickHouse or BigQueryColumnar storage, fast aggregations, large datasets
EventsKafkaOrdered event log, replay capability, high throughput

In Practice ​

What Good Looks Like: Airbnb's Architecture Evolution ​

  1. 2008-2012: Monolith β€” Ruby on Rails monolith, single MySQL database. Fast to build, got them to product-market fit.
  2. 2012-2016: SOA transition β€” extracted search, payments, messaging into separate services. Enabled team autonomy.
  3. 2016-present: Microservices β€” hundreds of services, event-driven communication, dedicated search infrastructure. Supports billions in GMV.

Key lesson: They didn't start with microservices. They earned the right to add complexity by growing into it.

What Good Looks Like: Uber's Real-Time Architecture ​

  • Dispatch service β€” matches riders with drivers in real-time using geo-spatial indexing
  • Surge pricing service β€” dynamically adjusts pricing based on supply/demand ratio per zone
  • ETA service β€” calculates arrival times using real-time traffic and driver location data
  • Trip service β€” manages the state machine of a trip from request to completion to payment

Common Anti-Patterns ​

  • Premature microservices β€” splitting into 20 services before you have 20 engineers. Start monolith, extract when it hurts.
  • Shared database β€” multiple services reading/writing the same database tables creates invisible coupling and deployment nightmares.
  • Synchronous everything β€” making service A call service B call service C in a chain. One slow service brings everything down. Use events.
  • Ignoring the two-sided nature β€” building one unified data model when buyers and sellers have fundamentally different needs and access patterns.
  • No API versioning β€” breaking mobile apps with backend changes because you didn't version your APIs from the start.
  • Skipping the event bus β€” directly connecting services instead of using an event system, creating a tangled web of dependencies.

Technology Stack Recommendations ​

LayerEarly StageGrowth StageAt Scale
BackendRails, Django, Next.jsNode.js, Go, JavaPolyglot per service
DatabasePostgreSQLPostgreSQL + Redis + ElasticsearchPer-service databases
SearchPostgreSQL full-textElasticsearchElasticsearch + ML ranking
QueueRedis/SidekiqRabbitMQ or SQSKafka
StorageS3S3 + CDNS3 + multi-region CDN
HostingHeroku, RailwayAWS/GCP with containersKubernetes
PaymentsStripe ConnectStripe ConnectCustom + Stripe/Adyen

Key Takeaways ​

  • Start with a monolith and extract services only when you feel the pain of coupling β€” premature microservices add complexity without value
  • The core marketplace services are: listings, search, transactions, payments, messaging, reviews, trust, and analytics
  • Use event-driven architecture to keep services decoupled β€” publish events, let consumers decide what to do with them
  • Design separate API surfaces for buyers, sellers, and admins β€” they have fundamentally different data needs
  • The transaction service is the heart of the marketplace β€” model it as a state machine with clear transitions and failure handling
  • Choose your database per service based on access patterns, not one-size-fits-all
  • Payments should be extracted early β€” it's complex, regulated, and needs to be rock-solid
  • Plan for separate scaling of each side β€” buyer traffic patterns differ from seller patterns

Action Items ​

  • ☐ 🏒 Owner: Align on architecture stage (monolith vs modular vs services) based on current team size and GMV
  • ☐ 🏒 Owner: Budget for search infrastructure β€” it's the highest-leverage technical investment for marketplace conversion
  • ☐ πŸ’» Dev: Define clear domain boundaries for your core services (listings, search, transactions, payments, messaging)
  • ☐ πŸ’» Dev: Implement an event bus from day one, even in a monolith β€” it makes future extraction dramatically easier
  • ☐ πŸ“‹ PM: Map features to services so you understand cross-service dependencies when planning sprints
  • ☐ πŸ“‹ PM: Create an API contract between buyer-facing and seller-facing teams to prevent blocking
  • ☐ 🎨 Designer: Understand data availability per service β€” know what loads fast (cached) vs slow (computed) so you can design loading states accordingly
  • ☐ 🎨 Designer: Design for both sides independently β€” buyer and seller experiences should feel like purpose-built apps, not one app with a role toggle

Next: Search and Matching Algorithms

The Product Builder's Playbook