Sharding and More
    weng.wei@zalora.sg
• Sharding is about scaling
• scaling up VS scaling out
Scaling Out


• Add more nodes
• Each node shared nothing
Key / Value


• server = serverlist[ hash(key) %
  len(serverlist) ]
Relational DB


• On Primary Key
• On Index
Middle layer


• MySQL Proxy
Client Side


• Memcached client
• ORM
Limitation

• No joining
 • Join on the same shard is OK
• Data maintenance
Pre-Sharding


• Move database is easier than move data
Problem of sharding


• serverlist[ hash(key) % len(serverlist)
Consistent Hash


• ketama from last.fm
 • De facto Standard for memcached
Do we use sharding?


• Memcached Client
• MySQL for different ventures
SQL vs NoSQL


• NoSQL is “Not Only SQL”
• NoSQL completes SQL, but not replaces it
NoSQL is about

• Performance?
• Scaling (easier to shard)?
• Flexibility (schema-less)?
Performance

• Memcacahed is faster than MySQL?
• SQL faster than K/V?
• Memory faster than disk?
MySQL for K/V


• handler socket
Schema - less


• Friendfeed’s solution
 • Table as secondary index, then shard
• No silver bullet
• Trade off

More Related Content

PPTX
Top best django hosting providers
PPTX
Enterprise Reporting: Couchbase N1QL, ODBC and JDBC
PDF
Scaling the Web: Databases & NoSQL
PDF
Writing Space and the Cassandra NoSQL DBMS
PPTX
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
KEY
Drupal High Availability High Performance 2012
PDF
Meanstack Introduction by Kishore Chandra
PPTX
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Top best django hosting providers
Enterprise Reporting: Couchbase N1QL, ODBC and JDBC
Scaling the Web: Databases & NoSQL
Writing Space and the Cassandra NoSQL DBMS
Dropping ACID: Wrapping Your Mind Around NoSQL Databases
Drupal High Availability High Performance 2012
Meanstack Introduction by Kishore Chandra
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...

What's hot (20)

PPTX
Javascript for Wep Apps
PPTX
Functional Css
PPTX
Introducing project spartan
PDF
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
PPT
Aiki Framework in 32 Slides
PDF
Building an E-commerce website in MEAN stack
PDF
SharePoint on Imaginary Hardware - IndyTechFest 2010
PPTX
Random thoughts on sql server performance
PPTX
Cassandra on EPAM Cloud
PDF
PDF
Tis the Season to Scale
PPT
Simple Db & Dynamo Db
PDF
MEAN Stack
PPTX
Part One: Building Web Apps with the MERN Stack
PPTX
SQL Azure for ISUG(SQL Server Israeli User Group)
PDF
Short introduction to Redis
PDF
Managing users and aws accounts
PPTX
Node ts1
PDF
Multi-tenant Database Design for SaaS
PPTX
.Less - CSS done right
Javascript for Wep Apps
Functional Css
Introducing project spartan
(SPRING)KAFKA - ONE MORE ARSENAL IN A DISTRIBUTED TOOLBOX
Aiki Framework in 32 Slides
Building an E-commerce website in MEAN stack
SharePoint on Imaginary Hardware - IndyTechFest 2010
Random thoughts on sql server performance
Cassandra on EPAM Cloud
Tis the Season to Scale
Simple Db & Dynamo Db
MEAN Stack
Part One: Building Web Apps with the MERN Stack
SQL Azure for ISUG(SQL Server Israeli User Group)
Short introduction to Redis
Managing users and aws accounts
Node ts1
Multi-tenant Database Design for SaaS
.Less - CSS done right
Ad

Viewers also liked (7)

KEY
我对ORM的思考
PPTX
用PY实现"Go元编程"
PDF
About Caching
PDF
谈谈缓存
PDF
Why use Go for web development?
PDF
Metaprogramming Go
PDF
Migrate PHP E-Commerce Site to Go
我对ORM的思考
用PY实现"Go元编程"
About Caching
谈谈缓存
Why use Go for web development?
Metaprogramming Go
Migrate PHP E-Commerce Site to Go
Ad

Similar to Sharding (20)

PDF
Voldemort Nosql
KEY
Non-Relational Databases at ACCU2011
PPTX
NoSQL
PDF
Optimize MySQL For Developers-Qcon2011
PDF
Optimize MySQL performance for developers
PPTX
Introduction to Data Science NoSQL.pptx
PPTX
Big Data (NJ SQL Server User Group)
PPTX
Big Data Platforms: An Overview
PPTX
Cassandra an overview
PDF
Cassandra Core Concepts
PPTX
PPTX
PPTX
MySQL HA Sharding-Fabric
PDF
MariaDB Server Compatibility with MySQL
PPTX
Using MySQL Fabric for High Availability and Scaling Out
PDF
Cassandra Core Concepts - Cassandra Day Toronto
PPTX
Revision
PPTX
HBase in Practice
PDF
HBase Advanced - Lars George
PPTX
HBase in Practice
Voldemort Nosql
Non-Relational Databases at ACCU2011
NoSQL
Optimize MySQL For Developers-Qcon2011
Optimize MySQL performance for developers
Introduction to Data Science NoSQL.pptx
Big Data (NJ SQL Server User Group)
Big Data Platforms: An Overview
Cassandra an overview
Cassandra Core Concepts
MySQL HA Sharding-Fabric
MariaDB Server Compatibility with MySQL
Using MySQL Fabric for High Availability and Scaling Out
Cassandra Core Concepts - Cassandra Day Toronto
Revision
HBase in Practice
HBase Advanced - Lars George
HBase in Practice

More from Weng Wei (9)

PDF
Fastest golang ORM implemented with generic
PPTX
Go for web
PDF
Go for web
PDF
Python to go
PDF
论使用Python开发推荐引擎的优越性
PDF
Zalora php to_go
PDF
A byte of git
KEY
My understanding of Git
KEY
Inside Zend Framework
Fastest golang ORM implemented with generic
Go for web
Go for web
Python to go
论使用Python开发推荐引擎的优越性
Zalora php to_go
A byte of git
My understanding of Git
Inside Zend Framework

Sharding

Editor's Notes