SlideShare a Scribd company logo
1 of 34
SPARK AND COUCHBASE:
AUGMENTING THE OPERATIONAL
DATABASE WITH SPARK
Matt Ingenthron
Couchbase
Agenda
Why integrate Spark and NoSQL?
Architectural alignment
Integration “Points of Interest”
 Automatic sharding and data locality
 Streams: Data Replication and Spark Streaming
 Predicate pushdown and global indexing
 Flexible schemas and schema inference
See it in action
Why Spark and NoSQL?
NoSQL + Spark use cases
Operations Analysis
NoSQL
 Recommendations
 Next gen data warehousing
 Predictive analytics
 Fraud detection
 Catalog
 Customer 360 + IOT
 Personalization
 Mobile applications
Big Data at a Glance
Couchbase Spark Hadoop
Use cases
• Operational
• Web / Mobile
• Analytics
• Machine
Learning
• Analytics
• Machine
Learning
Processing
mode
• Online
• Ad Hoc
• Ad Hoc
• Batch
• Streaming (+/-)
• Batch
• Ad Hoc (+/-)
Low latency = < 1 ms ops Seconds Minutes
Performance Highly predictable Variable Variable
Users are
typically…
Millions of
customers
100’s of analysts or
data scientists
100’s of analysts or
data scientists
Memory-centric Memory-centric Disk-centric
Big data = 10s of Terabytes Petabytes Petabytes
ANALYTICALOPERATIONAL
Use Case: Operationalize Analytics / ML
Hadoop
Examples: recommend content and products, spot fraud or spam
Data scientists train machine learning models
Load results into Couchbase so end users can interact with them online
Machine
Learning
Models
Data
Warehouse
Historical Data
NoSQL
Use Case: Operationalize ML
Model
NoSQL
node(e.g.) Training Data
(Observations)
Serving
Predictions
Spark connects to everything…
DCP
KV
N1QL
Views
Adapted from: Databricks – Not Your Father’s Database https://www.brighttalk.com/webcast/12891/196891
Use Case #2: Data Integration
RDBMSs3hdfs
Elasticsearc
h
Data engineers query data in many systems w/ one language &
runtime
Store results where needed for further use
Late binding of schemas
NoSQL
Architectural Alignment
Full Text Search
Search for and fetch
the most relevant
records given a
freeform text string
Key-Value
Directly fetch /
store a particular
record
Query
Specify a set of criteria
to retrieve relevant data
records.
Essential in reporting.
Map-Reduce
Views
Maintain materialized
indexes of data
records, with reduce
functions for
aggregation
Data Streaming
Efficiently, quickly
stream data records to
external systems for
further processing or
integration
Hash Partitioned Data
Auto Sharding – Bucket And vBuckets
A bucket is a logical, unique key space
Each bucket has active & replica data sets
 Each data set has 1024 virtual buckets
(vBuckets)
 Each vBucket contains 1/1024th of the data
set
 vBuckets have no fixed physical server
location
Mapping of vBuckets to physical servers is
called the cluster map
Document IDs (keys) always get hashed to
the same vBucket
Couchbase SDK’s lookup the vBucket 
server mapping
N1QL Query
N1QL, pronounced “nickel”, is a SQL service with extensions specifically for
JSON
 Is stateless execution, however…
 Uses Couchbase’s Global Secondary Indexes.
 These are sorted structures, range partitioned.
 Both can run on any nodes within the cluster. Nodes with differing
services can be added and removed as needed.
MapReduce Couchbase Views
A JavaScript based, incremental Map-Reduce
service for incrementally building sorted B+Trees.
 Runs on every node, local to the data on that node, stored locally.
 Automatically merge-sorted at query time.
Data Streaming with DCP
A general data streaming service, Database Change Protocol.
 Allows for streaming all data out and continuing, or…
 Stream just what is coming in at the time of connection, or…
 Stream everything out for transfer/takeover…
