SlideShare a Scribd company logo
1 of 22
Download to read offline
CouchBase @
LivePerson
Ido Shilon | 7/22/2013 | idos@liveperson.com
Agenda
● Connection before content
● Who LivePerson is
● Data & Technology @ LivePerson
● What is the use case (Real time analytics)
● The Story
● Why CouchBase was chosen
● Architecture & Code
● Production
● What did we learn so far
● Q&A
Company
● The leading customer intelligent
engagement platform
● 8,500 customers around the globe
● 8 of the top 10 Fortune 500 companies
● Doing SaaS from 1999 (when it was
called ASP)
Mission
Creating
Meaningful
Customer
Connections
LivePerson is…
Typical Engagements
Technology @ LivePerson
● Application Stack
○ JVM heavy
○ Linux on commodity servers
○ Private cloud based on openstack
Data @ LivePerson
● 1.8 billion visitors monitored (sessions) per
month
● 20 million connections per month
● ~0.5TB compressed data is loading into
Hadoop each day
KafkaStorm
The LivePerson use case
Visitor List
Real time Analytics for
LivePerson's customers
What do we need it for ?
● Provide visibility to LivePerson's customers on
their online visitors
● Been used by thousands of agents (call centers)
around the world
The story - once upon a time
Agents
Console
(Java app)
Visitor events/data
Web site Visitors
Monitoring
Events
● Stateful web servers (vertical
scalability)
● Multi purpose servers
● Hold all visitors state in memory
DC 2
DC1
And then the story continue
Web Agent
(Web app) ??????
Web site Visitors
Monitoring
Events
● Multiple web servers (horizontal scalability)
● SOA architecture
● All visitors states are streamed to event bus
Kafka & Strom
(Event bus)
Send
events
Send
events
Possible solutions we considered
Why did we picked Couchbase
● Performance, high throughput, really fast
● Resilience solution
● Linear scale
● Schemaless !!!
● Searchable (Queries)
● Supports both K/V & document store
● Cross data center replication
● Simplicity (quick dev and roll out)
● We needed a solution !!!
System architecture
Visitor
(Browser/Mobile)
Stream Event Processing
Visitor Feed -
Storm Topology
Customer
Representative
Kafka
Couchbase
Visitor Monitoring
Service
(1) Visitor
browsing
(2) Visitor
events
(4) Write event to
user document
(6) Return relevant
visitors
(7) Return relevant
visitors
(5) Get
visitors
List
Every 3
sec
Visitor Feed API
(3) Analyze relevant
events and persist
Data design & numbers
● Document = User
● Document Structure :
○ Each document contains 15-20 attributes, in
addition to 3 lists of sub attributes
○ Each doc contain the account id (multi
tenant db)
Data design & numbers
● Numbers
○ Avg doc size - 10 K
○ Average key size - 10 characters
○ 5 2nd level indexes
● Throughput (Final rollout)
○ ~ 1 M concurrent documents/visitors
○ ~ 100K ops/sec (heavy on insert/update)
Insert/Update
public Visitor getVisitor(String visitorSessionId) {
dalMetrics.addCouchbaseReadTotalCount();
Visitor visitor = null;
try {
String visitorDoc = (String) client.get(visitorSessionId);
visitor = gson.fromJson(visitorDoc, Visitor.class);
} catch (Exception e) {
LOG.debug("Failed to retrieve or convert visitor: "+ e.getMessage());
dalMetrics.addCouchbaseReadErrorCount();
throw e;
}
return visitor;
}
public void setVisitorWithFields(String rtSessionId, Visitor visitor) {
try {
client.set(rtSessionId, defaultTtl, gson.toJson(visitor));
} catch (Exception e) {
LOG.error("Error occurred while updating visitor fields: "+ e.getMessage());
}
}
Views/ Design doc
Use the view to set the keys and sorting
function (doc, meta) {
order = ....
if (order, doc.accountId, doc.visitStartTime.fieldValue) {
emit([doc.accountId, order, doc.visitStartTime.fieldValue],null);
}
}
Retrieve data
.../_view/by_accountid_state_timestamp?limit=10&skip=0&startkey=
["qa15020713", 0 ]&endkey=["qa15020713" , 9 ]
ComplexKey startKey = null;
// Create a new View Query
Query query = new Query();
query.setIncludeDocs(true); // Include the full document as
if (startValueToFilterBy != null) {
startKey = ComplexKey.of(accountId, startValueToFilterBy);
}
if (endValueToFilterBy == null && startKey != null) {
query.setKey(startKey);
} else {
ComplexKey endKey= ComplexKey.of(accountId, endValueToFilterBy);
query.setRange(startKey, endKey);
}
if (limit > 0) {
query.setLimit(limit);
}
if (skip > 0) {
query.setSkip(skip);
}
Cross data center replication options
1. Unidirectional replication to replicate the
data to our DR data center
2. (Future) Bi Directional replication, each data
center holds portion of entire the traffic
Insights :
○ Keyspace is the same (in both scenarios) -
avoid conflicts
○ Impact on the cluster size - from 5 nodes to
7-8 nodes in each cluster
What did we learn till now ?
● Delete docs
○ Use TTL instead instead of delete
○ Use longer TTL if possible
● In our use case the working set is around 100 %
- RAM and SSD are key factors in scalability
● Move to production ASAP, even for staging !!
Couchbase in LP - Additional Use cases
● Session state
● Cross Session state
● Caching layer - Memcached style
Thank You

