I was taking notes on Sam Goodwin’s Alchemy interview on Syntax. His example puts the application’s database dependency behind an Effect service. A layer supplies that service, so an environment can choose a different implementation if it satisfies the same contract.1
Alchemy documents a Cloudflare Workers and Drizzle setup for either Neon or PlanetScale Postgres. The provider choice lives in the layer. The queries still have to behave as expected against the chosen database.23
I’d review a provider change in two parts. First run the application’s queries and schema migrations against the target database. Then plan how to copy and verify the existing rows before cutover. The layer gives me a place to change the connection. Those checks tell me whether I can move the workload and its data.
Footnotes
Sam Goodwin’s Alchemy interview on Syntax, database discussion at 10:25 and 13:09. ↩