Couchbase from Spark
Key-Value
Direct fetching/storing
of a particular record.
Query
Specifying a set of
criteria to retrieve
relevant data records.
Essential in reporting.
Map-Reduce
Views
Maintain materialized
indexes of data
records, with reduce
functions for
aggregation.
Data Streaming
Efficiently, quickly
stream data records to
external systems for
further processing or
integration.
Full Text Search
Search for, and allow
tuning of the system to
fetch the most relevant
records given a
freeform search string.
Automatic sharding and data locality
Integration Points of Interest
What happens in Spark Couchbase KV
When 1 Spark node per CB node, the connector will use the cluster map and
push down location hints
 Helpful for situations where processing is intense, like transformation
 Uses pipeline IO optimization
However, not available for N1QL or Views
 Round robin - can’t give location hints
 Back end is scatter gather with 1 node responding
Predicate pushdown and global indexing
Integration Points of Interest
SparkSQL on
N1QL with Global Secondary Indexes
TableScan
Scan all of the data and return it
PrunedScan
Scan an index that matches only relevant
data to the query at hand.
PrunedFilteredScan
Scan an index that matches only relevant
data to the query at hand.
Couchbase Cluster
B-Tree
(Global Secondary Index)
Data
Data
Data
Data
Query
Application
Client
Couchbase Cluster
B-Tree
(Global Secondary Index)
Data
Data
Data
Data
Query
Application
Client
Predicate pushdown
Predicate pushdown
Notes from implementing:
Spark assumes it’s getting
all the data, applies the predicates
Future potential optimizations
Push down all the things!
 Aggregations
 JOINs
Looking at Catalyst engine extensions from SAP
 But, it’s not backward compatible and…
 …many data sources can only push down filters
image courtesy http://allthefreethings.com/about/
Streams: Data Replication and Spark
Streaming
Integration Points of Interest
DCP and Spark Streaming
Many system architectures rely upon streaming from the ‘operational’ data
store to other systems
 Lambda architecture => store everything and
process/reprocess everything based on access
 Command Query Responsibility Segregation - (CQRS)
 Other reactive pattern derived systems and frameworks
Documents flow into the
system from outside
Documents are then
streamed down to consumers
In most common cases, flows
memory to memory
DCP and Spark Streaming
Couchbase Node
DCP
Consumer
Other Cluster
Nodes
Spark Cluster
See it in Action
Couchbase Spark Connector 1.2
• Spark 1.6 support, including Datasets
• Full DCP flow control support
• Enhanced Java APIs
• Bug fixes
34
Questions?
THANK YOU.
@ingenthr
Try Couchbase Spark Connector 1.2
http://www.couchbase.com/bigdata
Additional Information
Deployment Topology
Couchbase
Spark
Worker
Couchbase
Couchbase
 Many small gets
 Streaming with low
mutation rate
 Ad hoc
Couchbase
Data Node
Data Node
Spark
Worker
Couchbase
Couchbase
 Medium processing
 Predictable
workloads
 Plenty of overhead
on machines
Couchbase
Couchbase
Couchbase
Couchbase
Couchbase
Couchbase
Data Node
Data Node
Spark
Worker
XDCR
 Heaviest processing
 Workload isolation
writes

More Related Content

What's hot

Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data
Pactera_US
 
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice MachineSpark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
Data Con LA
 

What's hot (20)

Lambda architecture with Spark
Lambda architecture with SparkLambda architecture with Spark
Lambda architecture with Spark
 
Data Engineer's Lunch #55: Get Started in Data Engineering
Data Engineer's Lunch #55: Get Started in Data EngineeringData Engineer's Lunch #55: Get Started in Data Engineering
Data Engineer's Lunch #55: Get Started in Data Engineering
 
IEEE International Conference on Data Engineering 2015
IEEE International Conference on Data Engineering 2015IEEE International Conference on Data Engineering 2015
IEEE International Conference on Data Engineering 2015
 