More Related Content

What's hot

EventHub for kafka ecosystems kafka meetup
EventHub for kafka ecosystems   kafka meetupEventHub for kafka ecosystems   kafka meetup
EventHub for kafka ecosystems kafka meetupNitin Kumar
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd SeasonSATOSHI TAGOMORI
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Dain Sundstrom
 
Google Dataflow Intro
Google Dataflow IntroGoogle Dataflow Intro
Google Dataflow IntroIvan Glushkov
 
Boston Hadoop Meetup: Presto for the Enterprise
Boston Hadoop Meetup: Presto for the EnterpriseBoston Hadoop Meetup: Presto for the Enterprise
Boston Hadoop Meetup: Presto for the EnterpriseMatt Fuller
 
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevWebinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevAltinity Ltd
 
Column and hadoop
Column and hadoopColumn and hadoop
Column and hadoopAlex Jiang
 
E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres Regunath B
 
Lightning talk: elasticsearch at Cogenta
Lightning talk: elasticsearch at CogentaLightning talk: elasticsearch at Cogenta
Lightning talk: elasticsearch at CogentaYann Cluchey
 
Bullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query EngineBullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query EngineDataWorks Summit
 
Hoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on SparkHoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on SparkVinoth Chandar
 
Clickhouse at Cloudflare. By Marek Vavrusa
Clickhouse at Cloudflare. By Marek VavrusaClickhouse at Cloudflare. By Marek Vavrusa
Clickhouse at Cloudflare. By Marek VavrusaValery Tkachenko
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep divelucenerevolution
 
Tech Spark Presentation
Tech Spark PresentationTech Spark Presentation
Tech Spark PresentationStephen Borg
 
Building tiered data stores using aesop to bridge sql and no sql systems
Building tiered data stores using aesop to bridge sql and no sql systemsBuilding tiered data stores using aesop to bridge sql and no sql systems
Building tiered data stores using aesop to bridge sql and no sql systemsRegunath B
 
Presto at Hadoop Summit 2016
Presto at Hadoop Summit 2016Presto at Hadoop Summit 2016
Presto at Hadoop Summit 2016kbajda
 
Data streaming-systems
Data streaming-systemsData streaming-systems
Data streaming-systemsimcpune
 
Bootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source ToolsBootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source Toolsbotsplash.com
 
Meetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMeetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMinsk MongoDB User Group
 

What's hot (20)

EventHub for kafka ecosystems kafka meetup
EventHub for kafka ecosystems   kafka meetupEventHub for kafka ecosystems   kafka meetup
EventHub for kafka ecosystems kafka meetup
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd Season
 
Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)Presto Meetup (2015-03-19)
Presto Meetup (2015-03-19)
 
Google Dataflow Intro
Google Dataflow IntroGoogle Dataflow Intro
Google Dataflow Intro
 
Boston Hadoop Meetup: Presto for the Enterprise
Boston Hadoop Meetup: Presto for the EnterpriseBoston Hadoop Meetup: Presto for the Enterprise
Boston Hadoop Meetup: Presto for the Enterprise
 
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander ZaitsevWebinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
Webinar 2017. Supercharge your analytics with ClickHouse. Alexander Zaitsev
 
