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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

FoundationDB's Lesson: A Fast Key-Value Store Is Not Enough

94 点作者 jermo大约 10 年前

5 条评论

jandrewrogers大约 10 年前
The underlying organization of a database is not about what can be expressed in theory, it is about what can be expressed <i>efficiently</i>. Not only is there a very rich set of data structure designs that can be used with varying tradeoffs, but most sophisticated databases use an ecosystem of different, tightly interwoven data structures that smooth over the sharp corners that any single data structure has.<p>Efficient expressiveness follows from the relationships directly preserved in the organization. Generally from least-to-most expressive you have:<p>- cardinality preserving (hash tables, most KV stores)<p>- order preserving (LSM, btree, skiplist, space-filling curves*)<p>- space preserving (space decomposition e.g. quad-tree, a zoo of exotics)<p>Competent implementation is progressively more complex, nuanced, and sophisticated as you go down the list, so most implementations reflect the comfort level of implementor. As you move down this stack, you can express things efficiently that will be very inefficient to express with a less expressive class of organization.<p>SQL was designed for databases built on order-preserving structures. While you can implement it on a KV store, it will never be as efficient as a database organized in the more expressive organization that SQL assumes.<p>KV stores are popular because they are relatively simple to design and implement, not because they are expressive. It is an architectural impedance mismatch to add query functionality that tacitly assumes a more expressive organization. It will never perform well against a database actually organized for the expressiveness of the query layer.<p>Any database can only do a few things really well. It is inherent in the tradeoffs. You can add mediocre support for a laundry list of other &quot;good enough&quot; capabilities but you never want to market and position your product around those mediocre capabilities.
评论 #9307572 未加载
gtrubetskoy大约 10 年前
Regarding SQLite using FoundationDB as k&#x2F;v, I got inspired by that comment to do the same thing with Redis instead: <a href="http:&#x2F;&#x2F;grisha.org&#x2F;blog&#x2F;2013&#x2F;05&#x2F;29&#x2F;sqlite-db-stored-in-a-redis-hash&#x2F;" rel="nofollow">http:&#x2F;&#x2F;grisha.org&#x2F;blog&#x2F;2013&#x2F;05&#x2F;29&#x2F;sqlite-db-stored-in-a-redi...</a> (and it was quite slow too)<p>I&#x27;m curious though - databases typically store data in B-Trees which are blocks of equal size which works great for block storage. So isn&#x27;t &quot;block storage&quot; essentially a key value store, where the key is the block number and the value is the block itself? <i>That</i> I think is the proper way of using a key&#x2F;value store as the database back-end. (And that&#x27;s what I did in my SQLite&#x2F;Redis experiment, BTW)
评论 #9307206 未加载
orand大约 10 年前
Hmm, a previous competitor slamming them only after they&#x27;re certain FoundationDB&#x27;s gag order will prevent a rebuttal. Classy.
评论 #9306853 未加载
评论 #9306804 未加载
评论 #9306736 未加载
评论 #9307209 未加载
arthursilva大约 10 年前
Their SQL layer architecture is indeed chatty.<p>If I remember correctly they were doing&#x2F;planing a lot of optimizations like:<p>1. delaying requests a little on purpose to take more advantage of batch requests<p>2. fancy techniques to improve join locality (based on Akibans previous work).<p>These two go hand-to-hand.<p>So in a good enough network (aka not any public cloud) it&#x27;d probably work reasonably well up to a point.
评论 #9307291 未加载
shin_lao大约 10 年前
I think quite the contrary it can be quite enough and it should not be spoiled with an SQL engine.<p>In which case it is a bit silly and you get the worst of both world.