Big Telco - Yousun Jeong
Big Telco - Yousun JeongBig Telco - Yousun Jeong
Big Telco - Yousun Jeong
 
Powering Interactive BI Analytics with Presto and Delta Lake
Powering Interactive BI Analytics with Presto and Delta LakePowering Interactive BI Analytics with Presto and Delta Lake
Powering Interactive BI Analytics with Presto and Delta Lake
 
Azure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep DiveAzure Data Lake Analytics Deep Dive
Azure Data Lake Analytics Deep Dive
 
Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data Using Visualization to Succeed with Big Data
Using Visualization to Succeed with Big Data
 
Customer Education Webcast: New Features in Data Integration and Streaming CDC
Customer Education Webcast: New Features in Data Integration and Streaming CDCCustomer Education Webcast: New Features in Data Integration and Streaming CDC
Customer Education Webcast: New Features in Data Integration and Streaming CDC
 
Time-oriented event search. A new level of scale
Time-oriented event search. A new level of scale Time-oriented event search. A new level of scale
Time-oriented event search. A new level of scale
 
Future of data visualization
Future of data visualizationFuture of data visualization
Future of data visualization
 
Solr + Hadoop: Interactive Search for Hadoop
Solr + Hadoop: Interactive Search for HadoopSolr + Hadoop: Interactive Search for Hadoop
Solr + Hadoop: Interactive Search for Hadoop
 
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice MachineSpark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
Spark as part of a Hybrid RDBMS Architecture-John Leach Cofounder Splice Machine
 
Databricks Delta Lake and Its Benefits
Databricks Delta Lake and Its BenefitsDatabricks Delta Lake and Its Benefits
Databricks Delta Lake and Its Benefits
 
Splice Machine Overview
Splice Machine OverviewSplice Machine Overview
Splice Machine Overview
 
Ravi Namboori 's Open stack framework introduction
Ravi Namboori 's Open stack framework introductionRavi Namboori 's Open stack framework introduction
Ravi Namboori 's Open stack framework introduction
 
Large Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured StreamingLarge Scale Lakehouse Implementation Using Structured Streaming
Large Scale Lakehouse Implementation Using Structured Streaming
 
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
Designing and Implementing a Real-time Data Lake with Dynamically Changing Sc...
 
Change Data Capture to Data Lakes Using Apache Pulsar and Apache Hudi - Pulsa...
Change Data Capture to Data Lakes Using Apache Pulsar and Apache Hudi - Pulsa...Change Data Capture to Data Lakes Using Apache Pulsar and Apache Hudi - Pulsa...
Change Data Capture to Data Lakes Using Apache Pulsar and Apache Hudi - Pulsa...
 
Preventative Maintenance of Robots in Automotive Industry
Preventative Maintenance of Robots in Automotive IndustryPreventative Maintenance of Robots in Automotive Industry
Preventative Maintenance of Robots in Automotive Industry
 
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
 

Viewers also liked

eTwinningový maraton ZŠ Gen. Píky, Ostrava
eTwinningový maraton ZŠ Gen. Píky, OstravaeTwinningový maraton ZŠ Gen. Píky, Ostrava
eTwinningový maraton ZŠ Gen. Píky, Ostrava
ivanabrabcova
 
【国立大学法人東京農工大学】平成20年環境報告書
【国立大学法人東京農工大学】平成20年環境報告書【国立大学法人東京農工大学】平成20年環境報告書
【国立大学法人東京農工大学】平成20年環境報告書
env62
 
Brian Glass Making Decisions
Brian Glass Making DecisionsBrian Glass Making Decisions
Brian Glass Making Decisions
brnglass
 
Kimball Xsite
Kimball Xsite Kimball Xsite
Kimball Xsite
dianecom1
 
Extra practice 4.
Extra practice 4.Extra practice 4.
Extra practice 4.
Sonia
 
Prezent Manana
Prezent MananaPrezent Manana
Prezent Manana
manana
 

Viewers also liked (20)

96 The Esplanade
96 The Esplanade96 The Esplanade
96 The Esplanade
 
