Hi everyone! π
I'm Olivier, a solo developer based in Spain.
For the past few months, I've been building Crono-Job, a workforce management platform. I wanted to share a bit about the technical journey and the architecture choices I made, specifically why I chose to split my data into two different databases.
π The Stack
- Frontend: React + Mantine UI (Absolutely love their hooks).
- Backend: Node.js + Express.
- ORM: Prisma.
- Database: Postgres (hosted on Neon).
- Infra: Render + Redis (for rate limiting).
π The Challenge: Hot Data vs. Cold Logs
The app handles two very different types of traffic:
- Critical Operations: Users clocking in/out, biometric photos from the Kiosk mode, and payroll calculations. This needs to be fast and consistent (ACID).
- Analytics & Audit: Every click, page view, and system event is logged for the "Data Governance" module and audit trails.
I realized early on that if I dumped millions of analytics events into the same Postgres instance as the user data, my queries for the Dashboard would eventually crawl.
π‘ The Solution: Dual-Database Architecture
I decided to implement a Dual-DB strategy within the same monorepo:
- Main DB (
DATABASE_URL): Stores Users, Shifts, Projects, and TimeEntries. It's optimized for transactional integrity. - Analytics DB (
DATABASE_URL_ANALYTICS): A separate Postgres instance dedicated toAnalyticsEventand logs. It's optimized for write-heavy operations (fire-and-forget).
Using Prisma, I manage two clients. One for the core app and a custom generated client for the analytics. This keeps my main DB crisp and responsive, no matter how much logging we do.
π Launching the Public Beta
The project includes some cool features like:
- Biometric Kiosk: Uses the webcam to capture evidence and verify identity.
- Payroll Export: Generates complex Excel files compatible with Spanish payroll software (A3NOM).
- Smart Policies: Geofencing and anti-fatigue blocks (12h rest rule).
I just launched the Public Beta (it's free right now).
If you are curious about the UI (Mantine in action) or want to stress-test my dual-db setup, feel free to check it out!
π Live Demo: https://crono-job.com
I'd love to hear your thoughts on this architecture. Is splitting databases overkill for an MVP, or a smart move for scaling?
Happy coding! π»
Top comments (0)