SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
1
Apache Usergrid: Web Scale Mobile APIs
with ElasticSearch and Cassandra!
Todd Nine
Principal Architect
Jeffrey West
BaaS Engineering
Coach
Agenda
2
1.
 Why do we need Usergrid?
2.
 What is Usergrid & How does it work?
3.
 How do we achieve web scale?
4.
 Learnings
5.
 Roadmap & Questions
©2015 Apigee. All Rights Reserved.
3
(m) obile
B ackend 
a s
a
S ervice
Datastore
Push
Notifications
Connections /
Social
Location
Users
…and more
Application
Systems of Engagement
4
Building Systems of Engagement with Edge API BaaS
5
Systems of "
Record
Apigee Edge: Intelligent API Platform
Systems of
Engagement
App Developers
Database
ERP
CRM
Data "
Warehouse
Data Lake
Partner Apps
Consumer Apps
 Employee Apps
 Insights
6
©2015 Apigee. All Rights Reserved. 
Web Scale"
10’s of thousands requests/sec"
…across multiple data centers
7
©2015 Apigee. All Rights Reserved. 
Web Scale / MongoDB
Usergrid
8
• Apache Open Source Mobile Backend as a Service
• REST API for easy interaction from any platform
• SDKs available for iOS / Android / Javascript

9
The Usergrid Taxonomy
10
Organization
Organization
Organization
Application
Devices
Users
 Groups
Security
 Roles
Collection
Collection
Entity
{…}
Entity
{…}
Entity
{…}
Application
Devices
Users
 Groups
Security
 Roles
Entity
{…}
Entity
{…}
Entity
{…}
Collection
Collection
Entity
{…}
Entity
{…}
Entity
{…}
But I just want persistence!
12
©2015 Apigee. All Rights Reserved. 
REST API
GET / PUT / POST / DELETE
Scalable, Multi-tenant
Persistence (Single Cluster)
What people do seeking ‘web scale’?
13
©2015 Apigee. All Rights Reserved.
The Usergrid Stack
14
•  Canonical System of Record
•  Collections
–  Unique Values / Primary Keys
•  Entities
–  Schemaless design
–  O(1) entity retrieval
•  Connections / Graph
–  Scalable Relationships
Horizontally Scalable Persistence
Built on Horizontally Scalable Technologies
• Filter / Limit / Cursor:
– GET http://api.usergrid.com/{org}/{app}/{collection}?
ql=select * where title = 'A Tale of Two
Cities’&limit=50&cursor=LTIxNDg0NDUxNDpnR2tBQVFFQWdITUFDW
FJ2YlM1emJXbDBhQUNBZFFBUUQyMVZneExfRWVLRlV3TG9Hc1doZXdDQW
RRQVFIYVdjb0JwREVlS1VCd0xvR3NWT0JRQQ
– GET http://api.usergrid.com/{org}/{app}/{collection}?
ql=select * where location within {d} of {x, y}
17
©2015 Apigee. All Rights Reserved. 
( )
Usergrid Application
18
©2015 Apigee. All Rights Reserved.
Architecture: Multi-Region Indexing & Consistency
SQS
SQS
 SNS
6) INDEX
6) INDEX
Region B
Region A
C* Replication
2)WRITE
5)READ
5)READ
Web Scale
20
Bottlenecks
21
©2015 Apigee. All Rights Reserved. 
Tomcat
20% CPU
!?? WHY ??!
Cassandra
10% CPU
Iterative Process
22
©2015 Apigee. All Rights Reserved. 
10,266/s
9,700/s
7,233/s
3,750
Hurdles
•  Gatling
–  Can’t get 10k/s with one node
•  Cassandra 
–  CPU
•  Compression?
•  C3.2xlarge -> c3.4xlarge
•  Row caching?
•  Tomcat
–  HTTP Connector
•  acceptCount
•  maxConnections
•  maxThreads
•  Non-blocking IO?
•  Usergrid
–  # of reads to Cassandra
23
©2015 Apigee. All Rights Reserved.
Scaling Usergrid to 10,000 Req/s w/ Gatling
•  10k test run:
–  35 c3.xlarge Tomcat Nodes
–  9 c3.4xlarge C* nodes
–  6 m3.large ES nodes
•  Closing test ~7,800/s:
–  15 c3.xlarge Tomcat Nodes
–  9 c3.4xlarge C* nodes
–  6 m3.large ES nodes
24
Elasticsearch
(working… not so well…)
25
Learn from our mistakes
26
Risks of Dynamic Mapping
27
©2015 Apigee. All Rights Reserved. 
D
D
D
D
 M