eTwinningový maraton ZŠ Gen. Píky, Ostrava
eTwinningový maraton ZŠ Gen. Píky, OstravaeTwinningový maraton ZŠ Gen. Píky, Ostrava
eTwinningový maraton ZŠ Gen. Píky, Ostrava
 
Week6
Week6Week6
Week6
 
Ark 05 09
Ark 05 09Ark 05 09
Ark 05 09
 
【国立大学法人東京農工大学】平成20年環境報告書
【国立大学法人東京農工大学】平成20年環境報告書【国立大学法人東京農工大学】平成20年環境報告書
【国立大学法人東京農工大学】平成20年環境報告書
 
0 E158 C10d01
0 E158 C10d010 E158 C10d01
0 E158 C10d01
 
Brian Glass Making Decisions
Brian Glass Making DecisionsBrian Glass Making Decisions
Brian Glass Making Decisions
 
Gough 56artworks W Texts Sm
Gough 56artworks W Texts SmGough 56artworks W Texts Sm
Gough 56artworks W Texts Sm
 
ValueFrame - myynnistä toimitukseen -seminaari 17.11.2011 (id 2134) (id 2212)
ValueFrame - myynnistä toimitukseen -seminaari 17.11.2011 (id 2134) (id 2212)ValueFrame - myynnistä toimitukseen -seminaari 17.11.2011 (id 2134) (id 2212)
ValueFrame - myynnistä toimitukseen -seminaari 17.11.2011 (id 2134) (id 2212)
 
Digital Arts - Starter kit
Digital Arts - Starter kitDigital Arts - Starter kit
Digital Arts - Starter kit
 
エンジニア目線での対外ブランディング ~ヌーラボ編~
エンジニア目線での対外ブランディング ~ヌーラボ編~エンジニア目線での対外ブランディング ~ヌーラボ編~
エンジニア目線での対外ブランディング ~ヌーラボ編~
 
#fotocasaResponde: ¿Cómo reclamar la devolución de las cláusulas suelo?
#fotocasaResponde: ¿Cómo reclamar la devolución de las cláusulas suelo?#fotocasaResponde: ¿Cómo reclamar la devolución de las cláusulas suelo?
#fotocasaResponde: ¿Cómo reclamar la devolución de las cláusulas suelo?
 
Influence and Focusing on the Customer
Influence and Focusing on the CustomerInfluence and Focusing on the Customer
Influence and Focusing on the Customer
 
Etiologia de la celulitis
Etiologia de la celulitisEtiologia de la celulitis
Etiologia de la celulitis
 
The Monkey Called Personal Branding
The Monkey Called Personal BrandingThe Monkey Called Personal Branding
The Monkey Called Personal Branding
 
Olympics behind the scenes
Olympics behind the scenes Olympics behind the scenes
Olympics behind the scenes
 
NATURAKO ARRISKUAK - RG
NATURAKO ARRISKUAK - RGNATURAKO ARRISKUAK - RG
NATURAKO ARRISKUAK - RG
 
Kimball Xsite
Kimball Xsite Kimball Xsite
Kimball Xsite
 
Extra practice 4.
Extra practice 4.Extra practice 4.
Extra practice 4.
 
Prezent Manana
Prezent MananaPrezent Manana
Prezent Manana
 

Similar to Spark and Couchbase– Augmenting the Operational Database with Spark

Similar to Spark and Couchbase– Augmenting the Operational Database with Spark (20)

Spark and Couchbase: Augmenting the Operational Database with Spark
Spark and Couchbase: Augmenting the Operational Database with SparkSpark and Couchbase: Augmenting the Operational Database with Spark
Spark and Couchbase: Augmenting the Operational Database with Spark
 
Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)Azure Synapse Analytics Overview (r2)
Azure Synapse Analytics Overview (r2)
 
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdfDustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
 
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
 
