SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Cassandra 
Delivering Christmas
gifts in France since
2012
Me, myself and I
Puppet
Software

Cassandr
a

Matthie
u
Nantern

@mNantern

mnantern@xebia.fr

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

2
From Mysql to Cassandra
Overview

1

2

3

4

Context

Why ?

How ?

Go Live!

Delivering parcels
at La Poste

Why do we need
another system ?
Project’s
constraints and
alternatives

How we build our
solution. Using C*
with PHP and
managing TTL

Provisioning
servers.
Performance and
resilience testing

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

3
La Poste
Mail services
Parcels distribution
More than 250 000 employees 
70 000 postmen delivering
parcels

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

4
La Poste
Postman’s tour
(1) A postman scans every parcels
Print

Scan

(2) He prints his list of parcels
(3) He distributes the parcels 
(4) He scans every remaining parcels

Scan

Distribute

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

5
From MySQL to C*

Why ?
Why do we need another system ?

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

7
Project’s constraints
Max 13ms per call
15 days of retention for data
Easy to deploy and operate
Easy to scale for years to come

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

8
From MySQL to C*

How ?
Data Modeling

Id

Data

key1 key2 key3

Id

Data

Search1 Search2

1

<Xml>

k11

k21

k31

1

<Xml>

k11k31 k21k11

2

<Xml>

k12

k22

k32

2

<Xml>

k12k32 k22k12

3

<Xml>

k13

k23

k33

3

<Xml>

k13k33 k23k13

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

10
Using Cassandra with PHP
For dummies

$pool = new ConnectionPool("Keyspace1", array("cass:9160")
$column_family = new ColumnFamily($pool,
'ColumnFamily1');
$column_family->insert('row_key', array('name1' =>
'val1', 'name2' => 'val2'));
$column_family->get('row_key');

$row1 = array('name1' => 'val1', 'name2' => 'val2');
$row2 = array('foo' => 'bar');
$column_family->batch_insert(array('row1' => $row1,
'row2' => $row2); | http://blog.xebia.fr | #CassandraEU
www.xebia.fr
|

Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

11
Using Cassandra with PHP
Level 2

$index_exp=CassandraUtil::create_index_expression($inde
xName, $indexValue,$operator);
!
!

$index_clause =
CassandraUtil::create_index_clause($indexArray);
!
!

$rows = $columnFamily>get_indexed_slices($index_clause);
|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

12
TTL in C*
$cf->insert('row_key', array('col1' => 'col_val1','col2'
=>'col_val2'),null,TTL);

$columnsTTL = array('col1'=>3, 'col2'=>4);
!

$cf->insert('row_key', array('col1' => 'val1','col2'
=>'val2'),null, $columnsTTL);

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

13
From MySQL to C*

Go Live!
Provisioning C* with Puppet
•12 servers with Ubuntu 10.04

!

package { 'cassandra':

 ensure => installed
}

initial_token: <%= ((2**127) * (current_cdb_server.to_i-1) /
cdb_servers_number.to_i ) %>

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

15
Provisioning C* with Puppet
Managing the data model
package { 'cassandra-data-model':

ensure => latest
}

migration_1.txt
migration_2.txt
migration_3.txt
migration_4.txt

Current Migration Id
2

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

16
Testing our cluster
Mysql performance

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

17
Testing our cluster
Cassandra performance

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

18
Testing our cluster
Resilience

|

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

19
Migration plan
t=0

t+15d

Read

Write

|

Read

Write

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

20
From MySQL to C*

Final words
THANK
YOU

For watching

Merci!
Thanks !

Thank you for
trusting me on
Cassandra (and
everything else)!

Thank you for the
support !

|

Thank you for the
opportunity to work
at La Poste !

www.xebia.fr | http://blog.xebia.fr | #CassandraEU
Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris

23

Mais conteúdo relacionado

Mais de DataStax Academy

Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraDataStax Academy
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsDataStax Academy
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingDataStax Academy
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackDataStax Academy
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready CassandraDataStax Academy
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonDataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2DataStax Academy
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First ClusterDataStax Academy
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with DseDataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraDataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseDataStax Academy
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraDataStax Academy
 
Apache Cassandra and Drivers
Apache Cassandra and DriversApache Cassandra and Drivers
Apache Cassandra and DriversDataStax Academy
 
Getting Started with Graph Databases
Getting Started with Graph DatabasesGetting Started with Graph Databases
Getting Started with Graph DatabasesDataStax Academy
 
Cassandra Data Maintenance with Spark
Cassandra Data Maintenance with SparkCassandra Data Maintenance with Spark
Cassandra Data Maintenance with SparkDataStax Academy
 

Mais de DataStax Academy (20)

Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart Labs
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data Modeling
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stack
 
Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready Cassandra
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
Bad Habits Die Hard
Bad Habits Die Hard Bad Habits Die Hard
Bad Habits Die Hard
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 
Apache Cassandra and Drivers
Apache Cassandra and DriversApache Cassandra and Drivers
Apache Cassandra and Drivers
 
Getting Started with Graph Databases
Getting Started with Graph DatabasesGetting Started with Graph Databases
Getting Started with Graph Databases
 
Cassandra Data Maintenance with Spark
Cassandra Data Maintenance with SparkCassandra Data Maintenance with Spark
Cassandra Data Maintenance with Spark
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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)wesley chun
 
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 WorkerThousandEyes
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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?Igalia
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 SavingEdi Saputra
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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 MilvusZilliz
 
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...Martijn de Jong
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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)
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 
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...
 

