Slide 1

Slide 1 text

YugaByte DB - A Planet-Scale DB for Low Latency Transactional Apps Amey Banarse Advisory Platform Architect, Pivotal @ameybanarse Karthik Ranganathan Founder & CTO, Yugabyte Inc @karthikr

Slide 2

Slide 2 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Introductions 2  Amey Banarse Advisory Platform Architect, Pivotal University of Pennsylvania @ameybanarse Karthik Ranganathan Co-Founder and CTO, YugaByte DB Nutanix ♦ Facebook ♦ Microsoft University of Texas, Austin @karthikr

Slide 3

Slide 3 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What is YugaByte DB? 3  NoSQL + SQL Cloud Native

Slide 4

Slide 4 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 4  A transactional, high-performance database for building planet-scale cloud services.

Slide 5

Slide 5 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 5 YugaByte Story starts with...

Slide 6

Slide 6 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Facebook in 2007 6 

Slide 7

Slide 7 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Facebook in 2008-2009 7  How to scale to a billion users? Also: how to survive the week?

Slide 8

Slide 8 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ What happens at 1 Billion users? 8  Dozens of Petabytes Billions of IOPS Scale out frequently Rolling upgrades – zero downtime!

Slide 9

Slide 9 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Transformation of Facebook 9  How to achieve scale Few datacenters traditional servers Monolithic applications and services Geo-distributed DC’s Containers for applications Microservices based design All about developer agility

Slide 10

Slide 10 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ The database tier was difficult to transform 1 0  Application Tier (Stateless Microservices) Custom Data Platform Transactional, Performant, Global No general platform for the enterprise

Slide 11

Slide 11 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 11 So what...?

Slide 12

Slide 12 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Your Challenges 1 2  Your approach to solving these? • Millions of IOPS (not billions) • 1000s of apps (not 10s of apps) • Want standard open APIs (not custom)

Slide 13

Slide 13 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ How Pivotal Transforms Customers Changes that are already underway 2 corporate datacenters traditional servers monolithic apps on proprietary app servers Multi-region and Multi-cloud Multiple VM’s & Containers Microservices on OSS Frameworks

Slide 14

Slide 14 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Transformation for Data Tier ? legacy databases Open Source, Cloud-native Databases

Slide 15

Slide 15 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Use Existing DBs for Transformation? Not Portable Not Portable Open Source Not Portable Open Source Open Source High Performance, Transactional, Planet-Scale High Performance, Transactional, Planet-Scale High Performance, Transactional, Planet-Scale High Performance, Transactional, Planet-Scale

Slide 16

Slide 16 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Transformation for Data Tier Legacy Databases Open Source, Cloud-native Databases +

Slide 17

Slide 17 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ YugaByte DB capabilities TRANSACTIONAL PLANET-SCALE HIGH PERFORMANCE Distributed ACID Transactions Transactional Key-to-Document Storage Engine Low Latency, Tunable Reads High Throughput OPEN SOURCE Apache 2.0 Popular APIs Extended PostgreSQL, Apache Cassandra and Redis Auto Sharding & Rebalancing Global Data Distribution CLOUD-NATIVE Natively runs in Containers, self service Self-Healing, Fault-Tolerant

Slide 18

Slide 18 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Core DB Features SQL Strong consistency Secondary indexes ACID transactions Expressive query language NoSQL Tunable read latency Write optimized for large data sets Data expiry with TTL Scale out and fault tolerant

Slide 19

Slide 19 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Best of Cloud-Native Meets Open Source ACID Transactions Globally Consistent SQL API only Not Transactional Multi-Model High Performance Not Globally Consistent Lower Performance

Slide 20

Slide 20 text

20 YugaByte Confidential © 2018 All rights reserved. YugaByte DB Architecture • YB-Master and YB-TServer services • Raft consensus • DocDB - optimized RocksDB storage • Global Transactions • Pluggable Query Layer - CQL, Redis

Slide 21

Slide 21 text

