SlideShare a Scribd company logo
1 of 17
Download to read offline
Vyhľadávanie podobných obrázkov
        Apache Cassandra
Úvod
 Vyhľadávanie podobných obrázkov k cieľovému obrázku
  na základe extrakcie globálnych (JCD) a lokálnych vlastností (SIFT)




                                                                        2
Problém
 Ak chceme použiť robustný (trénovací) dataset, ktorý
  bude obsahovať potenciálne milióny fotografií, vzniká
  problém:
    Z jednej fotografie môže byť extrahovaných stovky
     až tisíce vlastností
      o Ako ich navzájom porovnávať v reálnom čase?
      o Ako ich uložiť tak, aby sme k nim dokázali
         pristupovať v reálnom čase?


                                                          3
Lokálne Senzitívne Hašovanie (LSH)
 Objekty, ktoré sú si podobné sú vložené (zahašované)
  do rovnakého koša (angl. bucket) s vysokou
  pravdepodobnosťou
    Rodina hašovacích funkcií (g1, …, gL)
    Každá funkcia g vnikne spojením (konkatenáciou)
     k hašovacích funkcií:




                                                         4
Lokálne Senzitívne Hašovanie (LSH) / 2
 Každej hašovacej funkcii g prislúcha jedna hašovacia
  tabuľka:
    riadok v tabuľke: kľúč koša / podobné vlastnosti




                                                         5
Apache Cassandra
 OpenSource - špeciálne navrhnutý pre spracovanie
  veľkého objemu údajov, distribuovaný decentralizovaný
  hybrid medzi stĺpcovo a riadkovo orientovaným DBMS




                                                          6
Apache Cassandra – replikácia
 Ktorý uzol je použitý na uloženie riadku je určené
  mapovaním jeho kľúča na hodnotu tokenu, ktorú určí
  partitioner (DHT)
 Každý server (uzol) je schopný uložiť tokeny v určitom
  rozsahu




                                                           7
Apache Cassandra – stratégie replikácie
 Typ stratégie určuje, ktoré ďalšie uzly sú vybraté od uzla,
  ktorý je daný hodnotou tokenu
    Simple Strategy (default) – uzly, ktoré sú vedľa seba v
     kruhu
    Network Topology Strategy – počet replík na dátové
     centrum




                                                                8
Apache Cassandra – konzistencia údajov
 Replikačný faktor (počet kópií)
 Úroveň konzistencie (počet replík na prístup každej
  read/write operácie)




                                                        9
Apache Cassandra – hybridná orientácia
 Stĺpcova (Columns) orientácia
    počet stĺpcov nie je fixný
    stĺpce môžu byť usporiadané
    stĺpce môžu byť dopytované na určitý rozsah

 Riadková (Row) orientácia
    každý riadok je jednoznačne identifikovateľný
     kľúčom
    riadky zoskupujú stĺpce a super stĺpce

                                                     10
Apache Cassandra – dátový model




                                  11
Apache Cassandra – keyspace
 V hantírke relačných DBMS = databáza

 Vlastnosti
    replikačný faktor
    stratégia replikácie
    viacero rodín stĺpcov (Column Families) = tabuľky

 Pre jednu aplikáciu je možné vytvoriť viacero keyspaces
  (napr. pri potrebe rôznych replikačných stratégií)

                                                         12
Apache Cassandra – column
 Základná jednotka údajovej štuktúry




                                        13
Apache Cassandra – wide/skinny rows
 Wide rows – veľký počet stĺpcov (Columns) a malý
  počet riadkov
    zle funguje s RowCache
 Skinny rows – malý počet stĺpcov (Columns) a veľký
  počet riadkov

 Ak máte veľký počet riadkov a veľký počet stĺpcov, tak
  docielite veľké indexy
    ~40GB dát = 10GB index


                                                           14
Apache Cassandra – comparator types
   AsciiType
   BytesType
   IntegerType
   LongType
   TimeUUIDType
   UTF8Type




                                            15
Apache Cassandra – super columns
 5-dimenzionálne mapovanie
   [KeySpace][ColumnFamily][Key][SuperColumn][SubColumn]
 maximálne jednoúrovňová hĺbka (SubColumn nemôže
  byť SuperColumn)




                                                            16
Apache Cassandra – záver
 pri dopytovaní nie je možné výsledky joinovať (klient)
 TTL column typ = expiruje po určitom čase
  (napr. pre uloženie session token)
 MySQL vs Cassandra (50GB dát, priemer)
    MySQL
        Write ~300ms
        Read ~350ms
    Cassandra
        Write ~0.12ms
        Read ~15ms
                                                           17

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
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...
 

