TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My other database is a compiler

27 点作者 alainchabat将近 3 年前

5 条评论

keyless_将近 3 年前
A long held view of mine is that our current architecture where we keep logic on the server and data in the database is rather unfortunate, because it means you either have to<p>* marshall data to your server to process (which can be slow), or<p>* marshall code to your db to run (which can be messy, in part because you&#x27;re translating from one programming language to your db&#x27;s language - this is the main reason ORMs exist)<p>I always thought that the solution is to have all computation live in the DB (similar to how kdb does it), but this is pretty nice too. If you squint your eyes this looks like a much cleverer ORM.<p>It would be even better if the language supported SQL as a first class citizen, but that&#x27;s not really an option here, since you&#x27;re stuck with js.
评论 #31816381 未加载
Zababa将近 3 年前
Isn&#x27;t this what an ORM does? You write &quot;User.findOne(user =&gt; user.name == &quot;Glauber Costa&quot; &amp;&amp; user.age &gt;= 40);&quot; and it will be translated into SQL. Maybe I&#x27;m missing something here, but I don&#x27;t see the innovation.
评论 #31765225 未加载
rurban将近 3 年前
newer postgresql also jit&#x27;s some queries in its new query optimizer.<p>but for such use-cases (exact matches, no range queries) it&#x27;s still better to compile a perfect hash at run-time into a .so&#x2F;.dll and load this at run-time. way faster.
AzzieElbab将近 3 年前
Interesting. Aligns with something Martin Odersky(creator of Scala) said a while ago
freemint将近 3 年前
I find it said that query plans an SQL database generated were not discussed more. Drawing this comparison and highlighting differences would have been very helpful.