Otimizações de Projetos de Big Data, Dw e AI no Microsoft Azure
Otimizações de Projetos de Big Data, Dw e AI no Microsoft AzureOtimizações de Projetos de Big Data, Dw e AI no Microsoft Azure
Otimizações de Projetos de Big Data, Dw e AI no Microsoft Azure
 
Keeping Analytics Data Fresh in a Streaming Architecture | John Neal, Qlik
Keeping Analytics Data Fresh in a Streaming Architecture | John Neal, QlikKeeping Analytics Data Fresh in a Streaming Architecture | John Neal, Qlik
Keeping Analytics Data Fresh in a Streaming Architecture | John Neal, Qlik
 
Spark Summit EU talk by Michael Nitschinger
Spark Summit EU talk by Michael NitschingerSpark Summit EU talk by Michael Nitschinger
Spark Summit EU talk by Michael Nitschinger
 
Introduction to ClustrixDB
Introduction to ClustrixDBIntroduction to ClustrixDB
Introduction to ClustrixDB
 
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
 
Kylin and Druid Presentation
Kylin and Druid PresentationKylin and Druid Presentation
Kylin and Druid Presentation
 
The Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache SparkThe Future of Hadoop: A deeper look at Apache Spark
The Future of Hadoop: A deeper look at Apache Spark
 
Glint with Apache Spark
Glint with Apache SparkGlint with Apache Spark
Glint with Apache Spark
 
Data Pipeline for The Big Data/Data Science OKC
Data Pipeline for The Big Data/Data Science OKCData Pipeline for The Big Data/Data Science OKC
Data Pipeline for The Big Data/Data Science OKC
 
Streaming Data Analytics with ksqlDB and Superset | Robert Stolz, Preset
Streaming Data Analytics with ksqlDB and Superset | Robert Stolz, PresetStreaming Data Analytics with ksqlDB and Superset | Robert Stolz, Preset
Streaming Data Analytics with ksqlDB and Superset | Robert Stolz, Preset
 
High performance Spark distribution on PKS by SnappyData
High performance Spark distribution on PKS by SnappyDataHigh performance Spark distribution on PKS by SnappyData
High performance Spark distribution on PKS by SnappyData
 
High performance Spark distribution on PKS by SnappyData
High performance Spark distribution on PKS by SnappyDataHigh performance Spark distribution on PKS by SnappyData
High performance Spark distribution on PKS by SnappyData
 
Couch db
Couch dbCouch db
Couch db
 
NoSQL Databases Introduction - UTN 2013
NoSQL Databases Introduction - UTN 2013NoSQL Databases Introduction - UTN 2013
NoSQL Databases Introduction - UTN 2013
 
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
Vectorized Deep Learning Acceleration from Preprocessing to Inference and Tra...
 
Dev Ops Training
Dev Ops TrainingDev Ops Training
Dev Ops Training
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

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...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced 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...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 

