SlideShare a Scribd company logo
Copyright 2016 Expero, Inc. All Rights Reserved 1
In today's development ecosystem building a service oriented architecture based on a micro services is
common practice. With the rise of Big Data and Internet of Things applications making these services highly
performant services is no longer an option. In order to accomplish the scalability and performance
requirements that customers expect we are required to start thinking differently about how we architect and
build these applications in order to meet those demands.
This session will demonstrate a method for creating a highly performant service based application using
Google’s GRPC and Apache Cassandra in .NET. We will show how you can combine gRPC to minimize
communication overhead while leveraging Cassandra to optimize storage of time series data. We will explore
these concepts by creating an Internet of Things (IoT) application to demonstrate how you can effectively
meet the performance and scalability challenges posed by these new breeds of applications.
Abstract
Copyright 2016 Expero, Inc. All Rights Reserved
Performance is not an
Option
Building High performance Web Services
with gRPC and Cassandra
June 9th, 2016
#build4prfrmnc
Copyright 2016 Expero, Inc. All Rights Reserved 3
● What is gRPC
● What is Cassandra
● How to build a simple gRPC Microservice
● How to persist time series data in Cassandra
● Why you might want to use gRPC/Cassandra instead of a
more traditional REST/RDBMS for a Time-Series IoT
application
What I hope you take away
Copyright 2016 Expero, Inc. All Rights Reserved 4
Dave Bechberger
Senior Architect
dave@experoinc.com
@bechbd
https://www.linkedin.com/in/davebechberger
About me
Copyright 2016 Expero, Inc. All Rights Reserved 5
Expero - Bringing challenging product ideas to reality
Architecture &
Development
Product Strategy
User Experience
Domain
Expert
Copyright 2016 Expero, Inc. All Rights Reserved 6
Expero - Select Clients
6
Austin(HQ) • Houston • New York City • Founded 2003
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
What is gRPC?
7
Copyright 2016 Expero, Inc. All Rights Reserved
● gRPC is a general purpose RPC
framework
● Built on standards
● Free and Open Source
● Built for distributed systems
8
What is gRPC?
Copyright 2016 Expero, Inc. All Rights Reserved
● Allows client to call methods on
the server as if they were local
● Built for low latency highly
scalable microservices
● Payload agnostic
● Bi-Directional Streaming
● Pluggable and Extensible
9
gRPC Architecture
Copyright 2016 Expero, Inc. All Rights Reserved 10
Simple Model and Service Definition
Copyright 2016 Expero, Inc. All Rights Reserved 11
Optimized Speed and Performance
Copyright 2016 Expero, Inc. All Rights Reserved 12
Code Generation
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
What is Cassandra?
13
Copyright 2016 Expero, Inc. All Rights Reserved
What is Cassandra?
● Distributed Datastore
● Open Source Apache Project
● No Single Point of Failure
● Scalable
14
Copyright 2016 Expero, Inc. All Rights Reserved
CAP Theorem - Pick 2
● Consistency - all nodes see the same data
at the same time
● Availability - every requests receives a
response
● Partition Tolerant - the system continues
to operate even during network failures
15
Copyright 2016 Expero, Inc. All Rights Reserved
ACID vs. BASE
RDBMS World
● Atomic - transactions are “all or nothing”
● Consistency - On completion all data is
the same
● Isolated - transactions do not interfere
with one another
● Durable - results of a transaction are
permanent
16
NoSQL World
● Base Availability - The datastore works
most of the time
● Soft State - Stores are not write
consistent, data can differ between
replicas
● Eventually Consistent - Stores become
consistent over time
Copyright 2016 Expero, Inc. All Rights Reserved
Cassandra Architecture
17
Copyright 2016 Expero, Inc. All Rights Reserved
Hash Ring Architecture
18
● All nodes own a portion of the token
ring
● All nodes know which token ranges
belong to which nodes
● Partitioner generates a token from the
Partition Key
● Tokens determine where data is
located on the ring
Copyright 2016 Expero, Inc. All Rights Reserved
How Tokens Work
19
Partitioner
Token:12
Client Driver
PK: Expero
Data Written
Copyright 2016 Expero, Inc. All Rights Reserved
Data Replication
● Data replication is automatic
● Number of replicas is called the Replication Factor or RF
● Data is replicated between Data Centers
● Hinted Handoff
Copyright 2016 Expero, Inc. All Rights Reserved
Data Replication in Action
Client
Write A
Data Written
Replica Written
Replica Written
Coordinator
Driver
Partitioner
Token:12
PK: Expero
Copyright 2016 Expero, Inc. All Rights Reserved
What does it mean to be Eventually Consistent?
22
● Data will “eventually” match on all replicas, usually in terms of
milliseconds
● Consistency Level or CL (11 for writes, 10 for reads)
● Tuning consistency affects performance and availability
● CL can be tuned for R/W performance on a per query basis using CQL
Copyright 2016 Expero, Inc. All Rights Reserved
Why use Cassandra over your RDBMS?
● Performance
● Linearly Scalable
● Natively built as a distributed datastore
● Always-On Architecture
23
Copyright 2016 Expero, Inc. All Rights Reserved
What is DataStax vs. Apache Cassandra?
● Certified Cassandra – Delivers highest quality
Cassandra software for confidence and peace of
mind for production environments
● Enterprise Security – Full protection for sensitive
data
● Automatic Management Services – Automates
key maintenance functions to keep the database
running smoothly
● OpsCenter – Advanced management and
monitoring functionality for production applications
● Expert Support – Answers and assistance from the
Cassandra experts for all production needs
24
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
The Problem - Engine Monitoring
25
Copyright 2016 Expero, Inc. All Rights Reserved
● Truck Engine Monitoring
Software
● Currently ~ 1000 trucks taking
readings every 10 seconds
● WebAPI REST on a SQL Server
2014 Database
26
Setup
Copyright 2016 Expero, Inc. All Rights Reserved
● You were recently landed a huge
new client Expero Trucking Inc.
● Sensor readings now 1/second
and add geolocation (lat/long)
data
● Adding 10,000 trucks.
● Minimize costs and zero
downtime
27
The Requirements
Copyright 2016 Expero, Inc. All Rights Reserved
● 100 measurements/second to
22,000 measurements/second
● Data load from ~35 MB/day to
~2.2 GB/day
● Your architecture needs to
change
28
The Problem
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
The Solution - gRPC and Cassandra
29
Code Available Here https://github.com/experoinc/NDC-Oslo-2016/tree/master/NDC.Oslo
Copyright 2016 Expero, Inc. All Rights Reserved
● Change SQL Server Database to a Cassandra Cluster
● Replace REST based services with gRPC services
30
Proposed Solution
Copyright 2016 Expero, Inc. All Rights Reserved 31
Defining a Model and Service
Copyright 2016 Expero, Inc. All Rights Reserved 32
Generating Client/Server Stubs
Model Definition Service Definition
Copyright 2016 Expero, Inc. All Rights Reserved 33
Creating Cassandra KeySpace and Table
Copyright 2016 Expero, Inc. All Rights Reserved 34
Connecting to Apache Cassandra using DataStax Driver
DataStax Open Source C# Driver - https://github.com/datastax/csharp-driver
Copyright 2016 Expero, Inc. All Rights Reserved 35
Writing Data to Cassandra
Copyright 2016 Expero, Inc. All Rights Reserved 36
Reading Data From Cassandra
Copyright 2016 Expero, Inc. All Rights Reserved 37
Time to See Some Running Code
Average Ping Time
Running in Oregon
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
Tradeoffs of gRPC and Cassandra
38
Copyright 2016 Expero, Inc. All Rights Reserved 39
● Not for Browsers
● Chunk “Big” (>1MB ) Data
● No Nullable Data Types
● Not Production Yet
Tradeoffs of using gRPC
Copyright 2016 Expero, Inc. All Rights Reserved 40
● No joins between tables
● No Ad-Hoc queries
● Minimal Aggregations
● Complexity
● Cassandra is Not Relational
Tradeoffs of using Cassandra
Copyright 2016 Expero, Inc. All Rights Reserved 41
● gRPC
○ http://www.grpc.io/
○ https://developers.google.com/protocol-buffers/docs/proto3
● Cassandra
○ http://cassandra.apache.org/
○ http://www.planetcassandra.org/
○ https://academy.datastax.com/
○ http://www.datastax.com/
Learning More
Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved
Thank you, any Questions?
42

