Hacker News new | ask | show | jobs
Show HN: Experimental Postgres-to-SQLite Sync via Logical Replication (github.com)
4 points by enadzan 402 days ago
In a previous project, I had a few tables in Postgres that weren’t too large but were read frequently — things like configs, permissions, and feature flags. I thought it’d be cool to have a cache for them with an SQL interface. I ended up loading them into memory and invalidating the cache when a user made changes.

Lately, I’ve been playing with PostgreSQL logical replication in C# (using Npgsql), and figured it could be used to keep those in-memory rows updated. If I stored them in SQLite, I could even query them using SQL or through an existing Entity Framework DbContext.

Haven’t tried it in a real project yet, but thought it was an interesting idea worth sharing.