Database Systems · individual project
Ride-share microservices on Docker
Four services, four databases, one Docker network.
- Year
- 2025
- Role
- Solo · coursework
- Status
- Shipped
- Type
- Database Systems
A ride-sharing backend split across four Flask microservices, users, driver availability, reservations, and payments, each in its own container, with its own SQLite database, talking over a Docker network.
The problem
Project 3 took the auth and recipes work and broke it across service boundaries. Payments can't see the user table. The reservations service has to ask the user service who someone is. And a failed inter-service call can't leave money in the wrong account.
Approach
- Designed four services on dedicated ports, 9000 users, 9001 availability, 9002 reservations, 9003 payments, each with its own SQLite database (user.db / listings.db / reservations.db / payments.db) and its own .sql init script.
- Wrote a Dockerfile per service (Dockerfile.users, .availability, .reservations, .payments) and a single compose.yaml that puts all four on the same Docker network so containers can resolve each other by name.
- When a passenger reserves a driver, the reservations service authenticates the JWT, calls the user service to confirm role and identity, calls the payments service to move fare from passenger to driver, then deletes the driver's availability listing, failing closed at every step.
- Enforced the social rule on ratings across services: a passenger can only rate a driver they had a confirmed reservation with (and vice versa), checked by cross-service calls between the user and reservations services.
- Added /clear on every service so the instructor's test suite can reset all four databases between tests without restarting any container.
Impact
- A clean four-service split with database-per-service, inter-service authorization, and an atomic payment transfer across service boundaries.
- Reproducible with `docker compose up`, the same shape as a production microservice deploy.
Stack
Services
PythonFlaskrequests
Data
SQLite ×4Per-service schemas
Infra
DockerDocker ComposeDocker networks
Auth
JWT (HS256)Cross-service authz