SlideShare ist ein Scribd-Unternehmen logo
Searching Cassandra with Solr



Rachel Pedreschi
Lead Technical Evangelist- Datastax Enterprise

@rachelpedreschi
An Introductory Technical Overview of Datastax Enterprise Search
Confidential
What is Search?
2
Confidential 3
Confidential 4
The bright blue butterfly hangs on the breeze.
[the] [bright] [blue] [butterfly] [hangs] [on] [the] [breeze]
Tokens
Confidential 5
Credit: https://developer.apple.com/library/mac/documentation/userexperience/conceptual/SearchKitConcepts/searchKit_basics/searchKit_basics.html
Terms
Confidential
It can be lonely for Solr

6
Confidential
Cassandra
7
✓ Highly available
✓ Linear scalability
✓ Low latency OLTP
queries
C*
Confidential 8
+ =
Confidential
Like… High Availability
9
Data Partitioning
Application
Data Center 1
hash(key) => token(43)
80
10
3050
70
60
40
20
Application
Data Center 1
Replication
hash(key) => token(43)
replication factor = 3
80
10
3050
70
60
40
20
Multi-Data Center Replication
Application
Data Center 1
hash(key) => token(43)
replication factor = 3
80
10
3050
70
60
40
20
Data Center 2
replication factor = 3
81
11
3151
71
61
41
21
Confidential
How does DSE integrate Solr?
13
C*
C*/
S O L R
Confidential 14
Confidential 15
SELECT * FROM
killrvideo.videos
WHERE solr_query='{ "q": "{!
edismax qf="name^2 tags^1
description"}datastax" }';
SELECT id, value FROM
keyspace.table WHERE token(id)
>= -3074457345618258601 AND
token(id) <=
3074457345618258603 AND
solr_query='id:*'
Confidential
Vocab
16
Cassandra term Solr term
Column Family /Table Core
Row Document
Column Field
SSTable Index
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
17
Node memory
Node file system
Client
partition key1 first:Oscar last:Orange level:42
partition key2 first:Ricky last:Red
Memtable (corresponds to a CQL table)
Coordinator
CommitLog
AppendOnly
… … … …
… … … …
… … … …
SSTables
Flush current state to SSTable
Compact related

SSTables
W
rite 

<3, Betty, Blue, 63>
Acknowledge
partition key3 first:Betty last:Blue level:63
Compaction
Each write request …
Periodically …
Periodically …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
18
Node memory
Node file system
Client
1 best 1
2 bright 2,3
Ram Buffer
Coordinator
… … … …
… … … …
… … … …
Segments
Flushes current state to Segment (Softcommit)
Write 

<1,blue, 2,3>
3 blue 2,3
Merge (STW)
Each write request …
Periodically …
On C* Memtable Flush, In memory segments hard commit to disk
Shard Router
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
19
Node memory
Node file system
1 best 1
2 bright 2,3
Ram Buffer
… … … …
… … … …
… … … …
Segments
3 blue 2,3
Not Searchable
Searchable
Coordinator
Shard Router
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
… … … …
Confidential
And… Scalability
20
Application
80
10
3050
70
60
40
20Data Center 1
Application
Data Center 1
80
10
30
50
70
60
40
20
Application
Data Center 1
80
8
32
56
72
64
48
16
24
4040
24
Confidential
Even… Improved Performance
24
Confidential 25
Standard Solr Indexing
DSE Search Live Indexing
Confidential 26
Confidential
Let’s go code diving!
27
Confidential
Behind the scenes…
28
// Videos by id
CREATE TABLE videos (
videoid uuid,
userid uuid,
name text,
description text,
location text,
location_type int,
preview_image_location text,
tags set<text>,
added_date timestamp,
PRIMARY KEY (videoid)
);
// Index for tag keywords
CREATE TABLE videos_by_tag (
tag text,
videoid uuid,
added_date timestamp,
userid uuid,
name text,
preview_image_location text,
tagged_date timestamp,
PRIMARY KEY (tag, videoid)
);
Not a great idea
Possible Index
Confidential 29
//Videos by id
CREATE TABLE videos (
videoid uuid,
userid uuid,
name text,
description text,
location text,
location_type int,
preview_image_location text,
tags set<text>,
added_date timestamp,
PRIMARY KEY (videoid)
And
this?
This?
This?
Confidential 30
Confidential 31
1) Spin up a new C* Cluster with search enabled using the DSE
installer.
$ sudo service dse cassandra -s
2) Run your schema DDL to create the C* keyspace and tables.
3) Run dse_tool on the videos table
$ dsetool create_core killrvideo.videos generateResources=true
4) Use the Solr Admin to check sanity and make sure you have a
core.
5) Write a CQL query with a Solr Search in it.
SELECT * FROM killrvideo.videos
WHERE solr_query='{ "q": "{!edismax qf="name^2 tags^1 description
"}datastax" }';
Confidential
Search all of the things in 5 easy steps…
32
Confidential
Resources
33
www.killrvideo.com
https://github.com/LukeTillman/killrvideo-csharp
www.datastax.com
Confidential 34
Questions?
35
50% off Priorty Pass:
RachelP50
25% Certification:
RachelPCert
Thank You
@RachelPedreschi

