E-One

Side project

EoneShop: Microservices, Live

A mini shop built step by step from a single monolith into six event-driven services running on Cloud Run, talking through Google Pub/Sub, each with its own Neon Postgres database. I learned it by building it, and wrote up every step in public as I went.

Watch an order live Code & design notes

Break it on purpose

On the live page you place an order and watch each event travel through Pub/Sub in real time: order placed, stock reserved, payment charged, order confirmed. Four scenarios are on offer, and each one only ever affects your own order:

How it's built

Architecture diagram: a browser calls the public gateway service, which calls four private services (order, catalog, payment, notification), each with its own Neon database, all connected through a central Pub/Sub topics hub; a feed service taps the topics, and Cloud Trace collects a trace across every service. Browser Gateway public Pub/Sub topics Order Catalog Payment Notification private, ID tokens DB DB DB DB Feed (tap) Cloud Trace

Seven parts, written up

  1. Why I Started With a Monolith
  2. When a Function Call Becomes a Network Call
  3. Events, the Outbox, and Getting Every Message Twice
  4. Undo Buttons, Timeouts, and Breaking Things on Purpose
  5. One Trace per Order, and the Bug It Found
  6. Leaving the Laptop
  7. Watch It Live (and the Bug It Caught)

Bugs it caught

Stack

FastAPI SQLAlchemy Google Pub/Sub Cloud Run Neon Postgres OpenTelemetry Cloud Trace Cloud Build pytest