Risks of Dynamic Mapping
28
©2015 Apigee. All Rights Reserved. 
DD
D
DD
DD
D
DD
D D
DD
DD
DD
DD
Inbound message
requires a mapping
update
Mapping updated &
broadcast to the
cluster
M
Risks of Dynamic Mapping
29
©2015 Apigee. All Rights Reserved. 
M
DD
D
DD
DD
D
DD
D D
DD
DD
DD
DD
At scale (full loaded)
only one mapping
update can
processed at a time
Risks of Dynamic Mapping
30
©2015 Apigee. All Rights Reserved. 
DD
D
DD
DD
D
DD
D D
DD
DD
DD
DD
M
Risks of Dynamic Mapping
31
©2015 Apigee. All Rights Reserved. 
M
DD
D
DD
DD
D
DD
D D
DD
DD
DD
DD
30 ES Data Nodes
X
100MB mapping file
= 
3,000MB

For each schema/
mapping update
3GB data transfer
X
5M entities with
different schemas
=
a LOT of data
transfer and a lot
of latency
Risks of Dynamic Mapping
32
©2015 Apigee. All Rights Reserved. 
DD
D
DD
DD
D
DD
D D
DD
DD
DD
DD
M
Elasticsearch
(working well)
33
{

"hello": {

"world":{

"message": "Hello!"

},

"items": [

{

"name": "apples",

"weight": 100

} 

]

}

}
{

"uuid": "48e262d6-b922-11e4-8a11",

"ud_entity_id": "ad2b33c2e",

"size": 100,

"ug_app": "1a67aed7-bbb3-11e4-8a11",

"fields": [

{

”name": "hello.world.message",

”string": "Hello!"

},

{

”name": "items[0].name",

”string": "apples"

},

{

”name": "items[0].weight",

"integer": 100

} 

]

}

Flattened Documents
34
©2015 Apigee. All Rights Reserved. 
Indexed as
Data Node A
Data Node B
Data Node C
Index Allocation
•  Multiple Indexes spread across the cluster
•  Indexes have shards
•  Read/Write aliases point to physical
indexes
•  Aliases assigned based on hashing of the
App UUID
35
©2015 Apigee. All Rights Reserved. 
Index_1
1
1
2
3
2
3
app_1_read_alias
app_1_write_alias
Data Node A
Data Node B
Data Node C
Tenant Management
36
©2015 Apigee. All Rights Reserved. 
Index_1
1
1
2
3
2
3
app_1_read_alias
app_1_write_alias
app_2_read_alias
app_2_write_alias
Data Node A
Data Node B
Data Node C
Tenant Management
•  Assign Write alias to new Index
•  Add new index to read alias
•  Stream data from old index
•  Delete data from old index
37
©2015 Apigee. All Rights Reserved. 
Index_1
1
1
2
3
2
3
Index_2
1
1
2
3
2
 3
app_2_read_alias
app_2_write_alias
stream2es
app_1_read_alias
app_1_write_alias
Data Node D
Data Node A
Data Node B
Data Node C
Tenant Management
•  Indexes targeted to separate machines
38
©2015 Apigee. All Rights Reserved. 
Index_1
1
1
2
3
2
3
Index_2
1
1
2
3
2
3
app_1_read_alias
app_1_write_alias
 app_2_read_alias
