SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
*

© SkySQL Ab. Commercial in Confidence

*
CCM Escape Case Study
- Elastic Statistics Cluster
Damien Mangin, Nicolas Payart, Stéphane Varoqui

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Challenges
❏ Scale writes
❏ Should not hurt API performance
❏ Reduce the number of servers

*

© SkySQL Ab. Commercial in Confidence

*
ESCape candidates
❏ Redis
Cluster is it ?(work in progress). Is it so fast for writes?
❏ Riak - LeveDB - InnoDB
Do I really need Erlang for this? To store billions of entries use Innostore.
InnoDB is a robust and well-known storage engine. Performance aside it
appears that LevelDB may become a preferred choice for Riak.
❏ Cassandra – Hbase
Do I really need Java for this? 10K insert per node group, is the price to
pay for hight level design. We don’t need eventualy consistancy? Read
performance will suffer from such design
❏ Syslogng & UDP
We do real time processing , what if database stopped

*

© SkySQL Ab. Commercial in Confidence

*
MariaDB 10 my toolkit
❏ Storage Engines
InnoDB, Cassandra, Hbase, LevelDB, TokuDB,
Oqgraph
❏ Sharding, Clustering, and Federation
Spider, Multi source and Parallel replication,
Galera , Connect, federatedx, sphinx,
mroonga
*

© SkySQL Ab. Commercial in Confidence

*
ESCape Architecture

*

© SkySQL Ab. Commercial in Confidence

*
ESCape TokuDB

•

*

TokuDB and MyISAM performance 3 times faster on 32G of memory on the most
demanding query
© SkySQL Ab. Commercial in Confidence

*
ESCape Architecture

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Proxy Node Howto
CREATE TABLE shard01.kw (
ip INT unsigned NOT NULL,
date DATETIME shard02.kw (
CREATE TABLE NOT NULL,
firstseenon BINARY(255) NOT NULL,
ip INT unsigned NOT NULL,
keyword BINARY(128) NULL,
date DATETIME NOT NOT NULL,
domaine BINARY(128) NOT NULL, NULL,
firstseenon BINARY(255) NOT
referer BINARY(255) NOT NULL ,
keyword BINARY(128) NOT NULL,
crc64 BIGINT UNSIGNEDNULL,
c1 BINARY(128) NOT PRIMARY KEY
) ENGINE=blackhole;
c2 BINARY(255) NOT NULL ,

CREATE TABLE ccmkw (
ip INT unsigned NOT NULL,
date DATETIME NOT NULL,
firstseenon VARCHAR(255) NOT NULL,
keyword VARCHAR(128) NOT NULL,
c1 VARCHAR(128) NOT NULL,
c2 varchar(255) NOT NULL ,
crc64 BIGINT UNSIGNED PRIMARY KEY
crc64 BIGINT UNSIGNED AS (CONV(LEFT(MD5(
) ENGINE=blackhole;
IF(keyword='',CONCAT(firstseenon,c1),keyword)
) ,16),10,16)) PERSISTENT
) ENGINE=spider COMMENT='user "skysql",password "skyvodka"'