Column and hadoop
Column and hadoopColumn and hadoop
Column and hadoop
 
E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres
 
Lightning talk: elasticsearch at Cogenta
Lightning talk: elasticsearch at CogentaLightning talk: elasticsearch at Cogenta
Lightning talk: elasticsearch at Cogenta
 
Bullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query EngineBullet: A Real Time Data Query Engine
Bullet: A Real Time Data Query Engine
 
Hoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on SparkHoodie: How (And Why) We built an analytical datastore on Spark
Hoodie: How (And Why) We built an analytical datastore on Spark
 
Clickhouse at Cloudflare. By Marek Vavrusa
Clickhouse at Cloudflare. By Marek VavrusaClickhouse at Cloudflare. By Marek Vavrusa
Clickhouse at Cloudflare. By Marek Vavrusa
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
 
Tech Spark Presentation
Tech Spark PresentationTech Spark Presentation
Tech Spark Presentation
 
Building tiered data stores using aesop to bridge sql and no sql systems
Building tiered data stores using aesop to bridge sql and no sql systemsBuilding tiered data stores using aesop to bridge sql and no sql systems
Building tiered data stores using aesop to bridge sql and no sql systems
 
Presto at Hadoop Summit 2016
Presto at Hadoop Summit 2016Presto at Hadoop Summit 2016
Presto at Hadoop Summit 2016
 
Using Embulk at Treasure Data
Using Embulk at Treasure DataUsing Embulk at Treasure Data
Using Embulk at Treasure Data
 
Data streaming-systems
Data streaming-systemsData streaming-systems
Data streaming-systems
 
Bootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source ToolsBootstrap SaaS startup using Open Source Tools
Bootstrap SaaS startup using Open Source Tools
 
Meetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebServiceMeetup#2: Building responsive Symbology & Suggest WebService
Meetup#2: Building responsive Symbology & Suggest WebService
 

Similar to Couchbase@live person meetup july 22nd

IOOF IT System Modernisation
IOOF IT System ModernisationIOOF IT System Modernisation
IOOF IT System ModernisationMongoDB
 
Streaming SQL to unify batch and stream processing: Theory and practice with ...
Streaming SQL to unify batch and stream processing: Theory and practice with ...Streaming SQL to unify batch and stream processing: Theory and practice with ...
Streaming SQL to unify batch and stream processing: Theory and practice with ...Fabian Hueske
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in MotionRuhani Arora
 
Working with data using Azure Functions.pdf
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdfStephanie Locke
 
Real-Time ETL in Practice with WSO2 Enterprise Integrator
Real-Time ETL in Practice with WSO2 Enterprise IntegratorReal-Time ETL in Practice with WSO2 Enterprise Integrator
Real-Time ETL in Practice with WSO2 Enterprise IntegratorWSO2
 
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2
 
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...WSO2
 
Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextPrateek Maheshwari
 
Scaling up uber's real time data analytics
Scaling up uber's real time data analyticsScaling up uber's real time data analytics
Scaling up uber's real time data analyticsXiang Fu
 
Building a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSBuilding a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSSmartNews, Inc.
 
Towards sql for streams
Towards sql for streamsTowards sql for streams
Towards sql for streamsRadu Tudoran
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsSriskandarajah Suhothayan
 
[WSO2Con USA 2018] Patterns for Building Streaming Apps
[WSO2Con USA 2018] Patterns for Building Streaming Apps[WSO2Con USA 2018] Patterns for Building Streaming Apps
[WSO2Con USA 2018] Patterns for Building Streaming AppsWSO2
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...MSDEVMTL
 
Writing an Interactive Interface for SQL on Flink
Writing an Interactive Interface for SQL on FlinkWriting an Interactive Interface for SQL on Flink
Writing an Interactive Interface for SQL on FlinkEventador
 
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...HostedbyConfluent
 
Event Driven Microservices
Event Driven MicroservicesEvent Driven Microservices
Event Driven MicroservicesFabrizio Fortino
 

Similar to Couchbase@live person meetup july 22nd (20)

IOOF IT System Modernisation
IOOF IT System ModernisationIOOF IT System Modernisation
IOOF IT System Modernisation
 
Streaming SQL to unify batch and stream processing: Theory and practice with ...
Streaming SQL to unify batch and stream processing: Theory and practice with ...Streaming SQL to unify batch and stream processing: Theory and practice with ...
Streaming SQL to unify batch and stream processing: Theory and practice with ...
 