C* Summit EU 2013: Delivering Christmas Gifts in France Since 2012

  • 2. Me, myself and I Puppet Software Cassandr a Matthie u Nantern @mNantern mnantern@xebia.fr | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 2
  • 3. From Mysql to Cassandra Overview 1 2 3 4 Context Why ? How ? Go Live! Delivering parcels at La Poste Why do we need another system ? Project’s constraints and alternatives How we build our solution. Using C* with PHP and managing TTL Provisioning servers. Performance and resilience testing | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 3
  • 4. La Poste Mail services Parcels distribution More than 250 000 employees 70 000 postmen delivering parcels | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 4
  • 5. La Poste Postman’s tour (1) A postman scans every parcels Print Scan (2) He prints his list of parcels (3) He distributes the parcels (4) He scans every remaining parcels Scan Distribute | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 5
  • 6. From MySQL to C* Why ?
  • 7. Why do we need another system ? | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 7
  • 8. Project’s constraints Max 13ms per call 15 days of retention for data Easy to deploy and operate Easy to scale for years to come | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 8
  • 9. From MySQL to C* How ?
  • 10. Data Modeling Id Data key1 key2 key3 Id Data Search1 Search2 1 <Xml> k11 k21 k31 1 <Xml> k11k31 k21k11 2 <Xml> k12 k22 k32 2 <Xml> k12k32 k22k12 3 <Xml> k13 k23 k33 3 <Xml> k13k33 k23k13 | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 10
  • 11. Using Cassandra with PHP For dummies $pool = new ConnectionPool("Keyspace1", array("cass:9160") $column_family = new ColumnFamily($pool, 'ColumnFamily1'); $column_family->insert('row_key', array('name1' => 'val1', 'name2' => 'val2')); $column_family->get('row_key'); $row1 = array('name1' => 'val1', 'name2' => 'val2'); $row2 = array('foo' => 'bar'); $column_family->batch_insert(array('row1' => $row1, 'row2' => $row2); | http://blog.xebia.fr | #CassandraEU www.xebia.fr | Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 11
  • 12. Using Cassandra with PHP Level 2 $index_exp=CassandraUtil::create_index_expression($inde xName, $indexValue,$operator); ! ! $index_clause = CassandraUtil::create_index_clause($indexArray); ! ! $rows = $columnFamily>get_indexed_slices($index_clause); | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 12
  • 13. TTL in C* $cf->insert('row_key', array('col1' => 'col_val1','col2' =>'col_val2'),null,TTL); $columnsTTL = array('col1'=>3, 'col2'=>4); ! $cf->insert('row_key', array('col1' => 'val1','col2' =>'val2'),null, $columnsTTL); | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 13
  • 14. From MySQL to C* Go Live!
  • 15. Provisioning C* with Puppet •12 servers with Ubuntu 10.04 ! package { 'cassandra': ensure => installed } initial_token: <%= ((2**127) * (current_cdb_server.to_i-1) / cdb_servers_number.to_i ) %> | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 15
  • 16. Provisioning C* with Puppet Managing the data model package { 'cassandra-data-model': ensure => latest } migration_1.txt migration_2.txt migration_3.txt migration_4.txt Current Migration Id 2 | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 16
  • 17. Testing our cluster Mysql performance | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 17
  • 18. Testing our cluster Cassandra performance | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 18
  • 19. Testing our cluster Resilience | www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 19
  • 20. Migration plan t=0 t+15d Read Write | Read Write www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 20
  • 21. From MySQL to C* Final words
  • 23. Thanks ! Thank you for trusting me on Cassandra (and everything else)! Thank you for the support ! | Thank you for the opportunity to work at La Poste ! www.xebia.fr | http://blog.xebia.fr | #CassandraEU Telephone : 33 (0)1 53 89 99 99 | email : info@xebia.fr | 156 bd Haussmann - 75008 Paris 23