Weitere ähnliche Inhalte

PDF
Apache Cassandra - Einführung
PDF
Tech Talk Cassandra
PDF
Streaming Plattformen und die Qual der Wahl
PDF
MongoDB für Java Programmierer (JUGKA, 11.12.13)
PDF
Private Cloud mit Open Source
PDF
Ceph Object Store
PPTX
Storage Spaces Direct - Introduction
PDF
DOAG Webinar Oracle und Docker
Apache Cassandra - Einführung
Tech Talk Cassandra
Streaming Plattformen und die Qual der Wahl
MongoDB für Java Programmierer (JUGKA, 11.12.13)
Private Cloud mit Open Source
Ceph Object Store
Storage Spaces Direct - Introduction
DOAG Webinar Oracle und Docker

Was ist angesagt? (15)

PPTX
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
PDF
Tipps & Tricks für den erfolgreichen Einsatz von GPU-Computing
PDF
GPU-Computing mit CUDA und OpenCL in der Praxis
PPTX
Multi-GPU-Computing: Eins, zwei, drei, ganz viele
PDF
openstack Übersicht @GPN15
PDF
Ceph Introduction @GPN15
PDF
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
PDF
Oracle und Docker
PDF
Mit OpenStack zur eigenen Cloud (OSDC 2012)
PDF
Andreas Jordan – IT-Tage 2015 – Flashback – Warum Oracle Zeitreisen anbieten ...
PDF
Exadata with VM as Consolidation Plattform
PDF
Private Cloud mit Ceph und OpenStack
PDF
Twisted Eventloop Short Presentation
PDF
OSMC 2021 | SNMP Monitoring mit Prometheus / OIDs dynamisch auswählen und im ...
PDF
Infrastructure as code: Cloud-Umgebungen mit Terraform verwalten
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
Tipps & Tricks für den erfolgreichen Einsatz von GPU-Computing
GPU-Computing mit CUDA und OpenCL in der Praxis
Multi-GPU-Computing: Eins, zwei, drei, ganz viele
openstack Übersicht @GPN15
Ceph Introduction @GPN15
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
Oracle und Docker
Mit OpenStack zur eigenen Cloud (OSDC 2012)
Andreas Jordan – IT-Tage 2015 – Flashback – Warum Oracle Zeitreisen anbieten ...
Exadata with VM as Consolidation Plattform
Private Cloud mit Ceph und OpenStack
Twisted Eventloop Short Presentation
OSMC 2021 | SNMP Monitoring mit Prometheus / OIDs dynamisch auswählen und im ...
Infrastructure as code: Cloud-Umgebungen mit Terraform verwalten
Anzeige

Andere mochten auch (8)

PDF
Migrating Netflix from Datacenter Oracle to Global Cassandra
PPTX
Cql – cassandra query language
PDF
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
PPT
Introduction to cassandra
PDF
Introduction to Apache Cassandra
PDF
Cassandra at eBay - Cassandra Summit 2012
PPTX
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
PPTX
An Overview of Apache Cassandra
Migrating Netflix from Datacenter Oracle to Global Cassandra
Cql – cassandra query language
Apache Cassandra and DataStax Enterprise Explained with Peter Halliday at Wil...
Introduction to cassandra
Introduction to Apache Cassandra
Cassandra at eBay - Cassandra Summit 2012
Replication and Consistency in Cassandra... What Does it All Mean? (Christoph...
An Overview of Apache Cassandra
Anzeige

Mehr von DataStax Academy (20)

PDF
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
PPTX
Introduction to DataStax Enterprise Graph Database
PPTX
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
PPTX
Cassandra on Docker @ Walmart Labs
PDF
Cassandra 3.0 Data Modeling
PPTX
Cassandra Adoption on Cisco UCS & Open stack
PDF
Data Modeling for Apache Cassandra
PDF
Coursera Cassandra Driver
PDF
Production Ready Cassandra
PDF
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 1
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 2
PDF
Standing Up Your First Cluster
PDF
Real Time Analytics with Dse
PDF
Introduction to Data Modeling with Apache Cassandra
PDF
Cassandra Core Concepts
PPTX
Enabling Search in your Cassandra Application with DataStax Enterprise
PPTX
Bad Habits Die Hard
PDF
Advanced Data Modeling with Apache Cassandra
PDF
Advanced Cassandra
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Cassandra on Docker @ Walmart Labs
Cassandra 3.0 Data Modeling
Cassandra Adoption on Cisco UCS & Open stack
Data Modeling for Apache Cassandra
Coursera Cassandra Driver
Production Ready Cassandra
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 2
Standing Up Your First Cluster
Real Time Analytics with Dse
Introduction to Data Modeling with Apache Cassandra
Cassandra Core Concepts
Enabling Search in your Cassandra Application with DataStax Enterprise
Bad Habits Die Hard
Advanced Data Modeling with Apache Cassandra
Advanced Cassandra

Solr & Cassandra: Searching Cassandra with DataStax Enterprise