More Related Content

What's hot

gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
Varun Talwar
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
AboutYouGmbH
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
Luís Barbosa
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
Apigee | Google Cloud
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
C4Media
 
gRPC: Beyond REST
gRPC: Beyond RESTgRPC: Beyond REST
gRPC: Beyond REST
Domingo Suarez Torres
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
Jonathan Gomez
 
gRPC & Kubernetes
gRPC & KubernetesgRPC & Kubernetes
gRPC & Kubernetes
Kausal
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
Luram Archanjo
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
Prakash Divy
 
Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.
Alex Borysov
 
GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016
Alex Van Boxel
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Codemotion
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
Almog Baku
 
gRPC
gRPCgRPC
A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13
Thibault Charbonnier
 
gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019
James Newton-King
 
Apache Deep Learning 201 - Philly Open Source
Apache Deep Learning 201 - Philly Open SourceApache Deep Learning 201 - Philly Open Source
Apache Deep Learning 201 - Philly Open Source
Timothy Spann
 
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
StreamNative
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
Sougata Pal
 

What's hot (20)

gRPC Overview
gRPC OverviewgRPC Overview
gRPC Overview
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 
gRPC - RPC rebirth?
gRPC - RPC rebirth?gRPC - RPC rebirth?
gRPC - RPC rebirth?
 
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at SquaregRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
 
