In-memory column-store database

xuanbao · · 677 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Is there any in-memory column-store in Go?</p> <p>I want to set my de-normalized data in a in-memory cache/db, but I have varying columns.</p> <p>So if I have an EAV table, I&#39;ll just transform it to a column-variable cache to speed up queries (mainly sums, multiplications and grouping). </p> <p>I thought about using Cassandra, but it&#39;s a bit too much to setup, and the application isn&#39;t that big right now, and just deploying one Go app is better.</p> <p>Even if not in-memory, as long as it&#39;s column-store and embedable .</p> <hr/>**评论:**<br/><br/>no1youknowz: <pre><p>I was going to suggest memsql, <a href="http://www.memsql.com/" rel="nofollow">http://www.memsql.com/</a> but I am not sure it&#39;s embedable. Feel free to join their slack channel, which devs frequent and ask there.</p></pre>Emacs24: <pre><p>Is Cassandra columnar?</p> <p>You can try <a href="http://clickhouse.yandex" rel="nofollow">Clickhouse</a>: it is a lot easier to setup on a single machine (cluster setup is not that easy though).</p> <p>I wrote a couple of packages to deal with data insertion in a type safe manner (and they are no slouch when it comes to the insertion speed) at my last job where we used Clickhouse:</p> <ol> <li><a href="https://github.com/sirkon/ch-encode" rel="nofollow">ch-encode</a> to generate serializing objects for given tables</li> <li><a href="https://github.com/sirkon/ch-insert" rel="nofollow">ch-insert</a> provides data insertion via HTTP and buffering</li> </ol> <p>And there&#39;s a <a href="https://github.com/mailru/go-clickhouse" rel="nofollow">database/sql driver working via HTTP interface</a></p></pre>jerf: <pre><blockquote> <p>Is Cassandra columnar?</p> </blockquote> <p><a href="https://www.quora.com/How-is-Cassandra-a-columnar-database" rel="nofollow">No</a>. And to be clear, this is in the spirit of helpfulness for all concerned, not criticism, since a short post with just &#34;No&#34; comes off harsh.</p></pre>drink_with_me_to_day: <pre><p>I&#39;m not sure if Cassandra is columnar, I might have used the wrong word in the post, what I need is just dynamic columns.</p></pre>Emacs24: <pre><p>Got it. Clickhouse may not work for you indeed, I make a transition of column-store into columnar (column store is frequently used a synonym for columnar).</p> <p>You rather need document based DB. This may work: <a href="https://github.com/HouzuoGuo/tiedot" rel="nofollow">https://github.com/HouzuoGuo/tiedot</a></p> <p>But there&#39;s a chance CH still suits your needs: how &#34;dynamic&#34; are your dynamic columns? There might be the case you have a wide (thousands of them) pre-known set of columns, not really dynamic columns. Columnar DB will work for you in this case.</p></pre>SQLServerIO: <pre><p><a href="https://github.com/golang/groupcache" rel="nofollow">https://github.com/golang/groupcache</a> maybe? It isn&#39;t strictly a column store but an embedable cache</p></pre>jerf: <pre><p>How big is your data? Are you distributed? Because if the answers are &#34;fits comfortably in RAM I can afford&#34; and &#34;no&#34;, my first thought would be to just write some code that does the thing you want. And if the answers are anything else, details will be very helpful in answering the question. A bit more characterization around what data you already have and the kinds of summaries you want would be helpful, too.</p></pre>drink_with_me_to_day: <pre><p>Not distributed, and currently not that big. The 35k rows stored in jsonb is around 8MB, very little and I shouldn&#39;t need more than 1GB at a time (already considering the future). The data should fit in ram, and at worse, just throwing more ram at it is a feasible solution. I can&#39;t see it needing more than 32GB, ever.</p> <p>It&#39;s basically analitics data that needs to be transformed (f =&gt; x +y * 10, if x == &#39;certain_key&#39;), but I need to allow on-the-fly filtering on the frontend.</p> <p>So my basic needs are to store everything in memory for fast response times over websocket, but I also need some performant transformation abilities, like count(), sum(), group by, etc.</p> <p>This could all be done in BI software like Tableau and the likes, but it&#39;s integrated to something else and can&#39;t be separated.</p> <p>I could just keep a cache, but I&#39;m not sure I&#39;d get the same performance when doing grouping and transformations that a heavy-duty DB already has.</p></pre>ofpiyush: <pre><p>I&#39;ve a similar use case coming up in a week. Would love to hear about your solution and the reasons behind it.</p></pre>ecnahc515: <pre><p>Is there any specific reason you need it embeddable? Why can&#39;t you run something like Postgres on the same machine as the app using localhost or a unix domain socket. Postgres is supported on all major platforms.</p></pre>iroflmaowtf: <pre><p>this would be my first choice: postgres + unix socket</p></pre>drink_with_me_to_day: <pre><p>I already use postgres and jsonb, but queries still take a bit too long. I need sub-500ms queries.</p></pre>addos: <pre><p>Druid</p></pre>diegobernardes: <pre><p>Take a look at BoltDB and Badger. Its 100% in Go.</p></pre>TheMerovius: <pre><p>Neither of those is in-memory <em>or</em> a column store.</p></pre>diegobernardes: <pre><p>Actually they are, both use mmap, so, if you have enough memory, the OS gonna keep everything in memory. About the column, just serialize a array and you have columns. </p></pre>TheMerovius: <pre><blockquote> <p>Actually they are, both use mmap, so, if you have enough memory, the OS gonna keep everything in memory.</p> </blockquote> <p>That is not the same as an &#34;in-memory database&#34;, but fair enough.</p> <blockquote> <p>About the column, just serialize a array and you have columns.</p> </blockquote> <p>Literally the opposite of what a column store is.</p> <p>(not saying that you can&#39;t implement a columnar database on top of a key-value store - but what you are saying is a little bit like saying &#34;boltdb is a perfectly fine SQL database&#34;, just because it&#39;s possible to put an SQL engine on top of a key-value store)</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

677 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传