21 YugaByte Confidential © 2018 All rights reserved. Ecosystem Integration tablet 1’ tablet2-leade r tablet1-leade r … … tablet2-followe r tablet3-followe r tablet1-followe r tablet1-followe r • Spring Data • Kafka • Spark • Presto • Janus Graph DB tablet 1’ tablet 1’ Raft Replication DocDB Storage node1 node2 node3 Global Transaction Manager Automated Sharding & Load Balancing Cassandra REDIS BET A

Slide 22

Slide 22 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 2 2 On Demand YugaByte DB on PKS Demo http://bit.ly/yugabyte-on-pks

Slide 23

Slide 23 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Real World Retail Marketplace ● Browse and Buy millions of products ● Determine Ratings and Review effectiveness ● Order and checkout products ● ….. Many more. Last but not the least, a highly performant, rich and interactive UX 2 3

Slide 24

Slide 24 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dataset used for the demo ● 20 million+ Products ● 100 million reviews + ratings ● …. and assume newer Reviews are written to YugaByte DB in real-time 2 4

Slide 25

Slide 25 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 2 5 Let’s take a look at the UI and work our way back to the underlying architecture http://kronos-react-ui.apps.sebastopol.cf-app.com/

Slide 26

Slide 26 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 2 6 Http Requests Retail App

Slide 27

Slide 27 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 2 7 Http Requests Spring Boot Microservices Web App

Slide 28

Slide 28 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 2 8 Http Requests Spring Boot Microservices Web App YugaByte DB on PKS Transactions, High Consistency, Secondary Indexes

Slide 29

Slide 29 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 2 9 AWS S3 Batch Load Http Requests Spring Boot Microservices Web App Spring Cloud Data Flow Transactions, High Consistency, Secondary Indexes YugaByte DB on PKS High Throughput Data Pipelines

Slide 30

Slide 30 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 3 0 AWS S3 Batch Load . Http Requests Spring Boot Microservices Web App Spring Cloud Data Flow Transactions, High Consistency, Secondary Indexes YugaByte DB on PKS Spark on PKS High Throughput Data Pipelines

Slide 31

Slide 31 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Retail Marketplace Architecture 3 1 BOSH AWS S3 Pivotal Container Service Batch Load . Http Requests Spring Boot Microservices Web App Spring Cloud Data Flow Pivotal Application Service Transactions, High Consistency, Secondary Indexes YugaByte DB on PKS Spark on PKS High Throughput Data Pipelines

Slide 32

Slide 32 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 3 2 Dissecting the Retail App

Slide 33

Slide 33 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dissecting the Retail App 3 3 Secondary Indexes for category listings

Slide 34

Slide 34 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Secondary Indexes Distributed Indexes for Efficient Queries 3 4 CREATE TABLE product_rankings ( asin text, category text, sales_rank int, ... PRIMARY KEY (asin, category) ); CREATE INDEX top_products_in_category ON product_rankings (category, sales_rank, asin); Partition by product ID for efficient lookups Secondary index to list top products in a category

Slide 35

Slide 35 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Secondary Indexes Distributed Indexes for Efficient Queries 3 5 SELECT * FROM product_rankings WHERE asin = '0684841363'; SELECT * FROM product_rankings WHERE category = 'Books' LIMIT 10 OFFSET 20; Query by ID for product summary data Query by index to list top products in a category by sales rank (best sellers)

Slide 36

Slide 36 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dissecting the Retail App 3 6 Global ACID Transactions using Cassandra API

Slide 37

Slide 37 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Global Transactions Multi-Row/Multi-Shard Operations At Scale 3 7 CREATE TABLE orders ( order_id text PRIMARY KEY, user_id uuid, order_details jsonb, ... ) WITH transactions = {'enabled': 'true'}; Update inventory and orders tables atomically. Simple to enable global transactions on any table Use JSON type for flexible schema objects.

Slide 38

Slide 38 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Global Transactions Multi-Row/Multi-Shard Operations At Scale 3 8 BEGIN TRANSACTION UPDATE product_inventory SET quantity = quantity - 2 WHERE asin = '0684841363'; INSERT INTO orders (order_id, user_id, order_details, … ) VALUES ('', '', '{id: "0684841363", quantity: 2, … }', … ); END TRANSACTION; Decrease inventory count for products fulfilled. Query and index by JSON attributes if needed! Add to orders table for products purchased.