gRPC: Beyond REST
gRPC: Beyond RESTgRPC: Beyond REST
gRPC: Beyond REST
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
gRPC & Kubernetes
gRPC & KubernetesgRPC & Kubernetes
gRPC & Kubernetes
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
 
Introduction to gRPC
Introduction to gRPCIntroduction to gRPC
Introduction to gRPC
 
Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.Enabling Googley microservices with HTTP/2 and gRPC.
Enabling Googley microservices with HTTP/2 and gRPC.
 
GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016GRPC 101 - DevFest Belgium 2016
GRPC 101 - DevFest Belgium 2016
 
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
Introduction to gRPC: A general RPC framework that puts mobile and HTTP/2 fir...
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
gRPC
gRPCgRPC
gRPC
 
A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13A Kong retrospective: from 0.10 to 0.13
A Kong retrospective: from 0.10 to 0.13
 
gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019gRPC on .NET Core - NDC Sydney 2019
gRPC on .NET Core - NDC Sydney 2019
 
Apache Deep Learning 201 - Philly Open Source
Apache Deep Learning 201 - Philly Open SourceApache Deep Learning 201 - Philly Open Source
Apache Deep Learning 201 - Philly Open Source
 
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
MoP(MQTT on Pulsar) - a Powerful Tool for Apache Pulsar in IoT - Pulsar Summi...
 
gRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer ProtocolgRPC - Fastest Data Transfer Protocol
gRPC - Fastest Data Transfer Protocol
 

Similar to Performance is not an Option - gRPC and Cassandra

EDB Postgres with Containers
EDB Postgres with ContainersEDB Postgres with Containers
EDB Postgres with Containers
EDB
 
OpenTSDB for monitoring @ Criteo
OpenTSDB for monitoring @ CriteoOpenTSDB for monitoring @ Criteo
OpenTSDB for monitoring @ Criteo
Nathaniel Braun
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
Michal Němec
 
CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016
Mathieu Dumoulin
 
C5 journey to_the_cloud_with_oracle_sparc
C5 journey to_the_cloud_with_oracle_sparcC5 journey to_the_cloud_with_oracle_sparc
C5 journey to_the_cloud_with_oracle_sparc
Dr. Wilfred Lin (Ph.D.)
 
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
DataStax
 
Leveraging open source for large scale analytics
Leveraging open source for large scale analyticsLeveraging open source for large scale analytics
Leveraging open source for large scale analytics
South West Data Meetup
 
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
 Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F... Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
Databricks
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)
Jaroslav Jacjuk
 
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Docker, Inc.
 
Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1
Tugdual Grall
 
Oracle Management Cloud - HybridCloud Café - May 2016
Oracle Management Cloud - HybridCloud Café - May 2016Oracle Management Cloud - HybridCloud Café - May 2016
Oracle Management Cloud - HybridCloud Café - May 2016
Bastien Leblanc
 
Oracle Cloud Café hybrid Cloud 19 mai 2016
Oracle Cloud Café hybrid Cloud 19 mai 2016Oracle Cloud Café hybrid Cloud 19 mai 2016
Oracle Cloud Café hybrid Cloud 19 mai 2016
Sorathaya Sirimanotham
 
