| Twitter | Del.icio.us | Comments (5) | | Edit

Comments Powered by Disqus

留言评论 | Comments (5)

难的是通用的auto-sharding

Both the question and solution need further elaboration.

RDB sharding model depends on real world business needs.
*If it has large merchants with of large amount of orders (for example, top 50 sellers count for 50% of orders) it makes sense to shard order/transaction data by buyer ids, meaning orders always exist in the same shards as buyer. Otherwise, putting all orders of a large merchant in one shard can cause inbalanced distribution of data and requests on certain shards with large merchants.
*If its sellers are mostly small/medium business with limited number of order volume, it really doesn't matter whether order data lives in buyer or seller shards.

以下为我的看法:

buyer seller
| |
| |
transaction
>
his_transaction


对交易表和交易历史表均按时间分片,交易成功置结束标志同时进历史表,交易表和历史交易表均保存规定时间长度的数据

至于:
(1) 活动交易表的IO热点,这个我不太明白,插入和更新都是不同的记录,应该也不存在两个owner同时改同一条交易记录的情况吧,怎么会有热点,除非buffer block级,分片后已经避免很少了
(2) 查询历史数据部分,这个查历史数据如限定时间范围,这个速度应该可以接受吧,如超出历史范围,则另外申请(做预计算再提供)

看看谁有别的看法??

三张表, 购买索引, 出售索引, 交易表

针对购买索引按用户ID进行分片
针对出售索引按用户ID进行分片
针对交易表按时间进行分片

每张表都分片了, 应该可以解决业务扩展了吧......

关于本文

这篇文章由 Fenng 于 December 9, 2009 10:50 PM 发布.

上一篇:OpenDNS 的统计(Stats)服务的实现.

下一篇:《软件随想录》(More Joel on Software).

回到 首页 查看最近发表的文章或者查看所有 归档文章.