r/programming • • 2d ago

Dragging SQL into the '90s

https://www.youtube.com/watch?v=O9XRIgwDbMw
33 Upvotes

9 comments sorted by

5

u/wheatBread 2d ago edited 2d ago

Glad to finally have a video introduction to Acadia!

I hope the historical context is interesting, and I am curious if it'll help with any ORM questions left unanswered by the details on Solving the 1+N Query Problem.

1

u/Drawhoe 2d ago edited 2d ago

This was also solved by Persism a while back. It allows for compound objects containing other objects and removes the N part. If you had Customer -> Invoices -> LineItems -> Product you would only ever get 4 queries to the DB no matter how you queried for customers.

21

u/beders 2d ago

Acadia code is compiled against your actual database

Interesting but impractical.

And as with many many other ORM-likes you can only operate this under the assumption that your app is fully controlling the database.

That assumption often turns out to be false.
Good for you if it doesn’t but the moment your schema and schema migration is controlled by a different org you will have to stay flexible with regards to existing tables/columns.

Databases are dynamically typed in the sense that “types” can change at runtime.
I doubt that trying to shoehorn a static type system on it is hugely valuable. It’s nice if it catches bad sql at compile time but is that a huge time saver? Doubtful.
A DB is a second party that advertises its schema: use it - at runtime.

I do like the built in policy feature - but again - this can fall apart once your app is no longer the single user of the schema.

7

u/w1n5t0nM1k3y 1d ago

Sometimes it's just nice to be able to query the data with ad-hoc queries that are only ever going to be used once. That's part of the great thing about the database just existing on it's own outside of the application.

Sometimes you actually want to write separate applications that all access the same data set and maybe even use different languages for those applications, so you might not be able to share code between them.

5

u/GabiTheProgrammer 1d ago

Very solid point. "Who controls the schema?" doesn't come up often enough.

5

u/TheRealStepBot 1d ago

Sql is dead, long live sql.

12

u/ReallySuperName 2d ago

I'm here for the popcorn. Anytime I or anyone else has suggested that maybe using a language with syntax that has roots in the 1950's isn't very good and perhaps it should be modernised people absolutely lose their shit and act like I'm attacking the SQL model when I am actually criticising the language itself.

5

u/zappini 1d ago

What's the successor to SQL (the language)?

3

u/safetytrick 1d ago

I'm just waiting for real useful modernization, most criticism I've seen is hopelessly naive. Even the interesting stuff I've read over the past 15 years tends to make me like SQL even more.