Azure Stream Analytics : Analyse Data in Motion
Azure Stream Analytics  : Analyse Data in MotionAzure Stream Analytics  : Analyse Data in Motion
Azure Stream Analytics : Analyse Data in Motion
 
Working with data using Azure Functions.pdf
Working with data using Azure Functions.pdfWorking with data using Azure Functions.pdf
Working with data using Azure Functions.pdf
 
Real-Time ETL in Practice with WSO2 Enterprise Integrator
Real-Time ETL in Practice with WSO2 Enterprise IntegratorReal-Time ETL in Practice with WSO2 Enterprise Integrator
Real-Time ETL in Practice with WSO2 Enterprise Integrator
 
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
 
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
 
Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's Next
 
Scaling up uber's real time data analytics
Scaling up uber's real time data analyticsScaling up uber's real time data analytics
Scaling up uber's real time data analytics
 
Building a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWSBuilding a Sustainable Data Platform on AWS
Building a Sustainable Data Platform on AWS
 
Towards sql for streams
Towards sql for streamsTowards sql for streams
Towards sql for streams
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needs
 
[WSO2Con USA 2018] Patterns for Building Streaming Apps
[WSO2Con USA 2018] Patterns for Building Streaming Apps[WSO2Con USA 2018] Patterns for Building Streaming Apps
[WSO2Con USA 2018] Patterns for Building Streaming Apps
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
Siddhi - cloud-native stream processor
Siddhi - cloud-native stream processorSiddhi - cloud-native stream processor
Siddhi - cloud-native stream processor
 
Patterns for Building Streaming Apps
Patterns for Building Streaming AppsPatterns for Building Streaming Apps
Patterns for Building Streaming Apps
 
Writing an Interactive Interface for SQL on Flink
Writing an Interactive Interface for SQL on FlinkWriting an Interactive Interface for SQL on Flink
Writing an Interactive Interface for SQL on Flink
 
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
Sub-Second SQL Search, Aggregations and Joins with Kafka and Rockset | Dhruba...
 
Event Driven Microservices
Event Driven MicroservicesEvent Driven Microservices
Event Driven Microservices
 

More from Ido Shilon

Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeIdo Shilon
 
Why ml and ai are the future of gaming david sachs @ tomobox
Why ml and ai are the future of gaming david sachs @ tomoboxWhy ml and ai are the future of gaming david sachs @ tomobox
Why ml and ai are the future of gaming david sachs @ tomoboxIdo Shilon
 
Deep learning at nmc devin jones
Deep learning at nmc devin jones Deep learning at nmc devin jones
Deep learning at nmc devin jones Ido Shilon
 
Accelerating scale from startups to enterprise by Peter bakas
Accelerating scale from startups to enterprise by Peter bakasAccelerating scale from startups to enterprise by Peter bakas
Accelerating scale from startups to enterprise by Peter bakasIdo Shilon
 
Blind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forterBlind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forterIdo Shilon
 
Using druid for interactive count distinct queries at scale @ nmc
Using druid  for interactive count distinct queries at scale @ nmcUsing druid  for interactive count distinct queries at scale @ nmc
Using druid for interactive count distinct queries at scale @ nmcIdo Shilon
 
Micro apps across 3 continents using React js
Micro apps across 3 continents using React js Micro apps across 3 continents using React js
Micro apps across 3 continents using React js Ido Shilon
 
BDX 2016 - Arnon rotem gal-oz @ appsflyer
BDX 2016 - Arnon rotem gal-oz @ appsflyerBDX 2016 - Arnon rotem gal-oz @ appsflyer
BDX 2016 - Arnon rotem gal-oz @ appsflyerIdo Shilon
 
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate
BDX 2016 - Kevin lyons & yakir buskilla  @ eXelate BDX 2016 - Kevin lyons & yakir buskilla  @ eXelate
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate Ido Shilon
 
BDX 2016- Monal daxini @ Netflix
BDX 2016-  Monal daxini  @ NetflixBDX 2016-  Monal daxini  @ Netflix
BDX 2016- Monal daxini @ NetflixIdo Shilon
 
