由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 非面试题, 这个系统该怎么设计?
相关主题
秒杀设计题内推苹果itunes部门
G家店面design题目求高手解答cs 面试题?
Samsung Research America Server组内退来,周末福利,cap理论里面的三种策略 (转载)
这两个设计题如何答?多个数据中心保持数据一致
FB设计题求教。我的System Design总结
大家不是说要多准备设计么,来一道google设计面试题目再来继续比较,芒果和redis各什么时候用比较好?
老年马工赶快去 fbKV store 还需要memcache吗?
请问最热的nosql是哪个?L家系统设计一题讨论
相关话题的讨论汇总
话题: bxx话题: axx话题: 1ms话题: 找出话题: 对应
进入JobHunting版参与讨论
1 (共1页)
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.

相关主题
大家不是说要多准备设计么,来一道google设计面试题目内推苹果itunes部门
老年马工赶快去 fb求高手解答cs 面试题?
请问最热的nosql是哪个?来,周末福利,cap理论里面的三种策略 (转载)
进入JobHunting版参与讨论
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啊

相关主题
多个数据中心保持数据一致KV store 还需要memcache吗?
我的System Design总结L家系统设计一题讨论
再来继续比较,芒果和redis各什么时候用比较好?一道有意思的设计面试题--天气预报Service
进入JobHunting版参与讨论
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.
相关主题
非常常见的面试题:数据太多,用MySQL查询太慢该怎么办?G家店面design题目
今天onsite某公司 纠结在一个design question上了Samsung Research America Server组内退
秒杀设计题这两个设计题如何答?
进入JobHunting版参与讨论
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.

1 (共1页)
进入JobHunting版参与讨论
相关主题
L家系统设计一题讨论FB设计题求教。
一道有意思的设计面试题--天气预报Service大家不是说要多准备设计么,来一道google设计面试题目
非常常见的面试题:数据太多,用MySQL查询太慢该怎么办?老年马工赶快去 fb
今天onsite某公司 纠结在一个design question上了请问最热的nosql是哪个?
秒杀设计题内推苹果itunes部门
G家店面design题目求高手解答cs 面试题?
Samsung Research America Server组内退来,周末福利,cap理论里面的三种策略 (转载)
这两个设计题如何答?多个数据中心保持数据一致
相关话题的讨论汇总
话题: bxx话题: axx话题: 1ms话题: 找出话题: 对应