w********s 发帖数: 1570 | 1 有很多这样的记录:
id1, (a11,a12,a13), (b11,b12,b13)
id2, (a21,a22,a23,a24), (b21,b22)
...
很多条, billion级
要解决的问题是
给出id,找出对应的axx, bxx, cxx
给出axx,找出对应的id
给出axx,找出对应的bxx
给出bxx,找出对应的id
给出bxx,找出对应的axx
...
怎么存,怎么查才能既节省空间又速度够快? | p*u 发帖数: 2454 | 2 Ordered indices
【在 w********s 的大作中提到】 : 有很多这样的记录: : id1, (a11,a12,a13), (b11,b12,b13) : id2, (a21,a22,a23,a24), (b21,b22) : ... : 很多条, billion级 : 要解决的问题是 : 给出id,找出对应的axx, bxx, cxx : 给出axx,找出对应的id : 给出axx,找出对应的bxx : 给出bxx,找出对应的id
| w********s 发帖数: 1570 | 3 详细点, 能达到1ms级别么?
【在 p*u 的大作中提到】 : Ordered indices
| p*****2 发帖数: 21240 | 4 每个id axx bxx 最多能有多少个?
【在 w********s 的大作中提到】 : 详细点, 能达到1ms级别么?
| w********s 发帖数: 1570 | 5 不定的,最多几千-1w也有可能, 大多数<50
【在 p*****2 的大作中提到】 : 每个id axx bxx 最多能有多少个?
| w********s 发帖数: 1570 | 6 忘记说了,这个系统每天有billion级的新纪录到来
系统要更新这些纪录, 并且7天以前的旧数据要删除
【在 p*u 的大作中提到】 : Ordered indices
| w********s 发帖数: 1570 | 7 你确认这个能work?每天billion级新数据到来,ordered index还要排序? 而且现在任何
一个column内的内容都要求能作为key查其他column.
【在 p*u 的大作中提到】 : Ordered indices
| w********s 发帖数: 1570 | 8 keys are sorted
你知道这里有多少个key么? 不固定的!
【在 p*u 的大作中提到】 : Ordered indices
| p*u 发帖数: 2454 | 9 sigh, u can define a variable M for maximum number of keys. e.g. when M=1000
, some of records hv 1000 keys while some only have a few keys. M can be
updated.
【在 w********s 的大作中提到】 : keys are sorted : 你知道这里有多少个key么? 不固定的!
| w********s 发帖数: 1570 | 10 can you estimate that system's performance?
1, how much storage?
2, delete/update speed?
3, how do you store that?
4, extreme query performance is required, while there are high frequency
updates, can it survive?
1000
【在 p*u 的大作中提到】 : sigh, u can define a variable M for maximum number of keys. e.g. when M=1000 : , some of records hv 1000 keys while some only have a few keys. M can be : updated.
| | | p*u 发帖数: 2454 | 11 happy 2 do these if u r a hot chick...
【在 w********s 的大作中提到】 : can you estimate that system's performance? : 1, how much storage? : 2, delete/update speed? : 3, how do you store that? : 4, extreme query performance is required, while there are high frequency : updates, can it survive? : : 1000
| p*****2 发帖数: 21240 | 12 read write througput 多少
【在 w********s 的大作中提到】 : can you estimate that system's performance? : 1, how much storage? : 2, delete/update speed? : 3, how do you store that? : 4, extreme query performance is required, while there are high frequency : updates, can it survive? : : 1000
| p*****2 发帖数: 21240 | 13 1ms是read吧?
write latency 多少?
consistency要求?
【在 w********s 的大作中提到】 : 详细点, 能达到1ms级别么?
| P******r 发帖数: 1342 | 14 每天几个G,七天删除。整个database就几十个G吧。 | p*****2 发帖数: 21240 | 15
what DB good for this scenario?
【在 p*u 的大作中提到】 : happy 2 do these if u r a hot chick...
| t*****3 发帖数: 112 | 16 The same case happened to me before. Oracle on a Dell PC server with 16
cores and 32GB handled more complicated query requests with just ms level.
【在 p*****2 的大作中提到】 : : what DB good for this scenario?
| w********s 发帖数: 1570 | 17 不是database的问题,这个表就可能超过100T, 远超mysql的最大限制
你倒是给个可以用的db啊
【在 P******r 的大作中提到】 : 每天几个G,七天删除。整个database就几十个G吧。
| w********s 发帖数: 1570 | 18 talk is cheap
流行的rdbms没有能handle这个数量级的, 甚至建index都变得不可行.
1000
【在 p*u 的大作中提到】 : sigh, u can define a variable M for maximum number of keys. e.g. when M=1000 : , some of records hv 1000 keys while some only have a few keys. M can be : updated.
| p*****2 发帖数: 21240 | 19 如果是真的系统 估计要做tradeoffs
【在 w********s 的大作中提到】 : talk is cheap : 流行的rdbms没有能handle这个数量级的, 甚至建index都变得不可行. : : 1000
| g****v 发帖数: 971 | 20 Default mysql is 256 TB. So in your case, you can try full-text indexing and
searching.
【在 w********s 的大作中提到】 : 不是database的问题,这个表就可能超过100T, 远超mysql的最大限制 : 你倒是给个可以用的db啊
| | | g*****g 发帖数: 34805 | 21 Cassandra, all you need is two tables.
One looks like
id1 -> (a11,a12,a13), (b11,b12,b13)
Another is an index looking like
axx -> id1, id2 etc.
TTL is built in so you don't need do nothing on 7 days purge.
【在 w********s 的大作中提到】 : 有很多这样的记录: : id1, (a11,a12,a13), (b11,b12,b13) : id2, (a21,a22,a23,a24), (b21,b22) : ... : 很多条, billion级 : 要解决的问题是 : 给出id,找出对应的axx, bxx, cxx : 给出axx,找出对应的id : 给出axx,找出对应的bxx : 给出bxx,找出对应的id
| w********s 发帖数: 1570 | 22 index在数据量大了之后insert非常慢
and
【在 g****v 的大作中提到】 : Default mysql is 256 TB. So in your case, you can try full-text indexing and : searching.
| w********s 发帖数: 1570 | 23 this is the initial design, I want to know if there are anything better.
【在 g*****g 的大作中提到】 : Cassandra, all you need is two tables. : One looks like : id1 -> (a11,a12,a13), (b11,b12,b13) : Another is an index looking like : axx -> id1, id2 etc. : TTL is built in so you don't need do nothing on 7 days purge.
| g*****g 发帖数: 34805 | 24 You could also add axx -> bxx index to avoid two lookups. That's about it.
Depending on the size of row, consistency level, caching configuration, < 10
ms lookup can be achieved.
【在 w********s 的大作中提到】 : this is the initial design, I want to know if there are anything better.
| p*****2 发帖数: 21240 | 25 他要的是1ms
这个级别要上in memory了 一般来说
10
【在 g*****g 的大作中提到】 : You could also add axx -> bxx index to avoid two lookups. That's about it. : Depending on the size of row, consistency level, caching configuration, < 10 : ms lookup can be achieved.
| p*****2 发帖数: 21240 | 26 而且没有提write latency 如果也是1ms就不好搞了 除非eventual consistency
【在 p*****2 的大作中提到】 : 他要的是1ms : 这个级别要上in memory了 一般来说 : : 10
| p*****2 发帖数: 21240 | 27 从性能来说当然有
redis couchbase 都可以考虑
但是一般设计是要看很多因素的
【在 w********s 的大作中提到】 : this is the initial design, I want to know if there are anything better.
| w**z 发帖数: 8232 | 28 1ms is impossible for Cassandra, as matter of fact, any db, if it hits
harddrive.
10ms is possible.
【在 p*****2 的大作中提到】 : 他要的是1ms : 这个级别要上in memory了 一般来说 : : 10
| g*****g 发帖数: 34805 | 29 <10ms is possible with SSD.
【在 w**z 的大作中提到】 : 1ms is impossible for Cassandra, as matter of fact, any db, if it hits : harddrive. : 10ms is possible.
| w**z 发帖数: 8232 | 30 yes. our 95th percentile read is around 10ms. 50th percentile is less than
3ms And we are using SSD.
【在 g*****g 的大作中提到】 : <10ms is possible with SSD.
| | | p*****2 发帖数: 21240 | 31 是 我的理解 1ms 要上memory db了
【在 w**z 的大作中提到】 : 1ms is impossible for Cassandra, as matter of fact, any db, if it hits : harddrive. : 10ms is possible.
|
|