We ported the original Doom to SQL
cedardb.com
cedardb.com
I still think HN is taking major naps on the capabilities of contemporary SQL.
There are businesses so complicated that maintaining procedural code over the domain is largely infeasible. Implementing business rules in SQL can decompose the problem in ways that allow for a lot more people to interact with it at the same time.
When I was working in semiconductor manufacturing, we relied very heavily on stored procedures and SQL to operate the factory. Very little operational decision logic existed in code. We had hundreds of users who were inspecting and proposing changes to the same set of procedures. Testing this stuff was trivial because we replicated the prod DB every morning and experimented against live data directly. There was no gap between the information of the business and its logic. Most shops are not ran this way. They treat the database like some CRUD retrieval engine instead of the nexus of both the data and logic.
When people advocate for spending big piles of money with Microsoft, Oracle and IBM, they are generally going for something like the above. They want literally one system the business operates inside of. Spreading a solution across 10+ vendors and tools when you could do with one is borderline negligence depending on your role in the organization.
Would you change your mind if I told you it would be giant strings with a bunch of `+ @database_name +` scattered around? Syntax highlighting is a crutch imo
(yes I refactored it to be parameterised yada, but for years those 2000 lines had grown and grown)
And now I'm in the process of replacing some of the more intensive data analytical stuff with DuckDB, which has been just an awesome experience.
Long live SQL!
When it really gets hairy, or when the business logic keeps changing under my feet, I'll try to find constraints I can put in the db as a final backstop while leaving most of the logic somewhere in the application stack.
I can count on one hand the number of people I've worked with that really know SQL well enough to pick up complex business logic at that layer and work with it easily. I've been mainly in small companies for the last decade, I'm sure at larger orgs there are more data engineers running around that could own it.
But nothing quite matches the satisfaction of someone in a far off engineering group reporting a problem that prevented them from committing data that would have corrupted the database - because your referential integrity constraints protected the database.
In the age of AI and a massive explosion of code touching the database, maybe it makes even more sense to embed logic and constraints inside the database where there's no way to get around them.
You may be storing logic in your database, but most businesses store data in their databases, and the amount of data they store (mostly because they can't tell what's important and what's not) makes copy-pasting their database every morning pretty unrealistic.
And those businesses can have all the pain of intertwingling their logic with their data model, too, wheee!
This is a cultural decision, not a technical decision, and unless I'm in the mood for a particular kind of swampy adventure in someone else's land, one I stay away from.
Looking back it seems like not a terrible design pattern for multiplayer turn-based games, if you can work out the kinks. Atomicity guarantees at least that there is a consistent state that won't get lost. Doing that read/write loop for an action game? Pure folly, but it's pretty funny to me.
https://www.oreilly.com/library/view/designing-data-intensiv...
Nice
Almost. In a way.
It even uses a ycombinator :D
Yeah, well, someone had to.