Cartnest
A full trading e-commerce system, built to scale.
Cartnest is a full trading e-commerce platform built as a team project. It handles user accounts, product catalogs, deposits, and transactions — with a backend designed to survive real trading traffic patterns.
Backend design
The API layer is built with FastAPI and SQLModel, giving us type-safe models and automatic OpenAPI docs. Every endpoint — users, products, deposits, transactions — follows a consistent pattern for validation, error handling, and pagination.
Scaling Postgres
As traffic grew in testing, reads on the product catalog and transaction history became the bottleneck. We introduced read replicas and table fragmentation to split the load across nodes.
- Primary node for writes, replicas for catalog reads
- Time-based fragmentation on the transactions table
- Docker Compose for local multi-node development
- Connection pooling to manage replica fan-out
Distributed systems don't make problems disappear. They move them somewhere you can reason about.