app_2_write_alias
Data Node A
Data Node B
Data Node C
Data Node A
Data Node B
Data Node C
Multiple Scaling Vectors
39
©2015 Apigee. All Rights Reserved. 
Index_1
1
1
2
3
2
3
Index_2
1
1
2
3
2
3
Index_3
1
1
 2
3
2
 3
Index_4
1
1
 2
3
2
3
Index_5
1
1
2
3
2
3
Working with Graph & NoSQL Data
40
Data De-normalization per interaction
41
ERP
Product
CatalogsCRM Data Lake
Data
Warehouse
Graph Data Persistence: Entities & Connections
•  Entities
–  Objects / Documents representing an Entity
•  Collections
–  Logical grouping of Entities
•  Connections / Entity Relationships
–  Graph Data Structure
–  /{collection}/{entityA}/{verb}/{collection}/
{entityB}
–  /Users/me/likes/Products/iPhone6
–  /Recipes/Bread/includes/Ingredients/Flour
42
User
A
Product
A
User
B
User
C
Likes>>
<<Liking
Roadmap
43
What’s Next for Usergrid
•  Grow the community!
•  Blueprints Driver Release!
•  Service abstraction
•  Indexing closer to real-time
•  Larger Clusters
•  Distributed Work System
•  Encryption & Security
44
http://usergrid.apache.org
45

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Serverless beyond AWS Lambda
Serverless beyond AWS LambdaServerless beyond AWS Lambda
Serverless beyond AWS Lambda
 
Cloud Security @ Netflix
Cloud Security @ NetflixCloud Security @ Netflix
Cloud Security @ Netflix
 
Architecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web APIArchitecting &Building Scalable Secure Web API
Architecting &Building Scalable Secure Web API
 
Comparison and mapping between various cloud services 2019
Comparison and mapping between various cloud services 2019Comparison and mapping between various cloud services 2019
Comparison and mapping between various cloud services 2019
 
(MBL402) Mobile Identity Management & Data Sync Using Amazon Cognito
(MBL402) Mobile Identity Management & Data Sync Using Amazon Cognito(MBL402) Mobile Identity Management & Data Sync Using Amazon Cognito
(MBL402) Mobile Identity Management & Data Sync Using Amazon Cognito
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
 
Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)Making connected apps with BaaS (Droidcon Bangalore 2014)
Making connected apps with BaaS (Droidcon Bangalore 2014)
 
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
(SEC310) Integrating AWS with External Identity Management | AWS re:Invent 2014
 
Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013Cloud Security At Netflix, October 2013
Cloud Security At Netflix, October 2013
 
(SEC308) Navigating PCI Compliance in the Cloud | AWS re:Invent 2014
(SEC308) Navigating PCI Compliance in the Cloud | AWS re:Invent 2014(SEC308) Navigating PCI Compliance in the Cloud | AWS re:Invent 2014
(SEC308) Navigating PCI Compliance in the Cloud | AWS re:Invent 2014
 
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
(SEC402) Intrusion Detection in the Cloud | AWS re:Invent 2014
 
Azure Big Picture
Azure Big PictureAzure Big Picture
Azure Big Picture
 
(SEC324) NEW! Introducing Amazon Inspector
(SEC324) NEW! Introducing Amazon Inspector(SEC324) NEW! Introducing Amazon Inspector
(SEC324) NEW! Introducing Amazon Inspector
 
TechDays Finland 2020: Azuren tietoturva haltuun!
TechDays Finland 2020: Azuren tietoturva haltuun!TechDays Finland 2020: Azuren tietoturva haltuun!
TechDays Finland 2020: Azuren tietoturva haltuun!
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code Suite
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Designing Secure APIs in the Cloud
Designing Secure APIs in the CloudDesigning Secure APIs in the Cloud
Designing Secure APIs in the Cloud
 
Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
 
