Skip to main content
    listerineh.dev
    • About
    • Experience
    • Projects
    • Skills
    • Blog
    • Talks
    • Contact
    • Why
    • About
    • Experience
    • Projects
    • Skills
    • Blog
    • Talks
    • Contact
    • Why

    © 2026 Sebastian Alvarez

    All projects

    ticketmesh

    A distributed ticketing backend for flash sales: seven services in Go, Python and TypeScript behind auth sidecars, a payment saga on events, and a GCP deployment sized for about 0.12 USD a month.
    Source Code
    ticketmesh
    Role
    Backend Engineer
    Timeline
    November 2026
    Status
    In Progress

    In numbers

    Holds for 500 buyers on 100 seats in a k6 flash sale; the other 400 got a clean conflict
    100100
    Hold p99 at 200 holds per second for 60 s, with 0 errors
    3.593.59ms
    Holds per second sustained, 0 failed out of 109,497 requests
    600600
    A month on GCP by the free-tier cost table (Terraform not applied yet)
    0.120.12USD

    About the Project

    ticketmesh is the backend of a ticket shop on the day a big show goes on sale: thousands of buyers want the same seats in the same minute, and no seat may ever be sold twice. It covers the whole path, from browsing events to holding seats, paying and being told the result, split into seven services in Go, Python and TypeScript.

    Every request enters through a gateway with a per-IP rate limit, a circuit breaker per service and a deadline that the rest of the path honours. Behind it, each service listens only on loopback, and an auth sidecar written for the project is the one place that turns an RS256 token into an identity. Seats are held in Postgres with one conditional update and ordered row locks. Orders takes the hold over gRPC with a service token, and payment runs as a saga on events: a transactional outbox in every producer, an inbox in every consumer, retries with backoff and a dead-letter queue, and a refund when money arrives for a hold that was lost. The buyer hears the outcome over a WebSocket opened with a single-use ticket, and one OpenTelemetry trace follows a checkout across every service and the broker.

    I built it in November 2026 to practise distributed systems end to end and to measure each claim instead of asserting it. In a k6 flash sale, 500 buyers on 100 seats got exactly 100 holds, and 200 holds per second ran at a p99 of 3.59 ms. Locally the broker is NATS JetStream. On GCP the Terraform runs every service on Cloud Run, scaling to zero, with Pub/Sub push instead of NATS, Postgres on the free VM and Firestore for documents. It is tested on mock providers in CI and not applied yet.

    Technologies
    1. API & backend

      • Go
      • Python
      • gRPC
    2. Data

      • PostgreSQL
      • Firestore
    3. Cloud & infra

      • NATS
      • Pub/Sub
      • Cloud Run
      • Terraform
    4. Tooling

      • TypeScript
      • OpenTelemetry
      • k6

    Relevance

    Distributed systems with the guarantees proven: no overselling under contention, exactly-once effects over at-least-once delivery, zero trust between services, and every figure measured.

    How it works

    The path a request takes, step by step.

    1. 01 · PersonBuyerHolds seats and pays with a token
    2. 02 · ServiceGatewayRate limit per IP, a breaker per service, deadlines
    3. 03 · ServiceAuth sidecarRS256 token to identity; the service is on loopback
    4. 04 · ServiceOrdersIdempotency key, seats held over gRPC
    5. 05 · QueueEvent busOutbox → NATS or Pub/Sub → inbox
    6. 06 · ResultPayments and notifierThe saga settles; the buyer hears it over a WebSocket
    A declined payment releases the seats; money that arrives for a lost hold is refunded through orders.refund.requested.

    Decisions

    The choices that shaped it, and what each one cost.

    1. 01

      Seat holds in Postgres, no Redis

      Why
      One source of truth for seats. The agreed rule was to add Redis only if 200 holds/s missed a 300 ms p99; it ran at 3.59 ms, and Postgres used 21% CPU.
      What it cost
      Measured on a laptop; the free GCP VM is much smaller, so the test must run there before a real sale.
    2. 02

      Authorization only in a sidecar

      Why
      Every service binds to loopback, so the sidecar is the one place that turns a credential into an identity. It is tested against alg=none, algorithm confusion and spoofed headers.
      What it cost
      An extra hop per request: under load the sidecar checking tokens was the busiest container (26% CPU).
    3. 03

      A saga on events, not a distributed transaction

      Why
      Payments charges outside its transaction and records the result through an inbox; orders applies each event under the order's row lock, so duplicates and races settle once.
      What it cost
      More states to reason about (refunding, expired), and outcomes are eventual.
    4. 04

      Pub/Sub push on GCP instead of NATS

      Why
      Services scale to zero on Cloud Run, which a pull consumer cannot survive, and the one free VM already holds Postgres.
      What it cost
      Two transports to keep: the e2e suite covers only NATS, and the notifier runs as one instance on GCP.

    Next project

    CodeSentry SwarmThree AI agents on Google Cloud that review a pull request, prove the bug with a failing test in a sandbox, and propose a fix. Deterministic code decides, and a person merges.Next project
    listerineh.dev

    Full-stack engineer building AI agents, cloud platforms and web products. Based in Quito, working remotely.

    Open to new projects

    Work

    • Projects
    • Experience
    • Skills
    • Blog
    • Talks

    About me

    • About
    • Why Listerineh?
    • Contact

    Connect

    • GitHub
    • LinkedIn
    • Instagram
    • Email

    © 2026 Sebastian Alvarez · All rights reserved.

    • Privacy Policy
    • Terms of Use
    • Unsubscribe from the newsletter
    • Component Library