Novinky v Oracle Database 18c
Novinky v Oracle Database 18cNovinky v Oracle Database 18c
Novinky v Oracle Database 18c
MarketingArrowECS_CZ
 
Moving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudMoving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle Cloud
Alex Zaballa
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance Observations
Adam Roberts
 
Elastic data services on Apache Mesos via Mesosphere’s DCOS
Elastic data services on Apache Mesos via Mesosphere’s DCOSElastic data services on Apache Mesos via Mesosphere’s DCOS
Elastic data services on Apache Mesos via Mesosphere’s DCOS
harrythewiz
 
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Cédrick Lunven
 
The Decoupled CMS in Financial Services
The Decoupled CMS in Financial ServicesThe Decoupled CMS in Financial Services
The Decoupled CMS in Financial Services
Open Source Strategy Forum
 
MySQL day Dublin - OCI & Application Development
MySQL day Dublin - OCI & Application DevelopmentMySQL day Dublin - OCI & Application Development
MySQL day Dublin - OCI & Application Development
Henry J. Kröger
 

Similar to Performance is not an Option - gRPC and Cassandra (20)

EDB Postgres with Containers
EDB Postgres with ContainersEDB Postgres with Containers
EDB Postgres with Containers
 
OpenTSDB for monitoring @ Criteo
OpenTSDB for monitoring @ CriteoOpenTSDB for monitoring @ Criteo
OpenTSDB for monitoring @ Criteo
 
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
BlackStor - World's fastest & most reliable Cloud Native Software Defined Sto...
 
CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016CEP - simplified streaming architecture - Strata Singapore 2016
CEP - simplified streaming architecture - Strata Singapore 2016
 
C5 journey to_the_cloud_with_oracle_sparc
C5 journey to_the_cloud_with_oracle_sparcC5 journey to_the_cloud_with_oracle_sparc
C5 journey to_the_cloud_with_oracle_sparc
 
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
Webinar: Dyn + DataStax - helping companies deliver exceptional end-user expe...
 
Leveraging open source for large scale analytics
Leveraging open source for large scale analyticsLeveraging open source for large scale analytics
Leveraging open source for large scale analytics
 
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
 Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F... Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
 
DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)DRBD + OpenStack (Openstack Live Prague 2016)
DRBD + OpenStack (Openstack Live Prague 2016)
 
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
 
Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1Fast Cars, Big Data - How Streaming Can Help Formula 1
Fast Cars, Big Data - How Streaming Can Help Formula 1
 
Oracle Management Cloud - HybridCloud Café - May 2016
Oracle Management Cloud - HybridCloud Café - May 2016Oracle Management Cloud - HybridCloud Café - May 2016
Oracle Management Cloud - HybridCloud Café - May 2016
 
Oracle Cloud Café hybrid Cloud 19 mai 2016
Oracle Cloud Café hybrid Cloud 19 mai 2016Oracle Cloud Café hybrid Cloud 19 mai 2016
Oracle Cloud Café hybrid Cloud 19 mai 2016
 
Novinky v Oracle Database 18c
Novinky v Oracle Database 18cNovinky v Oracle Database 18c
Novinky v Oracle Database 18c
 
Moving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudMoving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle Cloud
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance Observations
 
Elastic data services on Apache Mesos via Mesosphere’s DCOS
Elastic data services on Apache Mesos via Mesosphere’s DCOSElastic data services on Apache Mesos via Mesosphere’s DCOS
Elastic data services on Apache Mesos via Mesosphere’s DCOS
 
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
Top 10 present and future innovations in the NoSQL Cassandra ecosystem (2022)
 
The Decoupled CMS in Financial Services
The Decoupled CMS in Financial ServicesThe Decoupled CMS in Financial Services
The Decoupled CMS in Financial Services
 
MySQL day Dublin - OCI & Application Development
MySQL day Dublin - OCI & Application DevelopmentMySQL day Dublin - OCI & Application Development
MySQL day Dublin - OCI & Application Development
 

Recently uploaded

SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 

Recently uploaded (20)

SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 

