S*w
2 楼
F的message设计,类似hdfs
有一个Directory, 当master
有n个data nodes
我的理解是
用户被分到其中data nodes中.
这个信息存在directory中
当发信给user_id, 要做
1. 连接directory service, 查找user_id的node
2. 把信存到[email protected]的记录里
有个问题
directory service 需要内存
假设1.5B user, 每个mapping 用10 byte
15B byte = 15G 内存
但是这么多request都到了directory service,
只是读还好, 可以load balancer
但是写怎么办
这里需要一个 concurrent hashmap,
lock, etc
性能总有限制啊?
有一个Directory, 当master
有n个data nodes
我的理解是
用户被分到其中data nodes中.
这个信息存在directory中
当发信给user_id, 要做
1. 连接directory service, 查找user_id的node
2. 把信存到[email protected]的记录里
有个问题
directory service 需要内存
假设1.5B user, 每个mapping 用10 byte
15B byte = 15G 内存
但是这么多request都到了directory service,
只是读还好, 可以load balancer
但是写怎么办
这里需要一个 concurrent hashmap,
lock, etc
性能总有限制啊?
c*2
3 楼
能这样转, check I-539 processing time at your service center
p*2
4 楼
为什么不能用in memory db?
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
l*g
6 楼
为何mapping要占内存要lock?如果只是一个算法呢?
w*z
7 楼
你可以设计算法,(consistent hash or something like that) 从 userID 就能知道
是哪个node。For distributed system, you don't want to have a global mapping.
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
是哪个node。For distributed system, you don't want to have a global mapping.
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
g*g
8 楼
Check Cassandra, Memcached, Redis design and you'll understand. The userId
can be hashed and distributed in a cluster. And any single piece of data can
be further replicated, consistency can be reached as long as read+write >
replication factor.
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
can be hashed and distributed in a cluster. And any single piece of data can
be further replicated, consistency can be reached as long as read+write >
replication factor.
【在 S***w 的大作中提到】
: F的message设计,类似hdfs
: 有一个Directory, 当master
: 有n个data nodes
: 我的理解是
: 用户被分到其中data nodes中.
: 这个信息存在directory中
: 当发信给user_id, 要做
: 1. 连接directory service, 查找user_id的node
: 2. 把信存到[email protected]的记录里
: 有个问题
S*w
10 楼
谢谢
Cassandra 我大概知道是用consistent hashing
没有master
应该没用户global mapping
所以你的意思是 其实这里不需要存mapping
用consistenthashing方法查询use id 的shard?
多谢指点
can
【在 g*****g 的大作中提到】
: Check Cassandra, Memcached, Redis design and you'll understand. The userId
: can be hashed and distributed in a cluster. And any single piece of data can
: be further replicated, consistency can be reached as long as read+write >
: replication factor.
Cassandra 我大概知道是用consistent hashing
没有master
应该没用户global mapping
所以你的意思是 其实这里不需要存mapping
用consistenthashing方法查询use id 的shard?
多谢指点
can
【在 g*****g 的大作中提到】
: Check Cassandra, Memcached, Redis design and you'll understand. The userId
: can be hashed and distributed in a cluster. And any single piece of data can
: be further replicated, consistency can be reached as long as read+write >
: replication factor.
S*w
14 楼
谢谢 大家指点
如醍醐灌顶
如醍醐灌顶
相关阅读
有人搞eventmachine吗?转: 为什么Web App的运行速度慢c++ programmer们就不用悲愤了我看大家吵来吵去,最后的结论是?全球最受欢迎的网站和编程语言有1 分钱关系?什么风格是pythonic?拿c++和汇编作比较的肯定没文化我也来说说web技术吧能发自学日志么?Re: 给小孩儿存钱那种方式最好啊?? (转载)关于王先生的讨论是否可以适可而止谈一下王垠当年制造出的一个大麻烦诺基亚的事情, 意料之外, 情理之中asynchronous vs non-blocking我觉得这哥们真牛B请教算法: 三等分石子java programmer们不用太悲哀Best way to write C++ code玩了玩emscripten有个网站不错,讲基础的东西很清楚明白