Cassandra: Indexing and discovering similar images

  • 2. Úvod  Vyhľadávanie podobných obrázkov k cieľovému obrázku na základe extrakcie globálnych (JCD) a lokálnych vlastností (SIFT) 2
  • 3. Problém  Ak chceme použiť robustný (trénovací) dataset, ktorý bude obsahovať potenciálne milióny fotografií, vzniká problém:  Z jednej fotografie môže byť extrahovaných stovky až tisíce vlastností o Ako ich navzájom porovnávať v reálnom čase? o Ako ich uložiť tak, aby sme k nim dokázali pristupovať v reálnom čase? 3
  • 4. Lokálne Senzitívne Hašovanie (LSH)  Objekty, ktoré sú si podobné sú vložené (zahašované) do rovnakého koša (angl. bucket) s vysokou pravdepodobnosťou  Rodina hašovacích funkcií (g1, …, gL)  Každá funkcia g vnikne spojením (konkatenáciou) k hašovacích funkcií: 4
  • 5. Lokálne Senzitívne Hašovanie (LSH) / 2  Každej hašovacej funkcii g prislúcha jedna hašovacia tabuľka:  riadok v tabuľke: kľúč koša / podobné vlastnosti 5
  • 6. Apache Cassandra  OpenSource - špeciálne navrhnutý pre spracovanie veľkého objemu údajov, distribuovaný decentralizovaný hybrid medzi stĺpcovo a riadkovo orientovaným DBMS 6
  • 7. Apache Cassandra – replikácia  Ktorý uzol je použitý na uloženie riadku je určené mapovaním jeho kľúča na hodnotu tokenu, ktorú určí partitioner (DHT)  Každý server (uzol) je schopný uložiť tokeny v určitom rozsahu 7
  • 8. Apache Cassandra – stratégie replikácie  Typ stratégie určuje, ktoré ďalšie uzly sú vybraté od uzla, ktorý je daný hodnotou tokenu  Simple Strategy (default) – uzly, ktoré sú vedľa seba v kruhu  Network Topology Strategy – počet replík na dátové centrum 8
  • 9. Apache Cassandra – konzistencia údajov  Replikačný faktor (počet kópií)  Úroveň konzistencie (počet replík na prístup každej read/write operácie) 9
  • 10. Apache Cassandra – hybridná orientácia  Stĺpcova (Columns) orientácia  počet stĺpcov nie je fixný  stĺpce môžu byť usporiadané  stĺpce môžu byť dopytované na určitý rozsah  Riadková (Row) orientácia  každý riadok je jednoznačne identifikovateľný kľúčom  riadky zoskupujú stĺpce a super stĺpce 10
  • 11. Apache Cassandra – dátový model 11
  • 12. Apache Cassandra – keyspace  V hantírke relačných DBMS = databáza  Vlastnosti  replikačný faktor  stratégia replikácie  viacero rodín stĺpcov (Column Families) = tabuľky  Pre jednu aplikáciu je možné vytvoriť viacero keyspaces (napr. pri potrebe rôznych replikačných stratégií) 12
  • 13. Apache Cassandra – column  Základná jednotka údajovej štuktúry 13
  • 14. Apache Cassandra – wide/skinny rows  Wide rows – veľký počet stĺpcov (Columns) a malý počet riadkov  zle funguje s RowCache  Skinny rows – malý počet stĺpcov (Columns) a veľký počet riadkov  Ak máte veľký počet riadkov a veľký počet stĺpcov, tak docielite veľké indexy  ~40GB dát = 10GB index 14
  • 15. Apache Cassandra – comparator types  AsciiType  BytesType  IntegerType  LongType  TimeUUIDType  UTF8Type 15
  • 16. Apache Cassandra – super columns  5-dimenzionálne mapovanie  [KeySpace][ColumnFamily][Key][SuperColumn][SubColumn]  maximálne jednoúrovňová hĺbka (SubColumn nemôže byť SuperColumn) 16
  • 17. Apache Cassandra – záver  pri dopytovaní nie je možné výsledky joinovať (klient)  TTL column typ = expiruje po určitom čase (napr. pre uloženie session token)  MySQL vs Cassandra (50GB dát, priemer)  MySQL  Write ~300ms  Read ~350ms  Cassandra  Write ~0.12ms  Read ~15ms 17