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.

Storage engine design

179 pointsby chaotic-goodabout 8 years ago

7 comments

limaabout 8 years ago
It looks like Yandex recently open-sourced their Graphite engine they built on top of Clickhouse:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;yandex&#x2F;graphouse" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;yandex&#x2F;graphouse</a><p>Looks really interesting for Graphite-like use cases.
eisabout 8 years ago
I don&#x27;t think you want to measure your timeseries datastructure against LSM-trees because the latter is inherently a pretty bad structure to use for timeseries (which are mostly append-only) as a few projects painfully found out.<p>Anyways, I&#x27;m interested in timeseries so I read the article and tried to understand the datastructure but to be honest it opens up more questions than it answers. I applaud people though who try to describe their datastructures that are core to the app. Thanks for that.<p><pre><code> 1. What is the exact datastructure of a leaf? You mention a leaf node can hold 1000 datapoints. 2. Why is using a WAL impossible? That should be possible for any datastructure. 3. In your example if level 3 is full and everything gets merged into level 4, there are no levels 1-3. How does one query the datastructure? Does it maintain a pointer from the root to level 4? 4. Related to above: if I want to query all data from last month until now which happens to be the start of level 4, it will first go to root, then to the level 2 Leaf, from there to the level 2 SBlock, from there to the level 3 Leaf, then level 3 SBlock, then level 4 Leaf, then level 4 Sblock, then the first level 4 leaf? That seems a lot of random access. How many iops does a lookup need? 5. SBlocks need to be kept in memory. If I have ten million timeseries (not uncommon, can be much more), each with 3 levels, then upon startup the app has to load 30M SBlocks into memory? 6. You say that several trees can be interleaved in a single file, how does that not break the linear IO advantage of columnar layouts? 7. How do you store information in the &quot;inner nodes&quot; (SBlocks?) to speed up aggregation? Do you store every possible aggregation in there? E.g. sum, avg, min, max, stddev, ... 8. Storage format of an individual time series is only a part of what a TSBD needs to do, another part is how to find all the timeseries for a particular query. How does that work? </code></pre> And in general I think you can&#x27;t have all three:<p><pre><code> A) good write performance B) no write amplification C) low RAM usage </code></pre> ... because you have to either write data out immediately (and get either 2x+ write amplification or lots of random writes&#x2F;reads) or buffer it in RAM to batch linear writes.<p>I think there are some interesting ideas in this structure, it looks to me more like a Linked List of one level deep B+Trees, not a big overall tree.
评论 #14246953 未加载
评论 #14247010 未加载
menegattigabout 8 years ago
Good content for creating time-series database engines that was just posted on other HN thread:<p><a href="https:&#x2F;&#x2F;medium.com&#x2F;slicingdice-com-blog&#x2F;want-to-build-a-new-time-series-database-start-here-d4c3fd1517b1" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;slicingdice-com-blog&#x2F;want-to-build-a-new-...</a><p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14246189" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14246189</a>
evdevabout 8 years ago
What I&#x27;ve found matters in this area is the mismatch in locality between elements in read batches and elements in write batches. It&#x27;d be nice if the emerging DBs that deal with these issues put at least a gloss on the information model and write -&gt; read lifecycle they&#x27;re targeting.<p>Otherwise, a lot of these &quot;actually you need X for time series!&quot; are just talking past each other because &quot;time series&quot; means any number of actual patterns.
评论 #14250432 未加载
tianyicuiabout 8 years ago
It seems the kind of query for N time series at a specific timestamp or across a small span will be inherently slow because of O(N) block read? Is there some way to support this kind of query efficiently?
stuff4benabout 8 years ago
Fascinating stuff! How does this compare to other TSDB&#x27;s like Influx (which uses LSM-tree) and Druid?
评论 #14245931 未加载
batisteoabout 8 years ago
Yet another project with an Esperanto name