Ryan Horn, Lead Software Engineer at Twilio. November 12, 2014 Las Vegas. BDT312 Using the Cloud to Scale from a Database to a Data Platform



Similar documents
Database Scalability {Patterns} / Robert Treat

CAPTURING & PROCESSING REAL-TIME DATA ON AWS

APPLICATION NOTE. Elastic Scalability. for HetNet Deployment, Management & Optimization

Big Data on AWS. Services Overview. Bernie Nallamotu Principle Solutions Architect

SCALABILITY IN THE CLOUD

Introduction to AWS in Higher Ed

Thing Big: How to Scale Your Own Internet of Things.

Scalable Architecture on Amazon AWS Cloud

Design for Failure High Availability Architectures using AWS

Real Time Big Data Processing

White Paper. Optimizing the Performance Of MySQL Cluster

Enabling Database-as-a-Service (DBaaS) within Enterprises or Cloud Offerings

Microservices on AWS

Pulsar Realtime Analytics At Scale. Tony Ng April 14, 2015

References. Introduction to Database Systems CSE 444. Motivation. Basic Features. Outline: Database in the Cloud. Outline

Introduction to Database Systems CSE 444

Designing Apps for Amazon Web Services

Software Performance, Scalability, and Availability Specifications V 3.0

Cloud Computing In Reality: Experience sharing in cloud solution developments and evaluations

How To Choose Between A Relational Database Service From Aws.Com

Amazon Redshift & Amazon DynamoDB Michael Hanisch, Amazon Web Services Erez Hadas-Sonnenschein, clipkit GmbH Witali Stohler, clipkit GmbH

Scaling Pinterest. Yash Nelapati Ascii Artist. Pinterest Engineering. Saturday, August 31, 13

On- Prem MongoDB- as- a- Service Powered by the CumuLogic DBaaS Platform

Big Data for everyone Democratizing big data with the cloud. Steffen Krause Technical

Salesforce integration with Enterprise Open Source. Mischa de Vries László van den Hoek SFDC Consultant OS Consultant

API Management Introduction and Principles

F1: A Distributed SQL Database That Scales. Presentation by: Alex Degtiar (adegtiar@cmu.edu) /21/2013

Web Application Hosting in the AWS Cloud Best Practices

In Memory Accelerator for MongoDB

Big data blue print for cloud architecture

Service Organization Controls 3 Report

Getting Started with Database As a Service on OpenStack

Hadoop & Spark Using Amazon EMR

Scaling in the Cloud with AWS. By: Eli White (CTO & mojolive) eliw.com - mojolive.com

Big Data Integration: A Buyer's Guide

Next-Generation Cloud Analytics with Amazon Redshift

Understanding Neo4j Scalability

Cluster Computing. ! Fault tolerance. ! Stateless. ! Throughput. ! Stateful. ! Response time. Architectures. Stateless vs. Stateful.

White Paper November Technical Comparison of Perspectium Replicator vs Traditional Enterprise Service Buses

White Paper. Requirements of Network Virtualization

Amazon Web Services Annual ALGIM Conference. Tim Dacombe-Bird Regional Sales Manager Amazon Web Services New Zealand

Cloud Courses Description

Learning Management Redefined. Acadox Infrastructure & Architecture

Apigee Edge API Services Manage, scale, secure, and build APIs and apps

Amazon Web Services Student Tutorial

Primex Wireless OneVue Architecture Statement

Cloud Courses Description

Where We Are. References. Cloud Computing. Levels of Service. Cloud Computing History. Introduction to Data Management CSE 344

The Sierra Clustered Database Engine, the technology at the heart of

Oracle BI EE Implementation on Netezza. Prepared by SureShot Strategies, Inc.

Service Oriented Architecture (SOA) An Introduction


DLT Solutions and Amazon Web Services

Feature Comparison. Windows Server 2008 R2 Hyper-V and Windows Server 2012 Hyper-V

AMAZON S3: ARCHITECTING FOR RESILIENCY IN THE FACE OF FAILURES Jason McHugh

Building a Scalable Big Data Infrastructure for Dynamic Workflows

HDMQ :Towards In-Order and Exactly-Once Delivery using Hierarchical Distributed Message Queues. Dharmit Patel Faraj Khasib Shiva Srivastava

perspective Microservices A New Application Paradigm Abstract

Preparing Your IT for the Holidays. A quick start guide to take your e-commerce to the Cloud

SERVICE-ORIENTED MODELING FRAMEWORK (SOMF ) SERVICE-ORIENTED SOFTWARE ARCHITECTURE MODEL LANGUAGE SPECIFICATIONS

Building Hyper-Scale Platform-as-a-Service Microservices with Microsoft Azure. Patriek van Dorp and Alex Thissen