BDX 2016 - Tal sliwowicz @ taboola
BDX 2016 - Tal sliwowicz @ taboolaBDX 2016 - Tal sliwowicz @ taboola
BDX 2016 - Tal sliwowicz @ taboolaIdo Shilon
 
BDX 2016 - Tzach zohar @ kenshoo
BDX 2016 - Tzach zohar  @ kenshooBDX 2016 - Tzach zohar  @ kenshoo
BDX 2016 - Tzach zohar @ kenshooIdo Shilon
 
Scaling to 1 million users v1
Scaling to 1 million users v1Scaling to 1 million users v1
Scaling to 1 million users v1Ido Shilon
 

More from Ido Shilon (13)

Production ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ wazeProduction ready big ml workflows from zero to hero daniel marcous @ waze
Production ready big ml workflows from zero to hero daniel marcous @ waze
 
Why ml and ai are the future of gaming david sachs @ tomobox
Why ml and ai are the future of gaming david sachs @ tomoboxWhy ml and ai are the future of gaming david sachs @ tomobox
Why ml and ai are the future of gaming david sachs @ tomobox
 
Deep learning at nmc devin jones
Deep learning at nmc devin jones Deep learning at nmc devin jones
Deep learning at nmc devin jones
 
Accelerating scale from startups to enterprise by Peter bakas
Accelerating scale from startups to enterprise by Peter bakasAccelerating scale from startups to enterprise by Peter bakas
Accelerating scale from startups to enterprise by Peter bakas
 
Blind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forterBlind spots in big data erez koren @ forter
Blind spots in big data erez koren @ forter
 
Using druid for interactive count distinct queries at scale @ nmc
Using druid  for interactive count distinct queries at scale @ nmcUsing druid  for interactive count distinct queries at scale @ nmc
Using druid for interactive count distinct queries at scale @ nmc
 
Micro apps across 3 continents using React js
Micro apps across 3 continents using React js Micro apps across 3 continents using React js
Micro apps across 3 continents using React js
 
BDX 2016 - Arnon rotem gal-oz @ appsflyer
BDX 2016 - Arnon rotem gal-oz @ appsflyerBDX 2016 - Arnon rotem gal-oz @ appsflyer
BDX 2016 - Arnon rotem gal-oz @ appsflyer
 
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate
BDX 2016 - Kevin lyons & yakir buskilla  @ eXelate BDX 2016 - Kevin lyons & yakir buskilla  @ eXelate
BDX 2016 - Kevin lyons & yakir buskilla @ eXelate
 
BDX 2016- Monal daxini @ Netflix
BDX 2016-  Monal daxini  @ NetflixBDX 2016-  Monal daxini  @ Netflix
BDX 2016- Monal daxini @ Netflix
 
BDX 2016 - Tal sliwowicz @ taboola
BDX 2016 - Tal sliwowicz @ taboolaBDX 2016 - Tal sliwowicz @ taboola
BDX 2016 - Tal sliwowicz @ taboola
 
BDX 2016 - Tzach zohar @ kenshoo
BDX 2016 - Tzach zohar  @ kenshooBDX 2016 - Tzach zohar  @ kenshoo
BDX 2016 - Tzach zohar @ kenshoo
 