Designing an Enterprise Windows and .NET Authentication Strategy (WIN321) - A...
Designing an Enterprise Windows and .NET Authentication Strategy (WIN321) - A...Designing an Enterprise Windows and .NET Authentication Strategy (WIN321) - A...
Designing an Enterprise Windows and .NET Authentication Strategy (WIN321) - A...
 
Innovation anywhere with microsoft azure arc
Innovation anywhere with microsoft azure arcInnovation anywhere with microsoft azure arc
Innovation anywhere with microsoft azure arc
 

Andere mochten auch

Cybersecurity-Serverless-Graph DB
Cybersecurity-Serverless-Graph DBCybersecurity-Serverless-Graph DB
Cybersecurity-Serverless-Graph DB
Sukumar Nayak
 
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
DataStax
 

Andere mochten auch (11)

Cybersecurity-Serverless-Graph DB
Cybersecurity-Serverless-Graph DBCybersecurity-Serverless-Graph DB
Cybersecurity-Serverless-Graph DB
 
Data Modeling with Cassandra Column Families
Data Modeling with Cassandra Column FamiliesData Modeling with Cassandra Column Families
Data Modeling with Cassandra Column Families
 
Cassandra synergy
Cassandra synergyCassandra synergy
Cassandra synergy
 
NoSQL Database- cassandra column Base DB
NoSQL Database- cassandra column Base DBNoSQL Database- cassandra column Base DB
NoSQL Database- cassandra column Base DB
 
Optimising eCommerce with Machine Learning & Game Theory — Cassandra, Elasti...
 Optimising eCommerce with Machine Learning & Game Theory — Cassandra, Elasti... Optimising eCommerce with Machine Learning & Game Theory — Cassandra, Elasti...
Optimising eCommerce with Machine Learning & Game Theory — Cassandra, Elasti...
 
Usergrid Overview
Usergrid OverviewUsergrid Overview
Usergrid Overview
 
Open Source Mobile Backend on Cassandra
Open Source Mobile Backend on CassandraOpen Source Mobile Backend on Cassandra
Open Source Mobile Backend on Cassandra
 
Predicting behaviour with Machine Learning
Predicting behaviour with Machine Learning Predicting behaviour with Machine Learning
Predicting behaviour with Machine Learning
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
CloudStack Architecture
CloudStack ArchitectureCloudStack Architecture
CloudStack Architecture
 
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
 

Ähnlich wie I Love APIs 2015: Apache Usergrid Web Scale Mobile APIs with Elastic Search and Cassandra

IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
In-Memory Computing Summit
 
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
StampedeCon
 

Ähnlich wie I Love APIs 2015: Apache Usergrid Web Scale Mobile APIs with Elastic Search and Cassandra (20)

Deep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaSDeep Dive: Strategic Importance of BaaS
Deep Dive: Strategic Importance of BaaS
 
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
 
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
IMC Summit 2016 Breakout - William Bain - Implementing Extensible Data Struct...
 
Melbourne: Certus Data 2.0 Vault Meetup with Snowflake - Data Vault In The Cl...
Melbourne: Certus Data 2.0 Vault Meetup with Snowflake - Data Vault In The Cl...Melbourne: Certus Data 2.0 Vault Meetup with Snowflake - Data Vault In The Cl...
Melbourne: Certus Data 2.0 Vault Meetup with Snowflake - Data Vault In The Cl...
 
DEVNET-1140 InterCloud Mapreduce and Spark Workload Migration and Sharing: Fi...
DEVNET-1140	InterCloud Mapreduce and Spark Workload Migration and Sharing: Fi...DEVNET-1140	InterCloud Mapreduce and Spark Workload Migration and Sharing: Fi...
DEVNET-1140 InterCloud Mapreduce and Spark Workload Migration and Sharing: Fi...
 
