3 ms·
The one problem this technique has is that data and software normally have two very different speed and correctness requirements. That means that data and softw
by marcosdumay 6y ago
The one problem this technique has is that data and software normally have two very different speed and correctness requirements. That means that data and software should evolve following different procedures, what heavily implies that you want different people working at them, or at least you want people to look at them at different times.
For that, you really want independent access controls and CI tooling.
Of course, you can't separate much if you are a 1 or 2 people team at early stages of some project. And it may help you move faster.
But:
> "Rebuilding the database is as simple as executing one line bash loop (I do it every few minutes)"
This denounces a very development-centric worldview where operations and maintenance don't even appear. You can never rebuild a database, and starting with the delusion that you will harm you on the future.
- capableweb 6y ago> You can never rebuild a database, and starting with the delusion that you will harm you on the future. That seems like a silly assumption. Who's to say you can't use databases that you can rebuild from scratch whenever you want? What about append-only logs built with CRDTs and the other ways?
- shuntress 6y ago"rebuilt from scratch" means "as if the production server just fell into a woodchipper and I'm taking a new one out of the crate now" You cannot do that with databases because the data needs to come from somewhere. I'm sure you could implement some kind of echo server in SQL somehow and yeah that is a "database" that could be rebuilt from scratch with no loss but that's obviously not the kind of thing we are talking about here.
- taffer 6y agoFor this reason you should always separate data and code and put them into separate schemas. In such a setup, deploying new code essentially means dropping and re-creating the code schema in a single transaction.
- Roboprog 6y agoThanks for pointing that out. Safe to assume views go in the “code” schema with procs/funcs/packages, leaving just tables and sequences (if needed) in the “data” schema? Considering building a side project using this kind of approach...
- marcosdumay 6y agoI work with one codebase similar to that (DBMS only), and that's exactly what I do there (it's not that clear-cut, some code validates data, some data is short-lived). There is more than one "code" schema, with different lifecycles too. There are plenty of interesting problems with it. I would prefer to completely separate code from data if it wouldn't impact elsewhere. As it is, separating them would severely harm us, so it's kept this way. It brings a lot of productivity, but we have a very small team working on it, and completely separated procedures for them.