TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Beyond SQL: A relational database for modern applications

59 pointsby freelsalmost 2 years ago

19 comments

jmullalmost 2 years ago
I buy the need for something <i>like</i> FQL.<p>But I don’t buy that this should be connected to a proprietary service. Or that the alternative query language should be a proprietary language. For something long-term or critical, it seems like a pretty large business risk. We don’t have to use any imagination to see how this plays out — look at Oracle. Though it could be worse — imagine you build a successful business on it and they go belly up in ten years.<p>I think I’d like to see one of the various “XQL”s out there emerge as the modern query language and start getting adopted as a native alternative in existing engines.
评论 #37230418 未加载
评论 #37231586 未加载
resharpe105almost 2 years ago
I have to disagree with the following paragraph:<p>“SQL is particularly inflexible in terms of control over response: A query result is always a set of tuples. A query is incapable of returning a rich structure that is aligned with how the application needs to consume the result. ORMs solve this partially at best at the cost of hiding the capabilities of the underlying database. They also obscure the structure of generated queries, making it difficult to understand the resulting performance implications.”<p>The ORMs or later mentioned GraphQL are not the only approaches to solving object-relational impedance mismatch.<p>SQL is perfectly capable of serializing sets of tuples to XML (part of the SQL standard), and most SQL RDBMS implementations now support working with JSON data.<p>Serializing using SQL to XML and in the past couple of years to JSON, and deserializing the said XML&#x2F;JSON to an object model in the programming language of choice is something I’ve seen used fairly often in my career.<p>Heck, I’ve even seen entire business logic for a very complex system implemented via thousands of stored procedures that always returned XML. Prior to 2010, this was not the blasphemy it is made to be today…<p>So to reiterate my point, SQL is not inherently as inflexible as it was made to be here, thus neither ORM nor GraphQL are a necessity for dealing with SQL output inflexibility (and both can be very useful tools, as always, completely depending on the context).
评论 #37230363 未加载
评论 #37230991 未加载
bob1029almost 2 years ago
&gt; SQL query performance is opaque and dependent on an optimizer to make the right decision. The developer has imprecise control and a given query pattern&#x27;s plan of execution is subject to change at unpredictable times.<p>This is really hilarious framing to me.<p>The <i>entire point</i> is to make the whole process opaque to the developer (unless they insist upon explaining a query plan). SQL is about maximizing productivity and focusing on the information of the business. Being able to write a SELECT statement that has <i>never been seen by any other computer on earth</i> and have it execute ideally 95%+ of the time is pretty close to pure magic.<p>Why would you reset 20+ years worth of experience on an existing SQL query planner&#x2F;optimizer&#x2F;et. al.? Wouldn&#x27;t you rather build &amp; ship a working product?
评论 #37231615 未加载
rtpgalmost 2 years ago
One of my side ideas is to write a postgres plugin offering an alternative syntax for queries, but one that requires you to name the index you use (or to explicitly mention a table scan).<p>I do understand the value of SQL + the planner for adhoc querying. But so many times I find myself reworking SQL to hint at the planner to use certain indexes, or to add &quot;spurious&quot; filters to make sure an index is used (spurious for application logic reasons). For applications with a relatively low cardinality of queries, some extra tedium might be worth stronger performance property guarantees.<p>Added advantage of the tedium is it would make a lot of &quot;accidentally quadratic&quot; stuff much clearer. There is no magic in the planner after all!<p>We can write inline assembler in C or Rust, it feels like it would make sense to offer something similar in SQL. Big problem is how to offer something that isn&#x27;t too tedious.<p>Anyways FQL&#x27;s index model seems to align with my idea, just unsure if I want the rest of it.
评论 #37231373 未加载
评论 #37231748 未加载
rbransonalmost 2 years ago
Fauna is really cool technology, but I&#x27;ll note that it lacks interactive transactions as a core design constraint. That does enable a bunch of nice things. However, that means users lose one of the most useful parts of transactional SQL -- simple, safe read&#x2F;modify&#x2F;writes.<p>The only way is to ship all of the &quot;modify&quot; logic into the database via FQL. Given how many times I&#x27;ve seen code that does this unsafely with SQL, probably safe to say that if the bar is raised to &quot;rewrite the logic in a foreign query language&quot; developers will opt for thoughts and prayers instead.
评论 #37229975 未加载
pphyschalmost 2 years ago
This sales pitch sounds like they really just want to build a better ORM, but doesn&#x27;t want to admit it, so they embark on the foolish task of reinventing SQL.<p>&gt; ORMs solve this partially at best at the cost of hiding the capabilities of the underlying database.<p>This is because all the popular ORMs target SQL instead of a specific RDBMS technology, like Postgres or SQLite. That doesn&#x27;t have to be the case.<p>&gt; They also obscure the structure of generated queries, making it difficult to understand the resulting performance implications.<p>Not quite true, Django for example makes it easy to do raw queries, and every generated query has .query() and .explain() methods to analyze the resulting SQL. This has always been a lame excuse to dismiss ORMs.
SPBSalmost 2 years ago
Good luck though, you&#x27;re going up against giants (as much as this article portrays SQL as outdated, anyone who tries to go against it is very much the underdog). It&#x27;s hard to get people to buy in on a custom database stack that is made by only a single company. And the fact that this article reads like a one sided praise for Fauna doesn&#x27;t inspire confidence either, I want to read some real negatives from people who have used the thing.
Taikonerdalmost 2 years ago
A new DB, with a new query language that&#x27;s like &quot;SQL done right&quot;? This immediately reminded me of EdgeDB: <a href="https:&#x2F;&#x2F;edgedb.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;edgedb.com&#x2F;</a><p>Is there anyone here who knows enough about these two products to do a compare&#x2F;contrast?
yawnxyzalmost 2 years ago
I tried to learn Fauna and FQL a couple of years ago; their documentation was hard to trudge through with few examples, and their pricing was hard to grasp.<p>I think they also recently nerfed the free tier.<p>I&#x27;ve been using CouchDB and Pocketbase.io much more successfully for my mini web apps.
评论 #37229925 未加载
exabrialalmost 2 years ago
People re-inventing SQL reminds me of the same people that keep trying to re-write standard Staff Music Notation.<p>Yeah, it&#x27;s not perfect, but the suggested replacements are marginal gains, if anything.<p>In order to replace SQL, you probably need something like a 10x improvement, so it sells like hotcakes. Nothing about those examples screams that sort of improvement.<p>I mean, cool they put some stuff on the left instead of the right. And I guess the select clause is in a little better order now. Yay.
评论 #37231654 未加载
Neztebalmost 2 years ago
Of all the SQL flavors&#x2F;derivatives, I like PRQL the most: <a href="https:&#x2F;&#x2F;prql-lang.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;prql-lang.org&#x2F;</a><p>Previous HN discussion from a month ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36866861">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36866861</a>
talldatethrowalmost 2 years ago
I wrote my first self taught LAMP based miniSaas a few years ago. It has 34 paying companies using it with about 400 users total daily.<p>I want to write another soon. A free webapp saas type for consumers let&#x27;s say.<p>Is there a reason I should learn this product instead of just continuing with modern mysql methods that seem to work and seem secure enough?
评论 #37230182 未加载
评论 #37230416 未加载
elchiefalmost 2 years ago
Isn&#x27;t there one of these every 6 months on here?<p>Dread it, run from it, SQL arrives all the same
评论 #37231641 未加载
robocatalmost 2 years ago
It always disappoints me when the example code (in the heading image) looks like it has a mistake:<p>SQL: WHERE category = &quot;electronics&quot;<p>FQL: where(.product.type == &quot;Computers&quot;)<p>Also it changes case of USER to user between the two examples.<p>Minor mistakes like that hardly give one confidence in their product.
briandilleyalmost 2 years ago
I have yet to come across a replacement for SQL that makes it easier, or more concise, while also remaining feature rich. Not knocking this, but SQL is a pretty solid and time-tested technology for querying structured data. Alas, if we don&#x27;t experiment then I guess we wont get better.
评论 #37230839 未加载
评论 #37235461 未加载
chrnolaalmost 2 years ago
I’m having a hard time understanding this line:<p>“Developers cannot take advantage of the full power of the underlying database for fear that the complex, opaque nature of SQL query behavior will overwhelm their ability to understand how queries perform, and quickly address problems when they do come up.”<p>What does that mean? Developers are somehow sacrificing database performance (“full power”) because they’re too scared to write SQL?
评论 #37230889 未加载
prplalmost 2 years ago
is it pronounced fackle? fuckle? fickle? feeckle?
评论 #37231619 未加载
endisneighalmost 2 years ago
This bit:<p>&gt; maladapted to modern cloud computing abstractions such as serverless, and is difficult to manage at scale.<p>Got me.<p>There’s little money in it but working in an infra role for a while now - I don’t really see rolling your own infra as becoming any easier which is so sad.
cryptonectoralmost 2 years ago
&gt; Connection centric: SQL&#x27;s session-based transaction model is maladapted to modern cloud computing abstractions such as serverless, and is difficult to manage at scale.<p>There&#x27;s nothing connection-centric at all to the <i>language</i>.<p>&gt; Inflexibility of result structure: SQL is particularly inflexible in terms of control over response: A query result is always a set of tuples. A query is incapable of returning a rich structure [...]<p>Many modern SQL-based RDBMSes provide JSON support for this. Some support row&#x2F;record values, which is -in SQL- more natural than JSON.<p>&gt; Complicated, irregular syntax:<p>Well, few like the SQL syntax -- there is that. I wouldn&#x27;t say it&#x27;s complicated syntax though.<p>&gt; [...] and allows only limited forms of composition.<p>CTEs and subqueries are the main methods of composition in SQL.<p>&gt; Opaque, unpredictable performance:<p>Yes, well, yes, of course, because SQL is declarative. That the programmer gets little control over the query planner is part of the point of SQL. The <i>query language</i> really needs to be like this. What could and should be done however is to have a) ways of addressing parts of the query, b) ways of specifying out of band (i.e., not <i>in</i> the query) hints or requirements for parts of the query&#x27;s planning.<p>I really would like to be able to:<p><pre><code> - specify indexing for CTEs - be able to pass in hints from outside a query, like what table source to make the &quot;first&quot; in a query plan, what indices to use for specific table sources, where constraints, etc. </code></pre> &gt; Rigid tabular data model: Despite the theoretical adaptability of the relational model to many domains, the flat, uniform structure the traditional SQL database imposes on records is especially rigid, forcing a significant amount of upfront design.<p>I don&#x27;t agree that this is a problem. You have to design your schema? The horrors.<p>&gt; Introducing new query patterns and schema evolution is fraught with a significant amount of operational risk. Combined, these hinder iterative application development and risk locking in bad data model design decisions.<p>This is not exactly not true of alternatives to SQL-based RDBMSes...<p>TFA makes very strained arguments.<p>There are good arguments for a new language, but there&#x27;s no need to make strained arguments along the way -- it detracts from TFA.