Scaling to 1 million users v1
Scaling to 1 million users v1Scaling to 1 million users v1
Scaling to 1 million users v1
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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)
 
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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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 Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Couchbase@live person meetup july 22nd

  • 1. CouchBase @ LivePerson Ido Shilon | 7/22/2013 | idos@liveperson.com
  • 2. Agenda ● Connection before content ● Who LivePerson is ● Data & Technology @ LivePerson ● What is the use case (Real time analytics) ● The Story ● Why CouchBase was chosen ● Architecture & Code ● Production ● What did we learn so far ● Q&A
  • 3. Company ● The leading customer intelligent engagement platform ● 8,500 customers around the globe ● 8 of the top 10 Fortune 500 companies ● Doing SaaS from 1999 (when it was called ASP) Mission Creating Meaningful Customer Connections LivePerson is…
  • 5. Technology @ LivePerson ● Application Stack ○ JVM heavy ○ Linux on commodity servers ○ Private cloud based on openstack
  • 6. Data @ LivePerson ● 1.8 billion visitors monitored (sessions) per month ● 20 million connections per month ● ~0.5TB compressed data is loading into Hadoop each day KafkaStorm
  • 7. The LivePerson use case Visitor List Real time Analytics for LivePerson's customers
  • 8. What do we need it for ? ● Provide visibility to LivePerson's customers on their online visitors ● Been used by thousands of agents (call centers) around the world
  • 9. The story - once upon a time Agents Console (Java app) Visitor events/data Web site Visitors Monitoring Events ● Stateful web servers (vertical scalability) ● Multi purpose servers ● Hold all visitors state in memory
  • 10. DC 2 DC1 And then the story continue Web Agent (Web app) ?????? Web site Visitors Monitoring Events ● Multiple web servers (horizontal scalability) ● SOA architecture ● All visitors states are streamed to event bus Kafka & Strom (Event bus) Send events Send events
  • 11. Possible solutions we considered
  • 12. Why did we picked Couchbase ● Performance, high throughput, really fast ● Resilience solution ● Linear scale ● Schemaless !!! ● Searchable (Queries) ● Supports both K/V & document store ● Cross data center replication ● Simplicity (quick dev and roll out) ● We needed a solution !!!
  • 13. System architecture Visitor (Browser/Mobile) Stream Event Processing Visitor Feed - Storm Topology Customer Representative Kafka Couchbase Visitor Monitoring Service (1) Visitor browsing (2) Visitor events (4) Write event to user document (6) Return relevant visitors (7) Return relevant visitors (5) Get visitors List Every 3 sec Visitor Feed API (3) Analyze relevant events and persist
  • 14. Data design & numbers ● Document = User ● Document Structure : ○ Each document contains 15-20 attributes, in addition to 3 lists of sub attributes ○ Each doc contain the account id (multi tenant db)
  • 15. Data design & numbers ● Numbers ○ Avg doc size - 10 K ○ Average key size - 10 characters ○ 5 2nd level indexes ● Throughput (Final rollout) ○ ~ 1 M concurrent documents/visitors ○ ~ 100K ops/sec (heavy on insert/update)
  • 16. Insert/Update public Visitor getVisitor(String visitorSessionId) { dalMetrics.addCouchbaseReadTotalCount(); Visitor visitor = null; try { String visitorDoc = (String) client.get(visitorSessionId); visitor = gson.fromJson(visitorDoc, Visitor.class); } catch (Exception e) { LOG.debug("Failed to retrieve or convert visitor: "+ e.getMessage()); dalMetrics.addCouchbaseReadErrorCount(); throw e; } return visitor; } public void setVisitorWithFields(String rtSessionId, Visitor visitor) { try { client.set(rtSessionId, defaultTtl, gson.toJson(visitor)); } catch (Exception e) { LOG.error("Error occurred while updating visitor fields: "+ e.getMessage()); } }
  • 17. Views/ Design doc Use the view to set the keys and sorting function (doc, meta) { order = .... if (order, doc.accountId, doc.visitStartTime.fieldValue) { emit([doc.accountId, order, doc.visitStartTime.fieldValue],null); } }
  • 18. Retrieve data .../_view/by_accountid_state_timestamp?limit=10&skip=0&startkey= ["qa15020713", 0 ]&endkey=["qa15020713" , 9 ] ComplexKey startKey = null; // Create a new View Query Query query = new Query(); query.setIncludeDocs(true); // Include the full document as if (startValueToFilterBy != null) { startKey = ComplexKey.of(accountId, startValueToFilterBy); } if (endValueToFilterBy == null && startKey != null) { query.setKey(startKey); } else { ComplexKey endKey= ComplexKey.of(accountId, endValueToFilterBy); query.setRange(startKey, endKey); } if (limit > 0) { query.setLimit(limit); } if (skip > 0) { query.setSkip(skip); }
  • 19. Cross data center replication options 1. Unidirectional replication to replicate the data to our DR data center 2. (Future) Bi Directional replication, each data center holds portion of entire the traffic Insights : ○ Keyspace is the same (in both scenarios) - avoid conflicts ○ Impact on the cluster size - from 5 nodes to 7-8 nodes in each cluster
  • 20. What did we learn till now ? ● Delete docs ○ Use TTL instead instead of delete ○ Use longer TTL if possible ● In our use case the working set is around 100 % - RAM and SSD are key factors in scalability ● Move to production ASAP, even for staging !!
  • 21. Couchbase in LP - Additional Use cases ● Session state ● Cross Session state ● Caching layer - Memcached style