All work
Case StudyReal-time financial data · 2022 - now

CediRates.

Exchange rates and fuel prices across Ghana. I lead backend development, including the migration from MongoDB to PostgreSQL and the data ingestion pipeline.

CediRates
Role
Lead Backend Engineer
Year
2022 - now
Stack
Next.js · Node.js · PostgreSQL
Status
Live
The constraint

Existing sources of FX and pump prices were slow, scattered, and frequently stale. The system needed to pull from unreliable upstream feeds and still serve fresh, consistent data at low latency.

The approach

Rewrote the API using Node.js and PostgreSQL, with Redis for shared state. Added unique constraints and upserts for daily rate records, retries for upstream failures, and structured logs to investigate errors and latency. The stack runs in Docker on a single EC2 instance.

Key decisions
Relational data needed a relational store
Companies, rates, reviews, and accounts needed joins and referential integrity. PostgreSQL replaced repeated MongoDB aggregation pipelines and let the database enforce the relationships.
Upserts as the default write path
Rate rows are keyed on the tuple (company, date, currency pair). A unique constraint on that tuple means scrapes overwrite the same row rather than stack duplicates. A separate timestamp records when the value actually changed, not just when the row was created.
Redis for shared state
At the time of the migration, Redis held shared rate-limit counters and short-lived OAuth exchange codes. Reads went directly to PostgreSQL. The linked write-up records that stage of the system and the remaining work.
Results & operations
~15K
monthly organic visitors
~125ms
p95 API latency on recent traffic
1
EC2 instance running Redis + Postgres + Node
Resilient
ingestion (retries + stale-while-revalidate)
Tech stack
Next.jsNode.jsPostgreSQLRedisTypeScriptDockerAWS