PARTITION BY LIST (mod(crc64,24))
(PARTITION pt01 VALUES IN (0) COMMENT = ' tbl
"3306", database "ccmstats_shard01"' ENGINE =
PARTITION pt02 VALUES IN (1) COMMENT = ' tbl
"3306", database "ccmstats_shard02"' ENGINE =
...
;
*

"ccmkw", host
SPIDER,
"ccmkw", host
SPIDER,

© SkySQL Ab. Commercial in Confidence

"127.0.0.1", port
"127.0.0.1", port

*
ESCape Proxy Node Howto
default-storage-engine=MyISAM
skip-innodb
skip_name_resolv
back_log=1024
max_connections = 1024
table_open_cache = 4096
table_definition_cache = 2048
max_allowed_packet = 32K
binlog_cache_size = 32K
max_heap_table_size = 64M
thread_cache_size = 1024
query_cache_size = 0
expire_logs_days=4
progress_report_time=0
Binlog_ignore_db=ccmstats
*

spider_use_handler=1
spider_sts_sync=0
spider_remote_sql_log_off=1
spider_remote_autocommit=0
spider_direct_dup_insert=1
spider_local_lock_table=0
spider_support_xa=0
spider_sync_autocommit=0
spider_sync_trx_isolation=0
spider_crd_sync=0
spider_conn_recycle_mode=1
spider_reset_sql_alloc=0

© SkySQL Ab. Commercial in Confidence

*
ESCape Data Node Multi source Howto
MariaDB [(none)]> pager egrep
'Connection_name|Slave_IO_Running|Slave_SQL_Running|Gtid_Slave_Pos'
MariaDB [(none)]> show
Connection_name:
Slave_IO_Running:
Slave_SQL_Running:
Gtid_Slave_Pos:
Connection_name:
Slave_IO_Running:
Slave_SQL_Running:
Gtid_Slave_Pos:
Connection_name:
Slave_IO_Running:
Slave_SQL_Running:
Gtid_Slave_Pos:
Connection_name:
Slave_IO_Running:
Slave_SQL_Running:
Gtid_Slave_Pos:

*

all slaves statusG
Yes
Yes
0-31091-138522330
ccmstats_gertrude
Yes
Yes
0-31091-138522330
ccmstats_lucifer
Yes
Yes
0-31091-138522330
ccmstats_mysql1
Yes
Yes
0-31091-138522330

Subset of shards per data node
SET GLOBAL ESCapeProxy1.
replicate_do_db='ccmstats_shard09,
Subset of shards per data node
ccmstats_shard10,ccmstats_shard11,
SET ccmstats_shard12,ccmstats_shard13,
GLOBAL ESCapeProxy1.
replicate_do_db='ccmstats_shard01,
ccmstats_shard14,ccmstats_shard15,
ccmstats_shard02,ccmstats_shard03,
ccmstats_shard16';
Subset of shards per data node
ccmstats_shard04,ccmstats_shard05,
SET GLOBAL ESCapeProxy1.
ccmstats_shard06,ccmstats_shard07,
replicate_do_db='ccmstats_shard01,
ccmstats_shard08';
ccmstats_shard02,ccmstats_shard03,
ccmstats_shard04,ccmstats_shard05,
ccmstats_shard22,ccmstats_shard23,
ccmstats_shard24;

© SkySQL Ab. Commercial in Confidence

*
ESCape Data Node: I’m a dummy
Not counting multiple time from a single
IP.

DECLARE l_idUrl INT unsigned DEFAULT 0;
DECLARE i_idDom TINYINT unsigned DEFAULT 0;
DECLARE c_kw VARCHAR(128);
IF NOT EXISTS (SELECT 1 FROM ccmreferers
WHERE keyword = NEW.keyword AND ip = NEW.ip)
THEN
SET l_idUrl = ccmstats.GetIdUrl(NEW.firstseenon);
SET i_idDom = ccmstats.GetIdDomaine(NEW.domaine);
INSERT INTO stats_url_cur
SET keyword_crc64 = NEW.keyword_crc64,
DATE = NEW.date,
idUrl = l_idUrl,
idDomaine = i_idDom,
nb = 1
ON DUPLICATE KEY UPDATE nb=nb+1;
IF LENGTH(NEW.keyword) > 0 THEN
SET c_kw = REPLACE(TRIM(NEW.keyword),' ',' ');
INSERT INTO stats_url_kw_cur
SET keyword_crc64 = NEW.keyword_crc64,
DATE = NEW.date,
idUrl = l_idUrl,
keyword = c_kw,
idDomaine = i_idDom,
nb = 1
ON DUPLICATE KEY UPDATE nb=nb+1;
END IF;
END IF;

Massively DEADLOCKING
Trigger execution should never be re
entering to same table
Solution is a blacklist IP keyword table

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Benchmarks Writes
Write performance should never be an
issue full scalability with group commit

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Spider Open Resty and LibDrizzle
❏

Non blocking all the way

http {
include
mime.types;
default_type application/octet-stream;
sendfile
on;
keepalive_timeout 65;
upstream backend {
drizzle_server 192.168.0.30:5059 dbname=stat_shard01
password=skyvodka user=skysql protocol=mysql;
drizzle_keepalive max=100 mode=single overflow=reject;
}
server {
listen
81;
server_name localhost;
location / {
root
html;
index index.html index.htm;
}
location /referers {
set_unescape_uri $ip $arg_ip;
set_unescape_uri $date $arg_date;
set_unescape_uri $firstseenon $arg_firstseenon;set_quote_sql_str $quoted_firstseenon $firstseenon;
set_unescape_uri $keyword $arg_keyword;set_quote_sql_str $quoted_keyword $keyword;
set_unescape_uri $domaine $arg_domaine;set_quote_sql_str $quoted_domaine $domaine;
set_unescape_uri $ref $arg_ref;set_quote_sql_str $quoted_ref $ref;
set_unescape_uri $crc64 $arg_crc64;

❏

Fast as mysqlslap in C

❏

A gazillon faster vs ApachePHP

❏

Limited usage but scripting via lua
cosocket

❏

Non blocking MariaDB not in Resty
but should be faster

echo_location /mysql "INSERT INTO ref VALUES($ip,$date,$quoted_firstseenon,$quoted_keyword,$quoted_domaine,$quoted_ref,$crc64)";
location /mysql {
drizzle_pass backend;
drizzle_module_header off;
drizzle_query $query_string;
rds_json on;
}

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Benchmarks
Latency for 1000 Key Point Access

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Spider Direct SQL voodoo
HOW TO MAP REDUCE
CREATE TEMPORARY TABLE `res` (
`keyword_crc64` bigint(20) unsigned NOT NULL,
`date` date NOT NULL DEFAULT '0000-00-00',
`idUrl` int(10) unsigned NOT NULL,
`keyword` varchar(128) NOT NULL DEFAULT '',
`idDomaine` tinyint(3) unsigned NOT NULL DEFAULT '0',
`nb` mediumint(8) unsigned NOT NULL DEFAULT '0',
`id` bigint(20) unsigned NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=latin1;
select spider_bg_direct_sql('SELECT * FROM stats_url_kw_cur s WHERE s.id IN
(241448386253908686)', 'res',
concat('host "', host, '", port "', port, '", user
"', username, '", password "', password, '", database "', tgt_db_name, '"')) a from
mysql.spider_tables where
db_name = 'commentcamarche' and table_name like 'stats_url_kw_cur#P#pt%’;

*

© SkySQL Ab. Commercial in Confidence

*
ESCape Running non RC
Be prepared for beta testing
❏

❏

Have a compilation machine

❏

Learn about reproductible test
case

❏

Learn about Valgrind and mode
debug

❏

*

Presente yourself and the
feature you would like to beta
test IRC on freenode #mariadb

Don’t get frustated if no answer it
is a dev channel

© SkySQL Ab. Commercial in Confidence

*
ESCape Running non RC
10.0.4, Oups my InnoDB datetime are
broken after alter table
Fixed in 10.0.6
MySQL 5.5, it is NOT marked as
DATA_UNSIGNED despite it being treated by
the handler as HA_KEYTYPE_ULONGLONG.
This should perhaps be considered a bug in
InnoDB, but it is ancient history

Spider debug
mysqld --debug=S:T:t:r:p:n:L:i:F:f:D:d,info,error,query,
qcache,my,exit,general,where:O,/tmp/mysqld.trace
Having a compilation server
-DBUILD_CONFIG=mysql_release DCMAKE_BUILD_TYPE=Debug -DWITH_VALGRIND=ON

Replication Gotcha 10.0.6

*

© SkySQL Ab. Commercial in Confidence

*
*

© SkySQL Ab. Commercial in Confidence

*
Thanks

*

© SkySQL Ab. Commercial in Confidence

*

Weitere ähnliche Inhalte

Was ist angesagt?

Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩
HyeonSeok Choi
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
Sages
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
SegFaultConf
 
Operational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB WebinarOperational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB Webinar
MongoDB
 
MongoDB Performance Debugging
MongoDB Performance DebuggingMongoDB Performance Debugging
MongoDB Performance Debugging
MongoDB
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
Remy Sharp
 

Was ist angesagt? (20)

FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsFwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
 
Py spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.comPy spark cheat sheet by cheatsheetmaker.com
Py spark cheat sheet by cheatsheetmaker.com
 
Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩Node 관계형 데이터베이스_바인딩
Node 관계형 데이터베이스_바인딩
 
Arduino & node.js
Arduino & node.jsArduino & node.js
Arduino & node.js
 
Wprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache HadoopWprowadzenie do technologi Big Data i Apache Hadoop
Wprowadzenie do technologi Big Data i Apache Hadoop
 
Living With Garbage
Living With GarbageLiving With Garbage
Living With Garbage
 
Parallel Computing With Dask - PyDays 2017
Parallel Computing With Dask - PyDays 2017Parallel Computing With Dask - PyDays 2017
Parallel Computing With Dask - PyDays 2017
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
Robert Pankowecki - Czy sprzedawcy SQLowych baz nas oszukali?
 
Beyond php it's not (just) about the code
Beyond php   it's not (just) about the codeBeyond php   it's not (just) about the code
Beyond php it's not (just) about the code
 
Operational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB WebinarOperational Intelligence with MongoDB Webinar
Operational Intelligence with MongoDB Webinar
 
MongoDB Performance Debugging
MongoDB Performance DebuggingMongoDB Performance Debugging
MongoDB Performance Debugging
 
Cnam azure 2014 mobile services
Cnam azure 2014   mobile servicesCnam azure 2014   mobile services
Cnam azure 2014 mobile services
 
20110514 mongo dbチューニング
20110514 mongo dbチューニング20110514 mongo dbチューニング
20110514 mongo dbチューニング
 
Tricks
TricksTricks
Tricks
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Bangun datar dan bangun ruang
Bangun datar dan bangun ruangBangun datar dan bangun ruang
Bangun datar dan bangun ruang
 
Cassandra Summit 2015
Cassandra Summit 2015Cassandra Summit 2015
Cassandra Summit 2015
 
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.9 book - Part 78 of 210
 

Ähnlich wie CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013

Database Implementation Final Document
Database Implementation Final DocumentDatabase Implementation Final Document
Database Implementation Final Document
Conor O'Callaghan
 
Mongo db world 2014 billrun
Mongo db world 2014   billrunMongo db world 2014   billrun
Mongo db world 2014 billrun
MongoDB
 
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
it-people
 
PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
Jerome Eteve
 

Ähnlich wie CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013 (20)

Database Implementation Final Document
Database Implementation Final DocumentDatabase Implementation Final Document
Database Implementation Final Document
 
CakePHP
CakePHPCakePHP
CakePHP
 
Mongo db world 2014 billrun
Mongo db world 2014   billrunMongo db world 2014   billrun
Mongo db world 2014 billrun
 
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project ADN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
DN 2017 | Reducing pain in data engineering | Martin Loetzsch | Project A
 
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
Jonathan Ellis "Apache Cassandra 2.0 and 2.1". Выступление на Cassandra conf ...
 
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS InsightScylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
Scylla Summit 2018: From SAP to Scylla - Tracking the Fleet at GPS Insight
 
My sql regis_handsonlab
My sql regis_handsonlabMy sql regis_handsonlab
My sql regis_handsonlab
 
Run Node Run
Run Node RunRun Node Run
Run Node Run
 
I'm Not a Software Developer - What Can I do on AWS
I'm Not a Software Developer - What Can I do on AWSI'm Not a Software Developer - What Can I do on AWS
I'm Not a Software Developer - What Can I do on AWS
 
MongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDBMongoDB World 2014 - BillRun, Billing on top of MongoDB
MongoDB World 2014 - BillRun, Billing on top of MongoDB
 
MySQL under the siege
MySQL under the siegeMySQL under the siege
MySQL under the siege
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
Aaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security TeamsAaron Bedra - Effective Software Security Teams
Aaron Bedra - Effective Software Security Teams
 
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
 
PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
 
Score (smart contract for icon)
Score (smart contract for icon) Score (smart contract for icon)
Score (smart contract for icon)
 
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
 
Ss dotnetcodexmpl
Ss dotnetcodexmplSs dotnetcodexmpl
Ss dotnetcodexmpl
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 

Mehr von MariaDB Corporation

Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise ClusterWebseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
MariaDB Corporation
 

Mehr von MariaDB Corporation (20)

High Performance Drupal with MariaDB
High Performance Drupal with MariaDBHigh Performance Drupal with MariaDB
High Performance Drupal with MariaDB
 
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise ClusterWebseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
Webseminar: MariaDB Enterprise und MariaDB Enterprise Cluster
 
MaxScale - The Pluggable Router
MaxScale - The Pluggable RouterMaxScale - The Pluggable Router
MaxScale - The Pluggable Router
 
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
 
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
Skalierbarkeit mit MariaDB und MaxScale - MariaDB Roadshow Summer 2014 Hambur...
 
Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...
Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...
Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hambu...
 
Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...
Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...
Automatisierung & Verwaltung von Datenbank - Clustern mit Severalnines - Mari...
 
The New MariaDB Offering: MariaDB 10, MaxScale and More
The New MariaDB Offering: MariaDB 10, MaxScale and MoreThe New MariaDB Offering: MariaDB 10, MaxScale and More
The New MariaDB Offering: MariaDB 10, MaxScale and More
 
MaxScale - The Pluggibale Router MariaDB Roadshow 2014 Paris
MaxScale - The Pluggibale Router MariaDB Roadshow 2014 ParisMaxScale - The Pluggibale Router MariaDB Roadshow 2014 Paris
MaxScale - The Pluggibale Router MariaDB Roadshow 2014 Paris
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014 F...
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB Enterprise
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
 
Galaxy Big Data with MariaDB
Galaxy Big Data with MariaDBGalaxy Big Data with MariaDB
Galaxy Big Data with MariaDB
 
Automatisation et Gestion de Cluster de Bases de Données MariaDB Roadshow
Automatisation et Gestion de Cluster de Bases de Données MariaDB RoadshowAutomatisation et Gestion de Cluster de Bases de Données MariaDB Roadshow
Automatisation et Gestion de Cluster de Bases de Données MariaDB Roadshow
 
Automation and Management of Database Clusters MariaDB Roadshow 2014
Automation and Management of Database Clusters MariaDB Roadshow 2014Automation and Management of Database Clusters MariaDB Roadshow 2014
Automation and Management of Database Clusters MariaDB Roadshow 2014
 
Automation and Management of Database Clusters
Automation and Management of Database ClustersAutomation and Management of Database Clusters
Automation and Management of Database Clusters
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and more
 
MaxScale - The Pluggable Router
MaxScale - The Pluggable RouterMaxScale - The Pluggable Router
MaxScale - The Pluggable Router
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB Enterprise
 
MariaDB 10 and Beyond
MariaDB 10 and BeyondMariaDB 10 and Beyond
MariaDB 10 and Beyond
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

CCM Escape Case Study - SkySQL Paris Meetup 17.12.2013

  • 1. * © SkySQL Ab. Commercial in Confidence *
  • 2. CCM Escape Case Study - Elastic Statistics Cluster Damien Mangin, Nicolas Payart, Stéphane Varoqui * © SkySQL Ab. Commercial in Confidence *
  • 3. ESCape Challenges ❏ Scale writes ❏ Should not hurt API performance ❏ Reduce the number of servers * © SkySQL Ab. Commercial in Confidence *
  • 4. ESCape candidates ❏ Redis Cluster is it ?(work in progress). Is it so fast for writes? ❏ Riak - LeveDB - InnoDB Do I really need Erlang for this? To store billions of entries use Innostore. InnoDB is a robust and well-known storage engine. Performance aside it appears that LevelDB may become a preferred choice for Riak. ❏ Cassandra – Hbase Do I really need Java for this? 10K insert per node group, is the price to pay for hight level design. We don’t need eventualy consistancy? Read performance will suffer from such design ❏ Syslogng & UDP We do real time processing , what if database stopped * © SkySQL Ab. Commercial in Confidence *
  • 5. MariaDB 10 my toolkit ❏ Storage Engines InnoDB, Cassandra, Hbase, LevelDB, TokuDB, Oqgraph ❏ Sharding, Clustering, and Federation Spider, Multi source and Parallel replication, Galera , Connect, federatedx, sphinx, mroonga * © SkySQL Ab. Commercial in Confidence *
  • 6. ESCape Architecture * © SkySQL Ab. Commercial in Confidence *
  • 7. ESCape TokuDB • * TokuDB and MyISAM performance 3 times faster on 32G of memory on the most demanding query © SkySQL Ab. Commercial in Confidence *
  • 8. ESCape Architecture * © SkySQL Ab. Commercial in Confidence *
  • 9. ESCape Proxy Node Howto CREATE TABLE shard01.kw ( ip INT unsigned NOT NULL, date DATETIME shard02.kw ( CREATE TABLE NOT NULL, firstseenon BINARY(255) NOT NULL, ip INT unsigned NOT NULL, keyword BINARY(128) NULL, date DATETIME NOT NOT NULL, domaine BINARY(128) NOT NULL, NULL, firstseenon BINARY(255) NOT referer BINARY(255) NOT NULL , keyword BINARY(128) NOT NULL, crc64 BIGINT UNSIGNEDNULL, c1 BINARY(128) NOT PRIMARY KEY ) ENGINE=blackhole; c2 BINARY(255) NOT NULL , CREATE TABLE ccmkw ( ip INT unsigned NOT NULL, date DATETIME NOT NULL, firstseenon VARCHAR(255) NOT NULL, keyword VARCHAR(128) NOT NULL, c1 VARCHAR(128) NOT NULL, c2 varchar(255) NOT NULL , crc64 BIGINT UNSIGNED PRIMARY KEY crc64 BIGINT UNSIGNED AS (CONV(LEFT(MD5( ) ENGINE=blackhole; IF(keyword='',CONCAT(firstseenon,c1),keyword) ) ,16),10,16)) PERSISTENT ) ENGINE=spider COMMENT='user "skysql",password "skyvodka"' PARTITION BY LIST (mod(crc64,24)) (PARTITION pt01 VALUES IN (0) COMMENT = ' tbl "3306", database "ccmstats_shard01"' ENGINE = PARTITION pt02 VALUES IN (1) COMMENT = ' tbl "3306", database "ccmstats_shard02"' ENGINE = ... ; * "ccmkw", host SPIDER, "ccmkw", host SPIDER, © SkySQL Ab. Commercial in Confidence "127.0.0.1", port "127.0.0.1", port *
  • 10. ESCape Proxy Node Howto default-storage-engine=MyISAM skip-innodb skip_name_resolv back_log=1024 max_connections = 1024 table_open_cache = 4096 table_definition_cache = 2048 max_allowed_packet = 32K binlog_cache_size = 32K max_heap_table_size = 64M thread_cache_size = 1024 query_cache_size = 0 expire_logs_days=4 progress_report_time=0 Binlog_ignore_db=ccmstats * spider_use_handler=1 spider_sts_sync=0 spider_remote_sql_log_off=1 spider_remote_autocommit=0 spider_direct_dup_insert=1 spider_local_lock_table=0 spider_support_xa=0 spider_sync_autocommit=0 spider_sync_trx_isolation=0 spider_crd_sync=0 spider_conn_recycle_mode=1 spider_reset_sql_alloc=0 © SkySQL Ab. Commercial in Confidence *
  • 11. ESCape Data Node Multi source Howto MariaDB [(none)]> pager egrep 'Connection_name|Slave_IO_Running|Slave_SQL_Running|Gtid_Slave_Pos' MariaDB [(none)]> show Connection_name: Slave_IO_Running: Slave_SQL_Running: Gtid_Slave_Pos: Connection_name: Slave_IO_Running: Slave_SQL_Running: Gtid_Slave_Pos: Connection_name: Slave_IO_Running: Slave_SQL_Running: Gtid_Slave_Pos: Connection_name: Slave_IO_Running: Slave_SQL_Running: Gtid_Slave_Pos: * all slaves statusG Yes Yes 0-31091-138522330 ccmstats_gertrude Yes Yes 0-31091-138522330 ccmstats_lucifer Yes Yes 0-31091-138522330 ccmstats_mysql1 Yes Yes 0-31091-138522330 Subset of shards per data node SET GLOBAL ESCapeProxy1. replicate_do_db='ccmstats_shard09, Subset of shards per data node ccmstats_shard10,ccmstats_shard11, SET ccmstats_shard12,ccmstats_shard13, GLOBAL ESCapeProxy1. replicate_do_db='ccmstats_shard01, ccmstats_shard14,ccmstats_shard15, ccmstats_shard02,ccmstats_shard03, ccmstats_shard16'; Subset of shards per data node ccmstats_shard04,ccmstats_shard05, SET GLOBAL ESCapeProxy1. ccmstats_shard06,ccmstats_shard07, replicate_do_db='ccmstats_shard01, ccmstats_shard08'; ccmstats_shard02,ccmstats_shard03, ccmstats_shard04,ccmstats_shard05, ccmstats_shard22,ccmstats_shard23, ccmstats_shard24; © SkySQL Ab. Commercial in Confidence *
  • 12. ESCape Data Node: I’m a dummy Not counting multiple time from a single IP. DECLARE l_idUrl INT unsigned DEFAULT 0; DECLARE i_idDom TINYINT unsigned DEFAULT 0; DECLARE c_kw VARCHAR(128); IF NOT EXISTS (SELECT 1 FROM ccmreferers WHERE keyword = NEW.keyword AND ip = NEW.ip) THEN SET l_idUrl = ccmstats.GetIdUrl(NEW.firstseenon); SET i_idDom = ccmstats.GetIdDomaine(NEW.domaine); INSERT INTO stats_url_cur SET keyword_crc64 = NEW.keyword_crc64, DATE = NEW.date, idUrl = l_idUrl, idDomaine = i_idDom, nb = 1 ON DUPLICATE KEY UPDATE nb=nb+1; IF LENGTH(NEW.keyword) > 0 THEN SET c_kw = REPLACE(TRIM(NEW.keyword),' ',' '); INSERT INTO stats_url_kw_cur SET keyword_crc64 = NEW.keyword_crc64, DATE = NEW.date, idUrl = l_idUrl, keyword = c_kw, idDomaine = i_idDom, nb = 1 ON DUPLICATE KEY UPDATE nb=nb+1; END IF; END IF; Massively DEADLOCKING Trigger execution should never be re entering to same table Solution is a blacklist IP keyword table * © SkySQL Ab. Commercial in Confidence *
  • 13. ESCape Benchmarks Writes Write performance should never be an issue full scalability with group commit * © SkySQL Ab. Commercial in Confidence *
  • 14. ESCape Spider Open Resty and LibDrizzle ❏ Non blocking all the way http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream backend { drizzle_server 192.168.0.30:5059 dbname=stat_shard01 password=skyvodka user=skysql protocol=mysql; drizzle_keepalive max=100 mode=single overflow=reject; } server { listen 81; server_name localhost; location / { root html; index index.html index.htm; } location /referers { set_unescape_uri $ip $arg_ip; set_unescape_uri $date $arg_date; set_unescape_uri $firstseenon $arg_firstseenon;set_quote_sql_str $quoted_firstseenon $firstseenon; set_unescape_uri $keyword $arg_keyword;set_quote_sql_str $quoted_keyword $keyword; set_unescape_uri $domaine $arg_domaine;set_quote_sql_str $quoted_domaine $domaine; set_unescape_uri $ref $arg_ref;set_quote_sql_str $quoted_ref $ref; set_unescape_uri $crc64 $arg_crc64; ❏ Fast as mysqlslap in C ❏ A gazillon faster vs ApachePHP ❏ Limited usage but scripting via lua cosocket ❏ Non blocking MariaDB not in Resty but should be faster echo_location /mysql "INSERT INTO ref VALUES($ip,$date,$quoted_firstseenon,$quoted_keyword,$quoted_domaine,$quoted_ref,$crc64)"; location /mysql { drizzle_pass backend; drizzle_module_header off; drizzle_query $query_string; rds_json on; } * © SkySQL Ab. Commercial in Confidence *
  • 15. ESCape Benchmarks Latency for 1000 Key Point Access * © SkySQL Ab. Commercial in Confidence *
  • 16. ESCape Spider Direct SQL voodoo HOW TO MAP REDUCE CREATE TEMPORARY TABLE `res` ( `keyword_crc64` bigint(20) unsigned NOT NULL, `date` date NOT NULL DEFAULT '0000-00-00', `idUrl` int(10) unsigned NOT NULL, `keyword` varchar(128) NOT NULL DEFAULT '', `idDomaine` tinyint(3) unsigned NOT NULL DEFAULT '0', `nb` mediumint(8) unsigned NOT NULL DEFAULT '0', `id` bigint(20) unsigned NOT NULL DEFAULT '0' ) ENGINE=MEMORY DEFAULT CHARSET=latin1; select spider_bg_direct_sql('SELECT * FROM stats_url_kw_cur s WHERE s.id IN (241448386253908686)', 'res', concat('host "', host, '", port "', port, '", user "', username, '", password "', password, '", database "', tgt_db_name, '"')) a from mysql.spider_tables where db_name = 'commentcamarche' and table_name like 'stats_url_kw_cur#P#pt%’; * © SkySQL Ab. Commercial in Confidence *
  • 17. ESCape Running non RC Be prepared for beta testing ❏ ❏ Have a compilation machine ❏ Learn about reproductible test case ❏ Learn about Valgrind and mode debug ❏ * Presente yourself and the feature you would like to beta test IRC on freenode #mariadb Don’t get frustated if no answer it is a dev channel © SkySQL Ab. Commercial in Confidence *
  • 18. ESCape Running non RC 10.0.4, Oups my InnoDB datetime are broken after alter table Fixed in 10.0.6 MySQL 5.5, it is NOT marked as DATA_UNSIGNED despite it being treated by the handler as HA_KEYTYPE_ULONGLONG. This should perhaps be considered a bug in InnoDB, but it is ancient history Spider debug mysqld --debug=S:T:t:r:p:n:L:i:F:f:D:d,info,error,query, qcache,my,exit,general,where:O,/tmp/mysqld.trace Having a compilation server -DBUILD_CONFIG=mysql_release DCMAKE_BUILD_TYPE=Debug -DWITH_VALGRIND=ON Replication Gotcha 10.0.6 * © SkySQL Ab. Commercial in Confidence *
  • 19. * © SkySQL Ab. Commercial in Confidence *
  • 20. Thanks * © SkySQL Ab. Commercial in Confidence *