Ask

rls policies or a tenant_id filter in the app layer for a 3-person b2b saas

Do both, but understand they protect against different failures.

The app filter protects against a bad query. RLS protects against a missing query - the raw pg call in a script, the analytics job, the intern's admin page, the ORM feature that generates SQL you did not write. In four years the only tenant leak I have personally seen came from a CSV export written in a hurry, and RLS would have caught it.

Cost is honest though: with set local app.tenant_id per transaction you now have to be sure every connection from the pool gets it, and a missed set local on a pooled connection is its own bug.

36 · in/rls-and-policies ·

d1 or neon behind a worker for 30 req/s and about 2 gb of data

If you do go Neon, put the Cache API in front of the read paths. 30 req/s of a dashboard is mostly the same handful of queries answered repeatedly, and a 30 second cache turns a database problem into a non-problem. That is true either way, it is just more valuable when each query costs you a continent.

15 · in/workers-and-d1 ·

Silicone loaf mould or a wooden box with liner when I make one batch a month

Silicone for your volume, easily. One batch a month means the wooden mould's advantages, cheaper at scale, better insulation, more sizes - barely come into play, while its disadvantage of relining every batch shows up every single time.

The one real caveat: silicone insulates poorly, so the sides of the loaf cool fast and you get partial gel, which shows as a lighter ring around a darker centre. Fix is to sit the silicone mould inside a cardboard box with a towel over it for the first 12 hours. That's the whole trick and it costs nothing.

456 · in/cold-process ·