Slide 39

Slide 39 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dissecting the Retail App 3 9 Dynamic sets modeled as Redis SORTED SETs Show me the top 2 book with the most reviews

Slide 40

Slide 40 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Dissecting the Retail App 4 0 Pagination Support

Slide 41

Slide 41 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ UI Pagination and Offsets 41 SELECT * FROM cronos.products WHERE category=’Music’ LIMIT 10 OFFSET 20; Example command for displaying page 3

Slide 42

Slide 42 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Native JSON Modeling product attributes & order history 4 2

Slide 43

Slide 43 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Auto Data Expiry with TTL Implement Discounts and Sales Offers on products 4 3 Query the key right away Query the key after 10 seconds Write a key with a 10 second expiry

Slide 44

Slide 44 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spark Integration ● Analytics and Aggregate Queries ● ML workloads - Recommendations and Rankings ● Uses pySpark, OSS Spark-Cassandra connectors 4 4 Source Tables Derived Tables Enrichment / pre-aggregation Batch Aggregates Pivotal Container Service

Slide 45

Slide 45 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Cloud Data Flow ● Real-time + Batch Data Ingestion into YugaByteDB ● High throughput ingestion pipeline ● Scalable Data Microservices 4 5 Scalable Data Pipelines Data Processor S3 Source Cassandra Sink Read From Write To AWS S3

Slide 46

Slide 46 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ YugaWare Console Day 2 Automation and Operations ● Integrated Prometheus for monitoring ● Alerts & Health Checks ● Backup/Restore from Object Stores(ex.S3) & NFS ● Rolling Upgrades 4 6

Slide 47

Slide 47 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 4 7 Real World Use-Cases

Slide 48

Slide 48 text

48 YugaByte Confidential © 2018 All rights reserved. 1. MySQL master-slave replication 2. Cassandra cross-DC queue for cache updates 3. Per-DC Couchbase for caching Current State Use Case #1 – Global User Identity Login, change password, view profile

Slide 49

Slide 49 text

49 YugaByte Confidential © 2018 All rights reserved. With YugaByte DB Use Case #1 – Global User Identity Login, change password, view profile Unified platform Zero data loss even on region failures Add new regions with ease 1-click Deployment of Primary Cluster and Read Replicas Read Replicas

Slide 50

Slide 50 text

50 YugaByte Confidential © 2018 All rights reserved. Redis cluster for low latency reads Fragile (manually sharded & load balanced) Expensive (entire dataset in memory) On-premises only, need hybrid/public cloud scaling and distribution DB Current State Use Case #2 - Financial Data Service

Slide 51

Slide 51 text

51 YugaByte Confidential © 2018 All rights reserved. With YugaByte DB Use Case #2 - Financial Data Service Higher release velocity Cost-efficient storage Faster cloud migration 1-click Deploy of Redis as a Distributed Database

Slide 52

Slide 52 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Use Case 3: Forensic Tools for Blockchain Industry 5 2  “YugaByte DB helped CipherTrace meet the high bar its customers set for availability, scalability, and data consistency while we simultaneously introduced new features. Because YugaByte DB is Cassandra wire compatible, it was a simple process for us to quickly migrate our application from DataStax Enterprise and start delivering these benefits to our customers.” — Steve Ryan, Chief Operating Officer, CipherTrace

Slide 53

Slide 53 text

53 YugaByte Confidential © 2018 All rights reserved. Spark Integration for AI/ML Realtime analytics on top of transactional data without ETL YCQL 1 2 3

Slide 54

Slide 54 text

Unless otherwise indicated, these slides are © 2013-2018 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Looking Forward... ● Multi-site PKS capabilities, collaborating with K8s SIG ● Spring Data YugaByte module incubation ● Distributed PostgreSQL support ● Jepsen Performance Testing and Node density benchmarks 5 4