Spark and Couchbase– Augmenting the Operational Database with Spark

  • 1. SPARK AND COUCHBASE: AUGMENTING THE OPERATIONAL DATABASE WITH SPARK Matt Ingenthron Couchbase
  • 2. Agenda Why integrate Spark and NoSQL? Architectural alignment Integration “Points of Interest”  Automatic sharding and data locality  Streams: Data Replication and Spark Streaming  Predicate pushdown and global indexing  Flexible schemas and schema inference See it in action
  • 3. Why Spark and NoSQL?
  • 4. NoSQL + Spark use cases Operations Analysis NoSQL  Recommendations  Next gen data warehousing  Predictive analytics  Fraud detection  Catalog  Customer 360 + IOT  Personalization  Mobile applications
  • 5. Big Data at a Glance Couchbase Spark Hadoop Use cases • Operational • Web / Mobile • Analytics • Machine Learning • Analytics • Machine Learning Processing mode • Online • Ad Hoc • Ad Hoc • Batch • Streaming (+/-) • Batch • Ad Hoc (+/-) Low latency = < 1 ms ops Seconds Minutes Performance Highly predictable Variable Variable Users are typically… Millions of customers 100’s of analysts or data scientists 100’s of analysts or data scientists Memory-centric Memory-centric Disk-centric Big data = 10s of Terabytes Petabytes Petabytes ANALYTICALOPERATIONAL
  • 6. Use Case: Operationalize Analytics / ML Hadoop Examples: recommend content and products, spot fraud or spam Data scientists train machine learning models Load results into Couchbase so end users can interact with them online Machine Learning Models Data Warehouse Historical Data NoSQL
  • 7. Use Case: Operationalize ML Model NoSQL node(e.g.) Training Data (Observations) Serving Predictions
  • 8. Spark connects to everything… DCP KV N1QL Views Adapted from: Databricks – Not Your Father’s Database https://www.brighttalk.com/webcast/12891/196891
  • 9. Use Case #2: Data Integration RDBMSs3hdfs Elasticsearc h Data engineers query data in many systems w/ one language & runtime Store results where needed for further use Late binding of schemas NoSQL
  • 11. Full Text Search Search for and fetch the most relevant records given a freeform text string Key-Value Directly fetch / store a particular record Query Specify a set of criteria to retrieve relevant data records. Essential in reporting. Map-Reduce Views Maintain materialized indexes of data records, with reduce functions for aggregation Data Streaming Efficiently, quickly stream data records to external systems for further processing or integration
  • 12. Hash Partitioned Data Auto Sharding – Bucket And vBuckets A bucket is a logical, unique key space Each bucket has active & replica data sets  Each data set has 1024 virtual buckets (vBuckets)  Each vBucket contains 1/1024th of the data set  vBuckets have no fixed physical server location Mapping of vBuckets to physical servers is called the cluster map Document IDs (keys) always get hashed to the same vBucket Couchbase SDK’s lookup the vBucket  server mapping
  • 13. N1QL Query N1QL, pronounced “nickel”, is a SQL service with extensions specifically for JSON  Is stateless execution, however…  Uses Couchbase’s Global Secondary Indexes.  These are sorted structures, range partitioned.  Both can run on any nodes within the cluster. Nodes with differing services can be added and removed as needed.
  • 14. MapReduce Couchbase Views A JavaScript based, incremental Map-Reduce service for incrementally building sorted B+Trees.  Runs on every node, local to the data on that node, stored locally.  Automatically merge-sorted at query time.
  • 15. Data Streaming with DCP A general data streaming service, Database Change Protocol.  Allows for streaming all data out and continuing, or…  Stream just what is coming in at the time of connection, or…  Stream everything out for transfer/takeover…
  • 17. Key-Value Direct fetching/storing of a particular record. Query Specifying a set of criteria to retrieve relevant data records. Essential in reporting. Map-Reduce Views Maintain materialized indexes of data records, with reduce functions for aggregation. Data Streaming Efficiently, quickly stream data records to external systems for further processing or integration. Full Text Search Search for, and allow tuning of the system to fetch the most relevant records given a freeform search string.
  • 18. Automatic sharding and data locality Integration Points of Interest
  • 19. What happens in Spark Couchbase KV When 1 Spark node per CB node, the connector will use the cluster map and push down location hints  Helpful for situations where processing is intense, like transformation  Uses pipeline IO optimization However, not available for N1QL or Views  Round robin - can’t give location hints  Back end is scatter gather with 1 node responding
  • 20. Predicate pushdown and global indexing Integration Points of Interest
  • 21. SparkSQL on N1QL with Global Secondary Indexes TableScan Scan all of the data and return it PrunedScan Scan an index that matches only relevant data to the query at hand. PrunedFilteredScan Scan an index that matches only relevant data to the query at hand.
  • 22. Couchbase Cluster B-Tree (Global Secondary Index) Data Data Data Data Query Application Client
  • 23. Couchbase Cluster B-Tree (Global Secondary Index) Data Data Data Data Query Application Client
  • 25. Predicate pushdown Notes from implementing: Spark assumes it’s getting all the data, applies the predicates Future potential optimizations Push down all the things!  Aggregations  JOINs Looking at Catalyst engine extensions from SAP  But, it’s not backward compatible and…  …many data sources can only push down filters image courtesy http://allthefreethings.com/about/
  • 26. Streams: Data Replication and Spark Streaming Integration Points of Interest
  • 27. DCP and Spark Streaming Many system architectures rely upon streaming from the ‘operational’ data store to other systems  Lambda architecture => store everything and process/reprocess everything based on access  Command Query Responsibility Segregation - (CQRS)  Other reactive pattern derived systems and frameworks
  • 28. Documents flow into the system from outside Documents are then streamed down to consumers In most common cases, flows memory to memory DCP and Spark Streaming Couchbase Node DCP Consumer Other Cluster Nodes Spark Cluster
  • 29. See it in Action
  • 30. Couchbase Spark Connector 1.2 • Spark 1.6 support, including Datasets • Full DCP flow control support • Enhanced Java APIs • Bug fixes 34
  • 32. THANK YOU. @ingenthr Try Couchbase Spark Connector 1.2 http://www.couchbase.com/bigdata
  • 34. Deployment Topology Couchbase Spark Worker Couchbase Couchbase  Many small gets  Streaming with low mutation rate  Ad hoc Couchbase Data Node Data Node Spark Worker Couchbase Couchbase  Medium processing  Predictable workloads  Plenty of overhead on machines Couchbase Couchbase Couchbase Couchbase Couchbase Couchbase Data Node Data Node Spark Worker XDCR  Heaviest processing  Workload isolation writes