Shashi Raina [AWS] & Al Sargent [InfluxData] | Build Modern Monitoring with I...
Shashi Raina [AWS] & Al Sargent [InfluxData] | Build Modern Monitoring with I...Shashi Raina [AWS] & Al Sargent [InfluxData] | Build Modern Monitoring with I...
Shashi Raina [AWS] & Al Sargent [InfluxData] | Build Modern Monitoring with I...
 
Achieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloudAchieve big data analytic platform with lambda architecture on cloud
Achieve big data analytic platform with lambda architecture on cloud
 
What's New in Apache Hive 3.0?
What's New in Apache Hive 3.0?What's New in Apache Hive 3.0?
What's New in Apache Hive 3.0?
 
What's New in Apache Hive 3.0 - Tokyo
What's New in Apache Hive 3.0 - TokyoWhat's New in Apache Hive 3.0 - Tokyo
What's New in Apache Hive 3.0 - Tokyo
 
What's New in Cytoscape
What's New in CytoscapeWhat's New in Cytoscape
What's New in Cytoscape
 
Cepta The Future of Data with Power BI
Cepta The Future of Data with Power BICepta The Future of Data with Power BI
Cepta The Future of Data with Power BI
 
StampedeCon 2015 Keynote
StampedeCon 2015 KeynoteStampedeCon 2015 Keynote
StampedeCon 2015 Keynote
 
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
How Cisco Migrated from MapReduce Jobs to Spark Jobs - StampedeCon 2015
 
OGCE SC10
OGCE SC10OGCE SC10
OGCE SC10
 
DEVNET-1166 Open SDN Controller APIs
DEVNET-1166	Open SDN Controller APIsDEVNET-1166	Open SDN Controller APIs
DEVNET-1166 Open SDN Controller APIs
 
InfoSphere BigInsights - Analytics power for Hadoop - field experience
InfoSphere BigInsights - Analytics power for Hadoop - field experienceInfoSphere BigInsights - Analytics power for Hadoop - field experience
InfoSphere BigInsights - Analytics power for Hadoop - field experience
 
I Love APIs Europe 2015: Developer Sessions
I Love APIs Europe 2015: Developer SessionsI Love APIs Europe 2015: Developer Sessions
I Love APIs Europe 2015: Developer Sessions
 
Getting Started with API Management – Why It's Needed On-prem and in the Cloud
Getting Started with API Management – Why It's Needed On-prem and in the CloudGetting Started with API Management – Why It's Needed On-prem and in the Cloud
Getting Started with API Management – Why It's Needed On-prem and in the Cloud
 
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)
 
Delivering Insights from 20M+ Smart Homes with 500M+ Devices
Delivering Insights from 20M+ Smart Homes with 500M+ DevicesDelivering Insights from 20M+ Smart Homes with 500M+ Devices
Delivering Insights from 20M+ Smart Homes with 500M+ Devices
 

Mehr von Apigee | Google Cloud

Mehr von Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Kürzlich hochgeladen

%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 

