ShopHub
Multi-Tenant Marketplace Architecture
Problem Statement & Investigation
Multi-vendor platforms require strict tenant data isolation, ACID compliance for financial checkout, and high-volume unconstrained query flexibility for product reviews and clickstream analytics.
A polyglot persistence architecture combining PostgreSQL (for ACID transactions and multi-tenant catalog) with MongoDB (for dynamic telemetry and product attributes) provides the optimal balance between consistency and ingestion throughput.
System Runtime Flow
Requests are balanced across Docker containers with Traefik reverse proxy handling SSL termination and tenant host-header routing.
Python 3.12 FastAPI ASGI workers handle asynchronous non-blocking I/O for concurrent database pooling.
PostgreSQL manages tenant-partitioned tables, customer accounts, and Stripe transaction webhooks.
MongoDB stores flexible product variants, ratings, customer reviews, and unstructured audit trails.
Architecture Decision Records (ADRs)
Failure-Mode & Resilience Analysis
Key Engineering Takeaways
- Schema-per-tenant works well up to ~50 tenants; beyond that, shared tables with tenant_id indexes are vastly more maintainable.
- Async SQLAlchemy 2.0 provides substantial performance improvements over synchronous drivers under concurrent load.
Empirical Benchmarks
Technology Primitives
- frontend
- React 18 + Vite + Tailwind
- backend
- FastAPI + SQLAlchemy
- database
- PostgreSQL + MongoDB
- infra
- Terraform + EC2 + Docker Compose
Architecture Tags
Public Live Demo · Detailed Architecture & Deploy Keys Secured. Operational lifecycle commands (Deploy, Scale, Destroy) and raw cloud credentials remain sealed in the private control plane.