Performance is not an Option - gRPC and Cassandra

  • 1. Copyright 2016 Expero, Inc. All Rights Reserved 1 In today's development ecosystem building a service oriented architecture based on a micro services is common practice. With the rise of Big Data and Internet of Things applications making these services highly performant services is no longer an option. In order to accomplish the scalability and performance requirements that customers expect we are required to start thinking differently about how we architect and build these applications in order to meet those demands. This session will demonstrate a method for creating a highly performant service based application using Google’s GRPC and Apache Cassandra in .NET. We will show how you can combine gRPC to minimize communication overhead while leveraging Cassandra to optimize storage of time series data. We will explore these concepts by creating an Internet of Things (IoT) application to demonstrate how you can effectively meet the performance and scalability challenges posed by these new breeds of applications. Abstract
  • 2. Copyright 2016 Expero, Inc. All Rights Reserved Performance is not an Option Building High performance Web Services with gRPC and Cassandra June 9th, 2016 #build4prfrmnc
  • 3. Copyright 2016 Expero, Inc. All Rights Reserved 3 ● What is gRPC ● What is Cassandra ● How to build a simple gRPC Microservice ● How to persist time series data in Cassandra ● Why you might want to use gRPC/Cassandra instead of a more traditional REST/RDBMS for a Time-Series IoT application What I hope you take away
  • 4. Copyright 2016 Expero, Inc. All Rights Reserved 4 Dave Bechberger Senior Architect dave@experoinc.com @bechbd https://www.linkedin.com/in/davebechberger About me
  • 5. Copyright 2016 Expero, Inc. All Rights Reserved 5 Expero - Bringing challenging product ideas to reality Architecture & Development Product Strategy User Experience Domain Expert
  • 6. Copyright 2016 Expero, Inc. All Rights Reserved 6 Expero - Select Clients 6 Austin(HQ) • Houston • New York City • Founded 2003
  • 7. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved What is gRPC? 7
  • 8. Copyright 2016 Expero, Inc. All Rights Reserved ● gRPC is a general purpose RPC framework ● Built on standards ● Free and Open Source ● Built for distributed systems 8 What is gRPC?
  • 9. Copyright 2016 Expero, Inc. All Rights Reserved ● Allows client to call methods on the server as if they were local ● Built for low latency highly scalable microservices ● Payload agnostic ● Bi-Directional Streaming ● Pluggable and Extensible 9 gRPC Architecture
  • 10. Copyright 2016 Expero, Inc. All Rights Reserved 10 Simple Model and Service Definition
  • 11. Copyright 2016 Expero, Inc. All Rights Reserved 11 Optimized Speed and Performance
  • 12. Copyright 2016 Expero, Inc. All Rights Reserved 12 Code Generation
  • 13. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved What is Cassandra? 13
  • 14. Copyright 2016 Expero, Inc. All Rights Reserved What is Cassandra? ● Distributed Datastore ● Open Source Apache Project ● No Single Point of Failure ● Scalable 14
  • 15. Copyright 2016 Expero, Inc. All Rights Reserved CAP Theorem - Pick 2 ● Consistency - all nodes see the same data at the same time ● Availability - every requests receives a response ● Partition Tolerant - the system continues to operate even during network failures 15
  • 16. Copyright 2016 Expero, Inc. All Rights Reserved ACID vs. BASE RDBMS World ● Atomic - transactions are “all or nothing” ● Consistency - On completion all data is the same ● Isolated - transactions do not interfere with one another ● Durable - results of a transaction are permanent 16 NoSQL World ● Base Availability - The datastore works most of the time ● Soft State - Stores are not write consistent, data can differ between replicas ● Eventually Consistent - Stores become consistent over time
  • 17. Copyright 2016 Expero, Inc. All Rights Reserved Cassandra Architecture 17
  • 18. Copyright 2016 Expero, Inc. All Rights Reserved Hash Ring Architecture 18 ● All nodes own a portion of the token ring ● All nodes know which token ranges belong to which nodes ● Partitioner generates a token from the Partition Key ● Tokens determine where data is located on the ring
  • 19. Copyright 2016 Expero, Inc. All Rights Reserved How Tokens Work 19 Partitioner Token:12 Client Driver PK: Expero Data Written
  • 20. Copyright 2016 Expero, Inc. All Rights Reserved Data Replication ● Data replication is automatic ● Number of replicas is called the Replication Factor or RF ● Data is replicated between Data Centers ● Hinted Handoff
  • 21. Copyright 2016 Expero, Inc. All Rights Reserved Data Replication in Action Client Write A Data Written Replica Written Replica Written Coordinator Driver Partitioner Token:12 PK: Expero
  • 22. Copyright 2016 Expero, Inc. All Rights Reserved What does it mean to be Eventually Consistent? 22 ● Data will “eventually” match on all replicas, usually in terms of milliseconds ● Consistency Level or CL (11 for writes, 10 for reads) ● Tuning consistency affects performance and availability ● CL can be tuned for R/W performance on a per query basis using CQL
  • 23. Copyright 2016 Expero, Inc. All Rights Reserved Why use Cassandra over your RDBMS? ● Performance ● Linearly Scalable ● Natively built as a distributed datastore ● Always-On Architecture 23
  • 24. Copyright 2016 Expero, Inc. All Rights Reserved What is DataStax vs. Apache Cassandra? ● Certified Cassandra – Delivers highest quality Cassandra software for confidence and peace of mind for production environments ● Enterprise Security – Full protection for sensitive data ● Automatic Management Services – Automates key maintenance functions to keep the database running smoothly ● OpsCenter – Advanced management and monitoring functionality for production applications ● Expert Support – Answers and assistance from the Cassandra experts for all production needs 24
  • 25. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved The Problem - Engine Monitoring 25
  • 26. Copyright 2016 Expero, Inc. All Rights Reserved ● Truck Engine Monitoring Software ● Currently ~ 1000 trucks taking readings every 10 seconds ● WebAPI REST on a SQL Server 2014 Database 26 Setup
  • 27. Copyright 2016 Expero, Inc. All Rights Reserved ● You were recently landed a huge new client Expero Trucking Inc. ● Sensor readings now 1/second and add geolocation (lat/long) data ● Adding 10,000 trucks. ● Minimize costs and zero downtime 27 The Requirements
  • 28. Copyright 2016 Expero, Inc. All Rights Reserved ● 100 measurements/second to 22,000 measurements/second ● Data load from ~35 MB/day to ~2.2 GB/day ● Your architecture needs to change 28 The Problem
  • 29. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved The Solution - gRPC and Cassandra 29 Code Available Here https://github.com/experoinc/NDC-Oslo-2016/tree/master/NDC.Oslo
  • 30. Copyright 2016 Expero, Inc. All Rights Reserved ● Change SQL Server Database to a Cassandra Cluster ● Replace REST based services with gRPC services 30 Proposed Solution
  • 31. Copyright 2016 Expero, Inc. All Rights Reserved 31 Defining a Model and Service
  • 32. Copyright 2016 Expero, Inc. All Rights Reserved 32 Generating Client/Server Stubs Model Definition Service Definition
  • 33. Copyright 2016 Expero, Inc. All Rights Reserved 33 Creating Cassandra KeySpace and Table
  • 34. Copyright 2016 Expero, Inc. All Rights Reserved 34 Connecting to Apache Cassandra using DataStax Driver DataStax Open Source C# Driver - https://github.com/datastax/csharp-driver
  • 35. Copyright 2016 Expero, Inc. All Rights Reserved 35 Writing Data to Cassandra
  • 36. Copyright 2016 Expero, Inc. All Rights Reserved 36 Reading Data From Cassandra
  • 37. Copyright 2016 Expero, Inc. All Rights Reserved 37 Time to See Some Running Code Average Ping Time Running in Oregon
  • 38. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved Tradeoffs of gRPC and Cassandra 38
  • 39. Copyright 2016 Expero, Inc. All Rights Reserved 39 ● Not for Browsers ● Chunk “Big” (>1MB ) Data ● No Nullable Data Types ● Not Production Yet Tradeoffs of using gRPC
  • 40. Copyright 2016 Expero, Inc. All Rights Reserved 40 ● No joins between tables ● No Ad-Hoc queries ● Minimal Aggregations ● Complexity ● Cassandra is Not Relational Tradeoffs of using Cassandra
  • 41. Copyright 2016 Expero, Inc. All Rights Reserved 41 ● gRPC ○ http://www.grpc.io/ ○ https://developers.google.com/protocol-buffers/docs/proto3 ● Cassandra ○ http://cassandra.apache.org/ ○ http://www.planetcassandra.org/ ○ https://academy.datastax.com/ ○ http://www.datastax.com/ Learning More
  • 42. Copyright 2016 Expero, Inc. All Rights ReservedCopyright 2016 Expero, Inc. All Rights Reserved Thank you, any Questions? 42