SlideShare une entreprise Scribd logo
1  sur  14
Použitie Cassandry v Azetmaile
350 000 používateľov za deň
1 100 000 používateľov za mesiac
    4 500 000 mailov za deň
104 TB unikátnych príloh
  27 TB tiel emailov + 4 TB metadát
0,6 TB dát pre fulltextové vyhľadávanie
Architektúra emailu

                      SMTP




                  Backend




   MySql    NFS   Cassandra   MogileFS   ElasticSearch




                  Frontend
Technológie použité v emaile

 NFS storage – telá mailov
 MogileFS – unikátne prílohy
 Cassandra – metainformácie o mailoch a
   priečinkoch používateľa
 ElasticSearch – fulltextové vyhľadávanie
 Memcache – session dáta pre email
 MySQL – dáta o používateľoch
Zmena úložiska metadát emailov

NFS
výhody: jednoduchosť použitia
nevýhody: problém so škálovaním a konzistenciou, chýbajúca
redundancia dát, nízky výkon pri veľkom objeme dát



Cassandra, ElasticSearch
výhody: replikácia, vysoká dostupnosť, jednoduchý scale up
nevýhody: transakčné spracovanie, nároky na HW
CASSANDRA – NoSql DB

Vznikla v spoločnosti Facebook (inbox search), spája amazon
dynamo model a google bigtable


scalability
flexibility – prístup ku CAP problému
consistency – všetky repliky majú rovnaké dáta
availability – dostupnosť clustra pri výpadku nodu
partition tolerance – fungovanie pri rozpade clustra
Python/Django/Pycassa/Pypollo
CASSANDRA – použitie

 počet nodov: 7
 počet replík: 3
 počet uložených kľúčov: ~2.3 mld
 obsadené miesto: ~4 TB
 read requests rate: 345 ops
 write requests rate: 221 ops
 read request latency: 12 ms
 write request latency: 2ms
CASSANDRA partitioning

 dáta v clustri reprezentuje cyklický ring
 node má pridelený token T, určuje pozíciu v
  ringu
 node zodpovedá za interval (T-1; T>
 ring rozdelený intervaly (dané počtom nodov)
 kľúč je mapovaný na token, určuje cieľový
  primárny node
 partitioners: random partitioner (md5 hash) –
  rovnomerné rozloženie byte ordered partioner
  – umožňuje range scan
CASSANDRA replication

node   token                           DC1:N4
DC1:N1   25
DC2:N1   26
DC1:N2   50
DC2:N2   51
DC1:N3   75                   DC2:N3
DC2:N3   76          DC1:N3                                DC1:N1
DC1:N4   100                                      DC2:N1

replication factor
DC1: 1
DC2: 2                             DC2:N2

                                         DC1:N2
CASSANDRA replication

 rôzne stratégie umiestňovania replík
  •   simple – repliky sa ukladajú na nody podľa poradia v ringu
  •   network topology – zohľadňuje fyzické umiestnenie nodov
      (datacentrum, rack, …)
 klientské operácie sú vykonávané s úrovňou konzistencie:
  •   one – práve jeden node
  •   quorum – nadpolovičná väčšina nodov
  •   all – všetky nody
 požadovaná konzistencia určuje:
  •   dostupnosť clustra pri výpadku nodu
  •   konzistenciu čítaných dát
  •   garanciu zápisu dát na x nodov
"640K ought to be enough for anybody.”
                                         B.G.

Contenu connexe

En vedette

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Cassandra v Azetmaile - Rubyslava #14

  • 2. 350 000 používateľov za deň 1 100 000 používateľov za mesiac 4 500 000 mailov za deň
  • 3. 104 TB unikátnych príloh 27 TB tiel emailov + 4 TB metadát 0,6 TB dát pre fulltextové vyhľadávanie
  • 4. Architektúra emailu SMTP Backend MySql NFS Cassandra MogileFS ElasticSearch Frontend
  • 5. Technológie použité v emaile  NFS storage – telá mailov  MogileFS – unikátne prílohy  Cassandra – metainformácie o mailoch a priečinkoch používateľa  ElasticSearch – fulltextové vyhľadávanie  Memcache – session dáta pre email  MySQL – dáta o používateľoch
  • 6. Zmena úložiska metadát emailov NFS výhody: jednoduchosť použitia nevýhody: problém so škálovaním a konzistenciou, chýbajúca redundancia dát, nízky výkon pri veľkom objeme dát Cassandra, ElasticSearch výhody: replikácia, vysoká dostupnosť, jednoduchý scale up nevýhody: transakčné spracovanie, nároky na HW
  • 7. CASSANDRA – NoSql DB Vznikla v spoločnosti Facebook (inbox search), spája amazon dynamo model a google bigtable scalability flexibility – prístup ku CAP problému consistency – všetky repliky majú rovnaké dáta availability – dostupnosť clustra pri výpadku nodu partition tolerance – fungovanie pri rozpade clustra
  • 9.
  • 10. CASSANDRA – použitie  počet nodov: 7  počet replík: 3  počet uložených kľúčov: ~2.3 mld  obsadené miesto: ~4 TB  read requests rate: 345 ops  write requests rate: 221 ops  read request latency: 12 ms  write request latency: 2ms
  • 11. CASSANDRA partitioning  dáta v clustri reprezentuje cyklický ring  node má pridelený token T, určuje pozíciu v ringu  node zodpovedá za interval (T-1; T>  ring rozdelený intervaly (dané počtom nodov)  kľúč je mapovaný na token, určuje cieľový primárny node  partitioners: random partitioner (md5 hash) – rovnomerné rozloženie byte ordered partioner – umožňuje range scan
  • 12. CASSANDRA replication node token DC1:N4 DC1:N1 25 DC2:N1 26 DC1:N2 50 DC2:N2 51 DC1:N3 75 DC2:N3 DC2:N3 76 DC1:N3 DC1:N1 DC1:N4 100 DC2:N1 replication factor DC1: 1 DC2: 2 DC2:N2 DC1:N2
  • 13. CASSANDRA replication  rôzne stratégie umiestňovania replík • simple – repliky sa ukladajú na nody podľa poradia v ringu • network topology – zohľadňuje fyzické umiestnenie nodov (datacentrum, rack, …)  klientské operácie sú vykonávané s úrovňou konzistencie: • one – práve jeden node • quorum – nadpolovičná väčšina nodov • all – všetky nody  požadovaná konzistencia určuje: • dostupnosť clustra pri výpadku nodu • konzistenciu čítaných dát • garanciu zápisu dát na x nodov
  • 14. "640K ought to be enough for anybody.” B.G.