Editor's Notes

  1. CHECK THE ORDER
  2. Analysis side – includes various types of machine learning and analytics Often the data warehousing includes many different sources of data
  3. This is a popular use case for Spark because it provides the ability to go big and serve your predictions to a lot of users
  4. Generally speaking, there’s a thin layer like node.js that gets JSON from the NoSQL system and feeds it to the user. Imagine that user is doing something like shopping or listening to music. As they use the App, you need ridiculously low latency because they system has to do something based on that data. But you also want to send that user’s actions back to the Spark system or wherever .
  5. Couchbase advantages include: Fast: memory-centric, integrated cache, implicit batching from the SDK with async & flat map Dev Convenience: Native SDKs, automatic cluster management, code your app without reference to infrastructure Sophisticated: Query using SQL for JSON (N1QL), supports JOINs
  6. This is like federation
  7. TODO: Come up with a better title here. Goal is to lay out the services that are part of Couchbase and then talk about how they fit in with a spark deployment.
  8. Add lots of notes
  9. TODO: Merge ideas from the next slide (hidden)
  10. TODO: fix the colors
  11. On a given Spark worker node, we can optimize Internal to the Couchbase JVM Core, we pipeline operations Amortize the responses over many operations, meaning no cost for successful operations Efficient scheduling
  12. Future: use the union or differences of indexes for filtering down candidates. More powerful than traditional relational databases owing to indexing architecture.
  13. Surprise! We can push down predicates with an O(log n) lookup 2i – super awesome, that’s how awesome we are Relational DBs do this, and they’re not expecting this to be good. Instead, go to every node and go full retard
  14. Surprise! We can push down predicates with an O(log n) lookup 2i – super awesome, that’s how awesome we are Relational DBs do this, and they’re not expecting this to be good. Instead, go to every node and go full retard
  15. Spark always applies the predicates Spark expects it will always get the data and apply the filters If you’re building a similar system, turn off the flag so Spark doesn’t do needlessly re-apply the filters
  16. Optional but cool PERFORMANCE IMPLICATIONS!!! OMG KAFKA is most common Matt could show his mad science demo Limitation - Only backfill works, can’t do from point in time. This is a bug.
  17. Can’t currently shard across spark workers since there’s no way to see this topology
  18. Fully transparent cluster and bucket management, including direct access if needed