Scalable Application. Mikalai Alimenkou

Introduction to Amazon Web Services! Leo Senior Solutions Architect

bigdata Managing Scale in Ontological Systems

LONDON. 2015, Amazon Web Services, Inc. or its affiliates. All rights reserved

VBLOCK SOLUTION FOR SAP: SIMPLIFIED PROVISIONING FOR OPERATIONAL EFFICIENCY

PipeCloud : Using Causality to Overcome Speed-of-Light Delays in Cloud-Based Disaster Recovery. Razvan Ghitulete Vrije Universiteit

Unisys Cost Schedule. Unisys Cost Schedule. Page 1

Benchmarking Couchbase Server for Interactive Applications. By Alexey Diomin and Kirill Grigorchuk

Optimizing Data Center Networks for Cloud Computing

Technical Overview Simple, Scalable, Object Storage Software

Private cloud computing advances

QLIKVIEW INTEGRATION TION WITH AMAZON REDSHIFT John Park Partner Engineering

Service Organization Controls 3 Report

Cisco Network Services Manager 5.0

TECHNOLOGY WHITE PAPER Jun 2012

Why Service Providers Need an NFV Platform Strategic White Paper

MERAKI WHITE PAPER Cloud + Wireless LAN = Easier + Affordable

Analyzing Cloud Costs

GigaSpaces Real-Time Analytics for Big Data

Dynamic Content Acceleration: Lightning-Fast Web Apps with Amazon CloudFront and Amazon Route 53

Real-time Data Replication

Azure Data Lake Analytics

Chapter 3. Database Environment - Objectives. Multi-user DBMS Architectures. Teleprocessing. File-Server

Cloud Computing and Amazon Web Services. CJUG March, 2009 Tom Malaher

Cisco OverDrive Network Hypervisor 4.0

Is Your Mobile App Platform RFP Asking The Right Questions?

SOA REFERENCE ARCHITECTURE: SERVICE ORIENTED ARCHITECTURE

DESIGN OF A PLATFORM OF VIRTUAL SERVICE CONTAINERS FOR SERVICE ORIENTED CLOUD COMPUTING. Carlos de Alfonso Andrés García Vicente Hernández

An Oracle White Paper March Best Practices for Real-Time Data Warehousing

Cisco Data Preparation

A Comparison of Clouds: Amazon Web Services, Windows Azure, Google Cloud Platform, VMWare and Others (Fall 2012)

Service Oriented Architecture(SOA)

Top 5 Reasons to choose Microsoft Windows Server 2008 R2 SP1 Hyper-V over VMware vsphere 5

WE RUN SEVERAL ON AWS BECAUSE WE CRITICAL APPLICATIONS CAN SCALE AND USE THE INFRASTRUCTURE EFFICIENTLY.

Transcription:

BDT312 Using the Cloud to Scale from a Database to a Data Platform Ryan Horn, Lead Software Engineer at Twilio November 12, 2014 Las Vegas 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

Hi, I m Ryan Tech Lead of the User Data team at Twilio

What is Twilio? We provide a communications API that enables phones, VoIP, and messaging to be embedded into web, desktop and mobile software.

How Does it Work? A user calls your number Twilio receives the call Your app responds

What is the User Data Team? We scale Twilio's backend database infrastructure We build customer facing data APIs We manage data policies and data security at rest

Databases at Twilio

Calls and Messages are Stateful Queued Queued Ringing Sending In Progress Sent Completed Delivered

In the Beginning All data was placed in the same physical database regardless of where the call or message was in its lifecycle.

The Monolithic Database Model API Carriers Web MySQL Call/Message Service Billing

Problems at Scale Many consumers of data Data with different performance characteristics Failure in the database degrades many services Horizontal scaling and orchestration is complicated

Moving to a Service-Oriented Architecture

What is a Service-Oriented Architecture? An architecture in which required system behavior is decomposed into discrete units of functionality, implemented as individual services for applications to compose and consume.

Communicate Through Interfaces, Not Databases Carriers API Call/Message Service Web In Flight Service In Flight MySQL Billing Post Flight Service Post Flight MySQL

Database Can Change Without Changing Every Service Carriers API Call/Message Service Web In Flight Service In Flight MySQL Billing Post Flight Service Post Flight Amazon DynamoDB

SOA Doesn t Solve Everything No matter how many services you put in front of MySQL, it s still a single point of failure.

Sharding MySQL

Implementing Sharding (the easy part) 1. Choose partitioning scheme 2. Implement routing logic 3. Send application queries through router 4. Go!

Sharding at Twilio Shard0 0-3 3-6 Application Router Shard1 6-9 Shard2

