+ All Categories
Home > Documents > Gizzard, DAL and more

Gizzard, DAL and more

Date post: 15-Jan-2015
Category:
Upload: fulin-tang
View: 4,065 times
Download: 4 times
Share this document with a friend
Description:
About Twitter's distribute db sharding framework, and Data Access Layer from iMobile, and a Discuss
Popular Tags:
16
gizzard, DAL and more @tangfl 2011.2.22 11年2月28日星期一
Transcript
Page 1: Gizzard, DAL and more

gizzard, DAL and more

@tangfl

2011.2.22

11年2月28日星期一

Page 2: Gizzard, DAL and more

gizzard 1

• sharding framework

• extract from FlockDB

• written in Java/Scala

11年2月28日星期一

Page 3: Gizzard, DAL and more

gizzard 2

• middle ware :

• like mysql-proxy ?

• any backends

• like mytrigger ?

• adapter ?

11年2月28日星期一

Page 4: Gizzard, DAL and more

gizzard 3

• rules: forwarding table

• maps key ranges to partitions

• replication tree

11年2月28日星期一

Page 5: Gizzard, DAL and more

gizzard 4

• eventually consistent

• idempotent : f(f(n)) = f(n)

• commutative : f(a) + f(b) = f(b) + f(a)

• retry queue

11年2月28日星期一

Page 6: Gizzard, DAL and more

gizzard 5

• gracefully failures

• read : route to remain ones

• write : make high priority to remain replicas if any in a shard are unavailable

• retry queue

11年2月28日星期一

Page 7: Gizzard, DAL and more

gizzard 6

• gracefully migrations

• replica tree

• WriteOnly shard

11年2月28日星期一

Page 8: Gizzard, DAL and more

gizzard 7

• summary

• nothing new

• Get work done

11年2月28日星期一

Page 9: Gizzard, DAL and more

DAL 1

• Data Access Layer

• from iMobile

• by longker, simaliu and fulin

• Not only sharding

11年2月28日星期一

Page 10: Gizzard, DAL and more

DAL 2

• data table, hash by pri id, less index

• index tables, hash by any “where field” on demand

• front php devs : I don’t care !

11年2月28日星期一

Page 11: Gizzard, DAL and more

DAL 3

• insert / update / delete : auto update index table

• query : analyze sql, choose best index table

11年2月28日星期一

Page 12: Gizzard, DAL and more

DAL 4

• build-in cache : php don’t care about cache anymore

11年2月28日星期一

Page 13: Gizzard, DAL and more

DAL 5

• any backend

• treat Lucene just like mysql : select field from table where condition

• no replica

• backend do the job

11年2月28日星期一

Page 14: Gizzard, DAL and more

DAL 6

• summary

• nothing new

• Get work done

11年2月28日星期一

Page 15: Gizzard, DAL and more

more• Discuss

• fans_all list in redis

• vary from 0 to 500w

• single hash at most 5000

• auto resharding

• async

11年2月28日星期一

Page 16: Gizzard, DAL and more

Thanks

• @tangfl http://t.sina.com.cn

• http://blog.fulin.org

11年2月28日星期一


Recommended