Nerd sniped myself trying to drop pocketbase as my realtime db. A sort of simpler hacky alternative has been to use server sent events. I’ve gotten something working by combining hono.js , drizzle orm and sqlite. hono.js makes it really easy to create a sse endpoint, drizzle gives me TS QOL and sqllite lite will just make deploying things easier.
- within my insertion POST hono endpoint i emit an insert event along with the data payload
- within my sse endpoint, its listening to events in step one
- when an event is received, the sse endpoint will write to the SSE stream.