Rolling it Out With Zero Downtime (the hard part) We provide a 24/7, always on service Communications is intolerant of inconsistency and latency There is no maintenance window

Bringing Up a New Shard Master1 0-9 Application Slave1 Master2 Slave2

Split Odds and Evens for Writes Master1 Odds 0-9 Application Slave1 Master2 Evens Slave2

Update Routing Master1 Odds 0-4 Application 5-9 Slave1 Master2 Evens Slave2

Cut Slave Link Master1 0-4 Application 5-9 Slave1 Master2 Slave2

New Solutions, New Problems

A Necessary Burden In the beginning, the burden of managing our own databases was non-negotiable.

The Landscape has Changed We now have a variety of managed database services which solve these problems for us, such as Amazon RDS, Amazon DynamoDB, Amazon SimpleDB, Amazon Redshift, etc.

Cost Is Never Optimized Application developers do not (and should not) optimize for database cost.

Self Managed Databases are Costly Everything Else 22% Databases 78% Source: Twilio Data Usage

Keeping up With Growth As growth continues to accelerate, we need to somehow keep up.

A Change in Approach Change our hiring practices and bring in specialists Remove the context switching

Focusing on What We Do Well

Adopting Amazon DynamoDB

Thinking in Terms of Throughput Amazon DynamoDB allows us to scale in terms of throughput, not machines. This is the future of resource provisioning.

Operations Management and scaling of our cluster is fully abstracted away from us.

Cost Compared to MySQL Amazon DynamoDB 18% MySQL 82% Source: Twilio Data Usage

Cost with MySQL Fully Replaced Databases 39% Everything Else 61% Source: Twilio Data Usage

A Relational Model with Amazon DynamoDB Many of our services allow for querying data in a way that maps naturally to a relational database.

GET /Accounts/2/Events SELECT * FROM events ORDER BY date DESC;

SELECT * FROM events WHERE IpAddress= 5.6.7.8 ORDER BY date DESC;

GET /Accounts/2/Events?IpAddress=5.6.7.8&Date<=2014-10-03 SELECT * FROM events WHERE IpAddress= 5.6.7.8 AND Date<= 2014-10-03 ORDER BY date DESC;

GET /Accounts/2/Events AccountId=2, ScanIndexForward=false AccountId (Hash) Date (Range) IpAddress_Date Type 2 2014-10-03 5.6.7.8 2014-10-03 call 2 2014-10-01 5.6.7.8 2014-10-01 message

GET /Accounts/2/Events?IpAddress=5.6.7.8 AccountId=2, IpAddress_Date begins with 5.6.7.8, ScanIndexForward=false AccountId (Hash) IpAddress_Date (Range) Date 2 5.6.7.8 2014-10-03 2014-10-03 call Type 2 5.6.7.8 2014-10-01 2014-10-01 message

GET /Accounts/2/Events?IpAddress=5.6.7.8&Date<=2014-10-03 AccountId=2, IpAddress_Date LT 5.6.7.8 2014-10-03, ScanIndexForward=false AccountId (Hash) IpAddress_Date (Range) Date 2 5.6.7.8 2014-10-03 2014-10-03 call Type 2 5.6.7.8 2014-10-01 2014-10-01 message

Need to Handle Exceeded Throughput Failures Exceeding provisioned throughput is a runtime error.

Handling Exceeded Write Throughput with Amazon SQS Queuing events to Amazon SQS processing asynchronously allows us to gracefully deal with write throughput errors.

API Web Amazon SQS Events Processor Amazon DynamoDB Billing

Maximum of 5 Global and 5 Local Indexes You can manage your own indexes, but your application must then handle partial mutation failures.

Local Index Size Limits Local secondary indexes provide immediate consistency and limit the data set for a given hash key to 10GB.

Data Warehouse

Brief History 2008-2011 All business intelligence queries run on replicas of MySQL clusters serving production traffic.

Brief History 2011-2013 Data pushed to Amazon S3 and queried with Pig, Amazon EMR, improving ability to aggregate, but with high latency.

Brief History 2013 - Present Move to Amazon Redshift cut the time these reports took from hours to seconds allowing us to answer critical BI and financial questions in near real time.

Pushing Data Into Amazon Redshift SQS (DLQ) S3 Warehouse Loader Amazon Redshift Post Flight Service Kafka Amazon S3 Loader

Wrapping Up

Managed Services as a Culture Our focus is on creating an experience that unifies and simplifies communications is a reflection on our adoption of managed services.

Managed Services as a Culture Understanding and focusing on our areas of expertise and leveraging managed services for the rest accelerates the delivery of value and innovation to our customers.

Thank You!

http://bit.ly/awsevals