2 ms·
I like most of this thinking, and it's the way I've built systems for years. Data model and an API for it in the database. Apps built to use that API, never acc
by ams6110 12y ago
I like most of this thinking, and it's the way I've built systems for years. Data model and an API for it in the database. Apps built to use that API, never access tables directly (or at least, that is the ideal).
This lets me build systems using different front-end platforms and languages as needed and appropriate for the task, calling one tested API to interact with the data.
One caution I would have is with triggers. Triggers are a way to make things happen as if "by magic" and I avoid them. I prefer to keep things more obvious and easier to reason about. If inserting a row into some table should have a side-effect, I code that explicitly and don't make it happen via a trigger. One exception might be to auto-generate IDs if the database doesn't have a type that does that for you.