I Love APIs 2015: Apache Usergrid Web Scale Mobile APIs with Elastic Search and Cassandra

  • 1. 1 Apache Usergrid: Web Scale Mobile APIs with ElasticSearch and Cassandra! Todd Nine Principal Architect Jeffrey West BaaS Engineering Coach
  • 2. Agenda 2 1. Why do we need Usergrid? 2. What is Usergrid & How does it work? 3. How do we achieve web scale? 4. Learnings 5. Roadmap & Questions ©2015 Apigee. All Rights Reserved.
  • 3. 3 (m) obile B ackend a s a S ervice Datastore Push Notifications Connections / Social Location Users …and more Application
  • 5. Building Systems of Engagement with Edge API BaaS 5 Systems of " Record Apigee Edge: Intelligent API Platform Systems of Engagement App Developers Database ERP CRM Data " Warehouse Data Lake Partner Apps Consumer Apps Employee Apps Insights
  • 6. 6 ©2015 Apigee. All Rights Reserved. Web Scale" 10’s of thousands requests/sec" …across multiple data centers
  • 7. 7 ©2015 Apigee. All Rights Reserved. Web Scale / MongoDB
  • 9. • Apache Open Source Mobile Backend as a Service • REST API for easy interaction from any platform • SDKs available for iOS / Android / Javascript 9
  • 11. Organization Organization Organization Application Devices Users Groups Security Roles Collection Collection Entity {…} Entity {…} Entity {…} Application Devices Users Groups Security Roles Entity {…} Entity {…} Entity {…} Collection Collection Entity {…} Entity {…} Entity {…}
  • 12. But I just want persistence! 12 ©2015 Apigee. All Rights Reserved. REST API GET / PUT / POST / DELETE Scalable, Multi-tenant Persistence (Single Cluster)
  • 13. What people do seeking ‘web scale’? 13 ©2015 Apigee. All Rights Reserved.
  • 15. •  Canonical System of Record •  Collections –  Unique Values / Primary Keys •  Entities –  Schemaless design –  O(1) entity retrieval •  Connections / Graph –  Scalable Relationships Horizontally Scalable Persistence
  • 16. Built on Horizontally Scalable Technologies • Filter / Limit / Cursor: – GET http://api.usergrid.com/{org}/{app}/{collection}? ql=select * where title = 'A Tale of Two Cities’&limit=50&cursor=LTIxNDg0NDUxNDpnR2tBQVFFQWdITUFDW FJ2YlM1emJXbDBhQUNBZFFBUUQyMVZneExfRWVLRlV3TG9Hc1doZXdDQW RRQVFIYVdjb0JwREVlS1VCd0xvR3NWT0JRQQ – GET http://api.usergrid.com/{org}/{app}/{collection}? ql=select * where location within {d} of {x, y} 17 ©2015 Apigee. All Rights Reserved. ( )
  • 18. Architecture: Multi-Region Indexing & Consistency SQS SQS SNS 6) INDEX 6) INDEX Region B Region A C* Replication 2)WRITE 5)READ 5)READ
  • 20. Bottlenecks 21 ©2015 Apigee. All Rights Reserved. Tomcat 20% CPU !?? WHY ??! Cassandra 10% CPU
  • 21. Iterative Process 22 ©2015 Apigee. All Rights Reserved. 10,266/s 9,700/s 7,233/s 3,750
  • 22. Hurdles •  Gatling –  Can’t get 10k/s with one node •  Cassandra –  CPU •  Compression? •  C3.2xlarge -> c3.4xlarge •  Row caching? •  Tomcat –  HTTP Connector •  acceptCount •  maxConnections •  maxThreads •  Non-blocking IO? •  Usergrid –  # of reads to Cassandra 23 ©2015 Apigee. All Rights Reserved.
  • 23. Scaling Usergrid to 10,000 Req/s w/ Gatling •  10k test run: –  35 c3.xlarge Tomcat Nodes –  9 c3.4xlarge C* nodes –  6 m3.large ES nodes •  Closing test ~7,800/s: –  15 c3.xlarge Tomcat Nodes –  9 c3.4xlarge C* nodes –  6 m3.large ES nodes 24
  • 25. Learn from our mistakes 26
  • 26. Risks of Dynamic Mapping 27 ©2015 Apigee. All Rights Reserved. D D D D M
  • 27. Risks of Dynamic Mapping 28 ©2015 Apigee. All Rights Reserved. DD D DD DD D DD D D DD DD DD DD Inbound message requires a mapping update Mapping updated & broadcast to the cluster M
  • 28. Risks of Dynamic Mapping 29 ©2015 Apigee. All Rights Reserved. M DD D DD DD D DD D D DD DD DD DD At scale (full loaded) only one mapping update can processed at a time
  • 29. Risks of Dynamic Mapping 30 ©2015 Apigee. All Rights Reserved. DD D DD DD D DD D D DD DD DD DD M
  • 30. Risks of Dynamic Mapping 31 ©2015 Apigee. All Rights Reserved. M DD D DD DD D DD D D DD DD DD DD
  • 31. 30 ES Data Nodes X 100MB mapping file = 3,000MB For each schema/ mapping update 3GB data transfer X 5M entities with different schemas = a LOT of data transfer and a lot of latency Risks of Dynamic Mapping 32 ©2015 Apigee. All Rights Reserved. DD D DD DD D DD D D DD DD DD DD M
  • 33. {
 "hello": {
 "world":{
 "message": "Hello!"
 },
 "items": [
 {
 "name": "apples",
 "weight": 100
 } 
 ]
 }
 } {
 "uuid": "48e262d6-b922-11e4-8a11",
 "ud_entity_id": "ad2b33c2e",
 "size": 100,
 "ug_app": "1a67aed7-bbb3-11e4-8a11",
 "fields": [
 {
 ”name": "hello.world.message",
 ”string": "Hello!"
 },
 {
 ”name": "items[0].name",
 ”string": "apples"
 },
 {
 ”name": "items[0].weight",
 "integer": 100
 } 
 ]
 }
 Flattened Documents 34 ©2015 Apigee. All Rights Reserved. Indexed as
  • 34. Data Node A Data Node B Data Node C Index Allocation •  Multiple Indexes spread across the cluster •  Indexes have shards •  Read/Write aliases point to physical indexes •  Aliases assigned based on hashing of the App UUID 35 ©2015 Apigee. All Rights Reserved. Index_1 1 1 2 3 2 3 app_1_read_alias app_1_write_alias
  • 35. Data Node A Data Node B Data Node C Tenant Management 36 ©2015 Apigee. All Rights Reserved. Index_1 1 1 2 3 2 3 app_1_read_alias app_1_write_alias app_2_read_alias app_2_write_alias
  • 36. Data Node A Data Node B Data Node C Tenant Management •  Assign Write alias to new Index •  Add new index to read alias •  Stream data from old index •  Delete data from old index 37 ©2015 Apigee. All Rights Reserved. Index_1 1 1 2 3 2 3 Index_2 1 1 2 3 2 3 app_2_read_alias app_2_write_alias stream2es app_1_read_alias app_1_write_alias
  • 37. Data Node D Data Node A Data Node B Data Node C Tenant Management •  Indexes targeted to separate machines 38 ©2015 Apigee. All Rights Reserved. Index_1 1 1 2 3 2 3 Index_2 1 1 2 3 2 3 app_1_read_alias app_1_write_alias app_2_read_alias app_2_write_alias
  • 38. Data Node A Data Node B Data Node C Data Node A Data Node B Data Node C Multiple Scaling Vectors 39 ©2015 Apigee. All Rights Reserved. Index_1 1 1 2 3 2 3 Index_2 1 1 2 3 2 3 Index_3 1 1 2 3 2 3 Index_4 1 1 2 3 2 3 Index_5 1 1 2 3 2 3
  • 39. Working with Graph & NoSQL Data 40
  • 40. Data De-normalization per interaction 41 ERP Product CatalogsCRM Data Lake Data Warehouse
  • 41. Graph Data Persistence: Entities & Connections •  Entities –  Objects / Documents representing an Entity •  Collections –  Logical grouping of Entities •  Connections / Entity Relationships –  Graph Data Structure –  /{collection}/{entityA}/{verb}/{collection}/ {entityB} –  /Users/me/likes/Products/iPhone6 –  /Recipes/Bread/includes/Ingredients/Flour 42 User A Product A User B User C Likes>> <<Liking
  • 43. What’s Next for Usergrid •  Grow the community! •  Blueprints Driver Release! •  Service abstraction •  Indexing closer to real-time •  Larger Clusters •  Distributed Work System •  Encryption & Security 44