Hacker News new | ask | show | jobs
by jaequery 2908 days ago
sql is great but i am still waiting for the succesor to sql. sql was made for relational data. but a relational data with nested data structure kind of like postgres and jsonb built in mind from the ground up is what id really like to see.
4 comments

Why? What problem do they solve that RE can't, other than putting the "consuming service" data structure into the database, instead of putting the data into the database and selecting appropriately? I've not seen a good justification for these things yet, other than "convenience" so the client "needs less code to structure the data", which is almost always a false saving.
Most data is relational. Even if you think it isn't relational, it probably is still relational.

Also if you think you have unstructured data but you need to interpret every bit of that data, then it's not unstructured.

kdb+ has a variant of SQL which is an evolution (not a revolution). The advances basically fall into three categories:

1. Shortcuts, such as "foreign key chasing" - i.e., if "a" int table x is a reference to field b in table y then "a.c" is "select c from x inner join y on (x.a=y.b)"; If you have a star schema, it cuts down queries and errors by 90% (and makes life simple for the optimizer). Of course, you can chase through as many tables as you wish in an expression, making item tables look a lot more like records.

2. Embracing order; The relational model has no ordering among tuples; SQL mostly pretends that's the case, but the order does emerge through "ORDER BY / TOP" and "ROWID" but not very usefully so. kdb+ embraces order and makes e.g. "first record that ..." very simple and intuitive (and also easier for the optimizer).

3. Embracing time series (not independent from embracing order) - when you have e.g. records with a "from .. to" validity range, it becomes exceedingly simple, as does "all records that are different from the previous one on this field".

Look at IMS or CODASYL from the 70s, or xml/object databases from the 90s. They did what you’re asking for.

Both times, the eventual consensus was that sql was simpler to implement and use, but maybe marginally slower. Then machines got faster, so SQL dominated the market for decades.