In design
A read model in front of a slow source
Changes in a slow system are published as events, a consumer materialises them in Redis and the API answers from there. An idea I know from work, taken into an open project where every decision can be reviewed.
What it should prove
- Transactional outbox: the data and its event are saved in the same transaction.
- Idempotency: the same event twice duplicates nothing.
- A dead-letter queue for events that always fail.
- Circuit breaker: if the source goes down, the API doesn't go down with it.
- A script that measures latency before and after, with the numbers in the README.
Go · PostgreSQL · Pub/Sub · Redis · Docker Compose