15 ms·
Maybe it's better to have views in the first place, and to require (though it can only be enforced at an administrative level) external services to query agains
by maxbond 3y ago
Maybe it's better to have views in the first place, and to require (though it can only be enforced at an administrative level) external services to query against those views.
We won't have to do this switch to a view, we've paid that upfront.
We can then include a version number in the view name, similar to how we do with APIs. So if we introduce changes we can keep services which didn't need that change outside the blast radius.
And we have a limited ability to enforce contracts and declare some columns internal.
- thestepafter 3y agoEven better, use stored procedures / routines on top of views and only query the stored procedures from the frontend.
- maxbond 3y agoI like it, but the only benefit we've retained at that point is eliminating round trips. Which is pretty significant. But we're still engaging in API design, we're just doing it in Sqlite.