3 ms·
> The post mentions "The open source Deno runtime shows how clean and productive a modern, batteries-included, programming environment can be" so it sounds like
by lmm 4y ago
> The post mentions "The open source Deno runtime shows how clean and productive a modern, batteries-included, programming environment can be" so it sounds like they expect you'll be running database backed apps and not only static sites.
It suggests you'll be running a datastore, not necessarily an SQL database (the most overrated technology in existence IMO, especially for web apps where essentially none of its strong points are relevant). Storing old data as-is and migrating on read is definitely doable, and you can keep backwards compatibility to day 1 that way relatively easily. I worked on a system much like the one from "An oral history of Bank Python" that did exactly that, and had been doing so on a large scale for around a decade. Having a better-integrated datastore that can present multiple views of the same data is another way to achieve that, if you want to keep the migration out of the "application" code.
- berkes 4y agoMore practically: for example, I write my web service(s) with event sourced architecture. Now any worker, or any service sending a command, can operate against the storage. Regardless of version. Other architectural patterns offer the same kinds of options. Clean architecture or hexagonal architecture limits the surface (coupling) between your versioned logic and the data so much, that they can version independent. Alas, most web development uses some ORM as the center of the app. Active record, for example. An architecture known for its immense and tight coupling to the database. An architecture that has as major downside that businesslogic cannot evolve separate from the data store. Your parent commentor very likely is, unaware, running into this downside and projects that experience to all of web development.
- throwawaylala1 4y ago> More practically > event sourced architecture You must be joking. Please tell me you're joking.
- lmm 4y agoIt really is a lot more practical. Most webapp devs using SQL databases spend a bunch of time engineering some notional failover into their app that's completely undermined by using a non-HA datastore, a bunch more time mapping data to and from square tables where it doesn't really fit, and end up with a system that's still last-write-wins at the user-facing level. And the ones where it isn't aren't because they used those SQL transactions, but because they wrote their own versioning layer on top.
- berkes 4y agoI'm not joking. You are missing (or deliberately leaving out) context: I'm not saying event sourcing is a more pragmatic (practical) solution. I'm giving an example from practice.
- WA 4y agoSo what’s a good web app datastore in your opinion, if SQL is highly overrated? > Storing old data as-is What does this mean? Can you give an example?
- lmm 4y ago> So what’s a good web app datastore in your opinion, if SQL is highly overrated? I've used Cassandra very successfully, but there are plenty of options. > > Storing old data as-is > What does this mean? Can you give an example? I mean not migrating the stored version of old data (note I'm not suggesting "no schema" or anything like that; what I'm opposing is the idea that you have a single global mutable version of the schema and mutate historical records in place to match that). E.g. if you started by storing users with a single nationality field and then realised that actually the same user can have multiple nationalities, while you'd change the DTO representation of a user that you read into, you wouldn't rewrite the on-disk representation of previously stored users.
- dmingod666 4y agoCassandra is horribly inflexible.. you cannot use where conditions in any fields other than the PK (assuming you're not going to use ALLOW FILTERING for all your queries) and if your data isn't going to grow beyond baby size where allow filtering is okay, then you probably don't need a whole distributed java app running. Just do sqlite or newer local file storage dbs etc. SQL has earned its place due to the expressiveness and flexibility .. you may hold your opinions but you'll hardly find anyone who would take 'SQL is overrated' seriously.
- nicky0 4y agoIt means instead of migrating the database, you just leave it as it is. New code will expect to see both the old and new record formats.