Re:SQL is 43 years old – Here’s why we still use it today
by noobsquared on Tuesday May 02, 2017 @01:39PM
(#14248597)
Where can i learn more about this type modern SQL tools you mention? (Besides what you've just mentioned of course :D)
Re:SQL is 43 years old – Here’s why we still use it today
by flukus on Wednesday May 03, 2017 @02:05AM
(#14253406)
So now every time I add a column I have to update the schema as well. That's making change management harder, not easier.
Re:SQL is 43 years old – Here’s why we still use it today
by wwweston on Tuesday May 02, 2017 @02:57PM
(#14249448)
"PostgreSQL as an Application Server" is a book I'd be likely to buy.
Re:SQL is 43 years old – Here’s why we still use it today
by agentultra on Tuesday May 02, 2017 @10:51PM
(#14252663)
Like maybe https://agentultra.com/postgres-book.html ?
I don't always know the "perfect" schema design up front but there are great tools in the modern SQL tool belt for managing abstractions and evolving schemas.
In PostgreSQL:
The "crm" schema can store all of my customer relationship management related tables. I may not know all of the data I need for them right now and will need to evolve them over time. However if I start with a solid design for my public schema I can use views in the public schema: This is a simple view. You applications can CREATE/UPDATE/INSERT against the view in the public schema with no changes to your code. However if you want to evolve the schema of customers you can do so in the `crm` schema adding tables, columns, etc. You can then evolve your public schema to include more information as needed by updating the view. The caveat is that if your view starts materializing data from more than one table you'll have to intercept INSERT/UPDATE/DELETE and replace them with your own functions to put the data in the right place. This works quite well for implementing nice features like administrative flags without having to update your application code or spread that logic out: it's all kept in the database.You still get the power of indexes, a strong query language, and structured data. PostgreSQL is great as an application server allowing you to comment all of your objects and having deep introspection facilities allows you to not only be flexible with your data models but also consistent.
Update: Added an example of changing the public schema to add a filter to the query for an administrative flag