database highload solutions

22
Database highload solutions Observing. Comparing. Conclusion. Only free products.

Upload: larest

Post on 15-Jan-2015

777 views

Category:

Technology


3 download

DESCRIPTION

Its' unfinished slide show about free database highload solutions

TRANSCRIPT

Page 1: Database highload solutions

Database highload solutions

Observing. Comparing. Conclusion.

Only free products.

Page 2: Database highload solutions

INTROWhat we need?

Page 3: Database highload solutions

Demands

• High performance • Scalability• Durability• Complex analytic/statistics queries

Page 4: Database highload solutions

Products typesNonSql DatabasesPro:

High performance High scalability Document oriented

Contra: Impossibility to perform typical

web queries

SQL DatabasesPro:

Sql language Well known Any complex queries

Contra: Not enough performance Scalability*

*For observed database

Page 5: Database highload solutions

CompetitorsNON Sql Databases

• MongoDB• Redis, Memcache*

SQL Databases

• MySql and Clones• Postgres

* Key-value storage like memcacheDB

Page 6: Database highload solutions

SCALING STRATEGYTheory

Page 7: Database highload solutions

Scaling Strategy

o Scale back and Scale up.

1. Partitioning : split your tables.

2. Replications: Extend your servers farm and split ‘Insert/update/delete’ and ‘select ’ queries to Master/Slave(s) .

3. Sharding : split your databases.

Page 8: Database highload solutions

Scale Back and Scale UpWhat?Scale Back – remove/archive unused data.Scale Up – add more power(RAM,CPU) , disks.When?• When you can.• Your database get benefits from that.Changes in application:• No

Page 9: Database highload solutions

PartitioningWhat?Partitioning – split tables to logical parts by same criteria's. When?• You have big table(s) which utilize the biggest part of traffic.• Your queries ask only some parts of information.How?• Database do it work for you clearly for your application.Changes in application:• No

Example:You can have millions commentaries but in 99% you show only latest of them.

Page 10: Database highload solutions

ReplicationsWhat?Copying(sync or async) data from “master” server – to “slaves”(or other Master). The idea – read from slave, write to master.When?• You have much more “read” traffic then “write” one.How?• Databases have tools/solutions for replication.Changes in application:• Not big

Page 11: Database highload solutions

ShardingWhat?Split database into many smaller databases.There are:• Vertical sharding• Horizontal sharding

Page 12: Database highload solutions

Vertical shardingWhat?Split database into many database(servers) by functionalityWhen?• You have tables which functionalities do not cross.How?• You will split them manually.Changes in application:• Not so bigLacks• No more “JOINS” between these tables

Example:Commentaries table utilize 90% of traffic. Shard it vertically and move the table onto a

separate server.

Page 13: Database highload solutions

Horizontal shardingWhat?Split a big table into many serversWhen?• You have a huge table and it too big for one server.How?• You will split them manually.Changes in application:• A lotLacks• No more “JOINS” between this table and other. No more ‘dumb’

queries for the table.

Example:You have billions users. Split the table into few servers. Each server will contains same

table but with different data.

Page 14: Database highload solutions

SOLUTIONSPropositions

Page 15: Database highload solutions

Mysql

Page 16: Database highload solutions

Mysql Clone: Percona

Background: Pecona company.

Page 17: Database highload solutions

Mysql Clone: MariaDB

Background: Michael “Monty” Widenius – founder of Mysql.

Page 18: Database highload solutions

Mysql vs Clones

Page 19: Database highload solutions

Postgres

Background: Scape.

Page 20: Database highload solutions

The Best Mysql vs Postgres

Page 21: Database highload solutions

MongoDB

Background: Scape.

Page 22: Database highload solutions

Key-value storages

Background: Scape.