SlideShare a Scribd company logo
Guilherme Nogueira — Solutions Architect - NA and LATAM, ScyllaDB
Nadav Har'El — Distinguished Engineer, ScyllaDB
Building Run-Anywhere
DynamoDB-Compatible Applications
with Python
Brought to you by
VIRTUAL EVENT | OCTOBER 19 + 20
All Things Performance
The event for developers who care about P99
percentiles and high-performance, low-latency
applications.
Register at p99conf.io
Poll
Where are you in your NoSQL adoption?
Guilherme Nogueira — Solutions Architect - NA and LATAM, ScyllaDB
Nadav Har'El — Distinguished Engineer, ScyllaDB
Building Run-Anywhere
DynamoDB-Compatible Applications
with Python
Presenters
Guilherme Nogueira
Guilherme is a Solutions Architect at ScyllaDB, assists customers in
designing data models that delivers ScyllaDB's potential. Geek,
passionate about Linux and open source software. Helps family and
friends adopt OSS.
Nadav Har'El
Nadav has had a diverse 25-year career in computer programming and
computer science. In the past he worked on scientific computing,
networking software, information retrieval, virtualization and operating
systems. Today he works on Scylla, and among other things led the
Alternator development.
Agenda Objectives
What is ScyllaDB
Intro to ScyllaDB Alternator
Sample Application That Runs Anywhere
Libraries Used
Application Demo
ScyllaDB Monitoring
+ Introduce ScyllaDB Alternator
+ Capabilities, Monitoring
+ Demonstrate how an application using DynamoDB API can run anywhere
+ We updated an Amazon demo app to the latest libraries
+ Free to run in GCP, Azure, Docker
Objectives
7
What is
ScyllaDB?
8
+ NoSQL database, drop-in replacement for Cassandra
and DynamoDB.
The Database Built for Gamechangers
9
One of 12 winners of 2020 Technology of the
Year awards, “identifying the best and most
innovative products in the IT landscape”.
“ScyllaDB stands apart...It’s the rare product
that exceeds my expectations.”
– Martin Heller, InfoWorld contributing editor and reviewer
“For 99.9% of applications, ScyllaDB delivers all the
power a customer will ever need, on workloads that other
databases can’t touch – and at a fraction of the cost of
an in-memory solution.”
– Adrian Bridgewater, Forbes senior contributor
+ Superior performance over legacy NoSQL
+ >5x higher throughput at same cost
+ >20x lower latency
+ >75% TCO savings
+ Avoids vendor lock-in
+ ScyllaDB can run anywhere.
+ Also available as DBaaS on AWS and GCP.
+ Open-Source version available.
10
+400 Gamechangers Leverage ScyllaDB
Seamless experiences
across content + devices
Fast computation of flight
pricing
Corporate fleet
management
Real-time analytics
2,000,000 SKU -commerce
management
Real-time location tracking
for friends/family
Video recommendation
management
IoT for industrial
machines
Synchronize browser
properties for millions
Threat intelligence service
using JanusGraph
Real time fraud detection
across 6M transactions/day
Uber scale, mission critical
chat & messaging app
Network security threat
detection
Power ~50M X1 DVRs with
billions of reqs/day
Precision healthcare via
Edison AI
Inventory hub for retail
operations
Property listings and
updates
Unified ML feature store
across the business
Cryptocurrency exchange
app
Geography-based
recommendations
Distributed storage for
distributed ledger tech
Global operations- Avon,
Body Shop + more
Predictable performance for
on sale surges
GPS-based exercise
tracking
ScyllaDB Cloud
+ Database as a Service on AWS and GCP
+ Fully managed NoSQL DB clusters
+ 24*7 monitoring, support and response teams
+ Secured, private and dedicated cluster
+ Clusters are multi-zone by default
+ Finding the right fit/solution - more than 20 instance types across 39 regions
+ Geo redundancy
ScyllaDB
Alternator
12
ScyllaDB Alternator
ScyllaDB started with Cassandra®’s APIs: CQL & Thrift.
Alternator: added a DynamoDBTM
-compatible API to ScyllaDB.
Why a DynamoDB API?
+ Popularity growing, closing in on Cassandra.
+ ScyllaDB solves real AWS lock-in problem.
+ DynamoDB apps can now be developed,
or run, anywhere, and at cheaper cost.
+ DynamoDB API is close in features to CQL.
DynamoDB
Cassandra
2013 2022
DB-Engines popularity ranking (log)
ScyllaDB Alternator
+ Alternator is part of ScyllaDB open-source and Enterprise editions -
+ ScyllaDB listens for DynamoDB API requests in addition to CQL.
+ Same installation, setup, etc. just run with extra options:
+ alternator_port and/or alternator_https_port
alternator_write_isolation (choose how read-modify-write operations are isolated)
+ Available in ScyllaDB Cloud since June 2020.
Alternator vs. DynamoDB
+ Alternator goal: full compatibility with DynamoDB API.
+ Support unmodified or mostly-unmodified applications designed for DynamoDB.
+ But run them anywhere that ScyllaDB can run - avoid vendor lock-in!
+ Already mostly compatible except some unimplemented features listed in
docs/alternator/compatibility.md.
+ Authentication supported but not access control (IAM policies).
+ GSI supported but can’t be added after the table’s creation.
+ “Projection” parameter of GSI/LSI is not honored - all base table attributes are available in the index.
+ All of Alternator’s tables are “Global Tables”, i.e., same on all DCs.
+ DynamoDB’s Backup APIs not supported - use Scylla’s backup tools instead.
+ DynamoDB’s new multi-item “transactions” feature is not supported.
+ Kinesis Streams API not supported (but we do support DynamoDB Streams).
+ New PartiQL syntax not supported. Use CQL if you want an SQL-like syntax.
+ Export to S3.
Alternator vs. DynamoDB Continued
+ Like ScyllaDB, Alternator is a dedicated installation, not multi-tenant service like DynamoDB:
+ Cluster is dedicated to one customer.
+ DynamoDB users are not aware of individual nodes, Scylla users are -
+ We’ll discuss load balancing in a few minutes.
+ Powerful monitoring framework from ScyllaDB (Prometheus, Grafana) -
+ Understand your workload’s performance and get insights on how to improve it.
Trying Alternator
To try Alternator quickly, you can:
+ Create an Alternator cluster on ScyllaDB Cloud
+ Run one Alternator node on your machine in 5 minutes, using docker:
docker pull scylladb/scylla:latest
docker run --name scylla -d -p 8000:8000
scylladb/scylla:latest --alternator-port=8000
--alternator-write-isolation=always
Migrating from DynamoDB to Alternator
+ Install ScyllaDB or get a managed cluster on ScyllaDB Cloud
+ Tell your application, written to use DynamoDB, to use Scylla’s nodes (see “load balancing”)
+ Migrate existing data from DynamoDB to ScyllaDB using the DynamoDB API
+ E.g. ScyllaDB migrator:
https://www.scylladb.com/2021/11/04/migrating-dynamodb-workloads-from-aws-to-google-cloud-si
mplified-with-scylladb-alternator/
Python Application
19
Why Python
+ Multiplatform, available by default on most Linux distributions
+ Simplicity
+ Huge list of libraries available
+ Extensive use in data-science
Run Anywhere
+ Run your application anywhere using ScyllaDB Alternator
+ Any cloud-provider;
+ On-prem;
+ On your CI/CD pipeline;
+ On your dev machine;
+ Fully featured installation
+ Get the exact same features in any of the deployment options;
Tic-Tac-Toe Example
+ Tic-tac-toe sample using the boto3 framework;
+ Code is licensed under the Apache-2.0 and initially written by Amazon;
+ Works out of the box with Alternator;
+ Online web multiplayer game;
Code is available on:
https://github.com/hopugop/dynamodb-tictactoe-example-app
Application Structure
/
├─ application.py
├─ config
├─ models/
│ ├─ game.py
├─ dynamodb/
│ ├─ setupDynamoDB.py
│ ├─ connectionManager.py
│ ├─ gameController.py
├─ static/
│ ├─ ...
├─ templates/
│ ├─ ...
Libraries Used
24
Python Has Built in Batteries…
But that’s not always enough!
In this project, we used the following additional libraries:
+ boto3
+ flask
+ alternator_boto3 (ScyllaDB-provided)
Library: flask
+ Micro web framework for Python;
+ It does not require particular tools or libraries;
+ No database abstraction layer, form validation, etc;
+ Extensions to add functionalities,
+ Chosen for its lightweight footprint and very easy configurability
Library: boto3
+ Interact with several AWS service APIs
+ Built on top of botocore
+ core functionality to access to different types of AWS services
+ Not restricted to DynamoDB. Actually many services are supported:
+ S3
+ Lambda
+ EC2
+ CloudWatch
+ And many more…
+ Our example uses the DynamoDB API only
alternator_boto3 (ScyllaDB)
+ Not an actual library;
+ A library in a file;
+ Sample code to build a resilient connection against an Alternator cluster;
+ Live node detection and connection balancing;
We will circle back to this library in a moment…
See https://github.com/scylladb/alternator-load-balancing
Alternator
Load-balancing
29
DynamoDB vs Alternator Load-balancing
+ DynamoDB is a fully managed solution;
+ Load balancing is provided by AWS;
+ Alternator is self-hosted or as a managed solution;
+ Multi-node cluster architecture, no leaders or main contact points;
+ Load-balancing flexibility:
+ Deploy a load balancer between client and server;
+ Client-side balancing;
Alternator Local Nodes API
+ Exposes an API for checking cluster nodes
+ High-availability workload balancer for the cluster nodes
ScyllaDB boto3 alternator load balancer
+ ScyllaDB-provided sample
+ Provides balanced connectivity to boto3 programs
+ Background thread ensures node list is updated
Alternator Client-side Balancing
+ Previously-mentioned sample alternator_boto3 library-in-a-file;
+ Implemented on client-side;
+ Checks for live nodes in a set interval;
+ Updates connection string for a live node;
+ Random selection of nodes to balance out requests;
+ Ensure only live nodes are tried;
+ Not token/shard aware;
Let’s Dive In
33
ScyllaDB Monitoring
Stack Insights
34
Observability in Alternator
+ Monitoring stack
+ Prometheus collects metrics
+ Grafana visualization
+ Alert manager, Advisor
+ Hundreds of different metrics.
+ Counters, rates, histograms, etc.
+ Total, per node, per shard.
35
Just a small part of the many detailed
dashboards in Scylla’s Grafana UI
Throughput and Latency During Stress
YCSB write-only stress test A 3-node
cluster
Each of the 3 nodes
reaching 100% load
(CPU utilization)
How many DynamoDB API requests of
each type are served per second?
Per-instance (node) graph: About 25,000 PutItem
requests per second handled by each node
Can also see total of entire cluster:
About 75,000 PutItems per second.
In addition to rate of each operation,
we can see its latency
PutItem throughput (again) -
75,000 per second
Average PutItem latency -
7ms
95th percentile latency -
11ms
99th percentile latency -
12ms
Because the cluster is 100% loaded in this example, high latency
is expected, but we can see it’s still not unacceptably high.
Large Items Detection
Poll
How much data do you have under management of your
database?
Q&A
WANT TO KEEP LEARNING?
Join ScyllaDB University for Free:
university.scylladb.com
SCYLLADB VIRTUAL WORKSHOP
Getting Started with ScyllaDB
29 September, 2022, 12PM GMT | 8 AM ET | 5:30 PM IST
Thank you
for joining us today.
@scylladb scylladb/
slack.scylladb.com
@scylladb company/scylladb/
scylladb/

More Related Content

PDF
Exploring ScyllaDB’s DynamoDB-Compatible API by Guilherme Nogueira & Nadav Ha...
PDF
Alternator webinar september 2019
PPTX
Free & Open DynamoDB API for Everyone
PDF
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
PDF
Use ScyllaDB Alternator to Use Amazon DynamoDB API, Everywhere, Better, More ...
PPTX
Empowering the AWS DynamoDB™ application developer with Alternator
PDF
Moving from DynamoDB to ScyllaDB: Technical Comparison and the Path to Success
PDF
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...
Exploring ScyllaDB’s DynamoDB-Compatible API by Guilherme Nogueira & Nadav Ha...
Alternator webinar september 2019
Free & Open DynamoDB API for Everyone
Introducing Project Alternator - Scylla’s Open-Source DynamoDB-compatible API
Use ScyllaDB Alternator to Use Amazon DynamoDB API, Everywhere, Better, More ...
Empowering the AWS DynamoDB™ application developer with Alternator
Moving from DynamoDB to ScyllaDB: Technical Comparison and the Path to Success
Running a Cost-Effective DynamoDB-Compatible Database on Managed Kubernetes S...

Similar to Build DynamoDB-Compatible Apps with Python (20)

PDF
Running a DynamoDB-compatible Database on Managed Kubernetes Services
PPTX
DynamoDB to ScyllaDB: Technical Comparison and the Path to Success
PDF
ScyllaDB Virtual Workshop
PDF
DynamoDB Cost Optimization Masterclass: ScyllaDB as a DynamoDB Alternative
PDF
Using ScyllaDB for Extreme Scale Workloads
PDF
Understanding The True Cost of DynamoDB Webinar
PPTX
Why We Chose ScyllaDB over DynamoDB for "User Watch Status"
PDF
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
PDF
New Ways to Reduce Database Costs with ScyllaDB
PPTX
Radically Outperforming DynamoDB @ Digital Turbine with SADA and Google Cloud
PDF
5 Factors When Selecting a High Performance, Low Latency Database
PDF
How Development Teams Cut Costs with ScyllaDB.pdf
PDF
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
PPTX
Scylla Virtual Workshop 2022
PDF
ScyllaDB Virtual Workshop: Getting Started with ScyllaDB 2024
PDF
Recent ScyllaDB Cloud Highlights and Future Roadmap by Michael Hollander & Iv...
PDF
Observability Best Practices for Your Cloud DBaaS
PDF
Demystifying the Distributed Database Landscape (DevOps) (1).pdf
PPTX
iFood on Delivering 100 Million Events a Month to Restaurants with Scylla
PDF
Build Low-Latency Applications in Rust on ScyllaDB
Running a DynamoDB-compatible Database on Managed Kubernetes Services
DynamoDB to ScyllaDB: Technical Comparison and the Path to Success
ScyllaDB Virtual Workshop
DynamoDB Cost Optimization Masterclass: ScyllaDB as a DynamoDB Alternative
Using ScyllaDB for Extreme Scale Workloads
Understanding The True Cost of DynamoDB Webinar
Why We Chose ScyllaDB over DynamoDB for "User Watch Status"
Scylla Summit 2022: How ScyllaDB Powers This Next Tech Cycle
New Ways to Reduce Database Costs with ScyllaDB
Radically Outperforming DynamoDB @ Digital Turbine with SADA and Google Cloud
5 Factors When Selecting a High Performance, Low Latency Database
How Development Teams Cut Costs with ScyllaDB.pdf
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
Scylla Virtual Workshop 2022
ScyllaDB Virtual Workshop: Getting Started with ScyllaDB 2024
Recent ScyllaDB Cloud Highlights and Future Roadmap by Michael Hollander & Iv...
Observability Best Practices for Your Cloud DBaaS
Demystifying the Distributed Database Landscape (DevOps) (1).pdf
iFood on Delivering 100 Million Events a Month to Restaurants with Scylla
Build Low-Latency Applications in Rust on ScyllaDB
Ad

More from ScyllaDB (20)

PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
PDF
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
PDF
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
PDF
Leading a High-Stakes Database Migration
PDF
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
PDF
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
PDF
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
PDF
ScyllaDB: 10 Years and Beyond by Dor Laor
PDF
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
PDF
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
PDF
Vector Search with ScyllaDB by Szymon Wasik
PDF
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
PDF
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
PDF
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
PDF
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
PDF
Lessons Learned from Building a Serverless Notifications System by Srushith R...
PDF
A Dist Sys Programmer's Journey into AI by Piotr Sarna
PDF
High Availability: Lessons Learned by Paul Preuveneers
PDF
How Natura Uses ScyllaDB and ScyllaDB Connector to Create a Real-time Data Pi...
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Leading a High-Stakes Database Migration
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
ScyllaDB: 10 Years and Beyond by Dor Laor
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Vector Search with ScyllaDB by Szymon Wasik
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
Lessons Learned from Building a Serverless Notifications System by Srushith R...
A Dist Sys Programmer's Journey into AI by Piotr Sarna
High Availability: Lessons Learned by Paul Preuveneers
How Natura Uses ScyllaDB and ScyllaDB Connector to Create a Real-time Data Pi...
Ad

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Modernizing your data center with Dell and AMD
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Modernizing your data center with Dell and AMD
Diabetes mellitus diagnosis method based random forest with bat algorithm
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Building Integrated photovoltaic BIPV_UPV.pdf
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Advanced methodologies resolving dimensionality complications for autism neur...
Machine learning based COVID-19 study performance prediction
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf

Build DynamoDB-Compatible Apps with Python

  • 1. Guilherme Nogueira — Solutions Architect - NA and LATAM, ScyllaDB Nadav Har'El — Distinguished Engineer, ScyllaDB Building Run-Anywhere DynamoDB-Compatible Applications with Python
  • 2. Brought to you by VIRTUAL EVENT | OCTOBER 19 + 20 All Things Performance The event for developers who care about P99 percentiles and high-performance, low-latency applications. Register at p99conf.io
  • 3. Poll Where are you in your NoSQL adoption?
  • 4. Guilherme Nogueira — Solutions Architect - NA and LATAM, ScyllaDB Nadav Har'El — Distinguished Engineer, ScyllaDB Building Run-Anywhere DynamoDB-Compatible Applications with Python
  • 5. Presenters Guilherme Nogueira Guilherme is a Solutions Architect at ScyllaDB, assists customers in designing data models that delivers ScyllaDB's potential. Geek, passionate about Linux and open source software. Helps family and friends adopt OSS. Nadav Har'El Nadav has had a diverse 25-year career in computer programming and computer science. In the past he worked on scientific computing, networking software, information retrieval, virtualization and operating systems. Today he works on Scylla, and among other things led the Alternator development.
  • 6. Agenda Objectives What is ScyllaDB Intro to ScyllaDB Alternator Sample Application That Runs Anywhere Libraries Used Application Demo ScyllaDB Monitoring
  • 7. + Introduce ScyllaDB Alternator + Capabilities, Monitoring + Demonstrate how an application using DynamoDB API can run anywhere + We updated an Amazon demo app to the latest libraries + Free to run in GCP, Azure, Docker Objectives 7
  • 9. + NoSQL database, drop-in replacement for Cassandra and DynamoDB. The Database Built for Gamechangers 9 One of 12 winners of 2020 Technology of the Year awards, “identifying the best and most innovative products in the IT landscape”. “ScyllaDB stands apart...It’s the rare product that exceeds my expectations.” – Martin Heller, InfoWorld contributing editor and reviewer “For 99.9% of applications, ScyllaDB delivers all the power a customer will ever need, on workloads that other databases can’t touch – and at a fraction of the cost of an in-memory solution.” – Adrian Bridgewater, Forbes senior contributor + Superior performance over legacy NoSQL + >5x higher throughput at same cost + >20x lower latency + >75% TCO savings + Avoids vendor lock-in + ScyllaDB can run anywhere. + Also available as DBaaS on AWS and GCP. + Open-Source version available.
  • 10. 10 +400 Gamechangers Leverage ScyllaDB Seamless experiences across content + devices Fast computation of flight pricing Corporate fleet management Real-time analytics 2,000,000 SKU -commerce management Real-time location tracking for friends/family Video recommendation management IoT for industrial machines Synchronize browser properties for millions Threat intelligence service using JanusGraph Real time fraud detection across 6M transactions/day Uber scale, mission critical chat & messaging app Network security threat detection Power ~50M X1 DVRs with billions of reqs/day Precision healthcare via Edison AI Inventory hub for retail operations Property listings and updates Unified ML feature store across the business Cryptocurrency exchange app Geography-based recommendations Distributed storage for distributed ledger tech Global operations- Avon, Body Shop + more Predictable performance for on sale surges GPS-based exercise tracking
  • 11. ScyllaDB Cloud + Database as a Service on AWS and GCP + Fully managed NoSQL DB clusters + 24*7 monitoring, support and response teams + Secured, private and dedicated cluster + Clusters are multi-zone by default + Finding the right fit/solution - more than 20 instance types across 39 regions + Geo redundancy
  • 13. ScyllaDB Alternator ScyllaDB started with Cassandra®’s APIs: CQL & Thrift. Alternator: added a DynamoDBTM -compatible API to ScyllaDB. Why a DynamoDB API? + Popularity growing, closing in on Cassandra. + ScyllaDB solves real AWS lock-in problem. + DynamoDB apps can now be developed, or run, anywhere, and at cheaper cost. + DynamoDB API is close in features to CQL. DynamoDB Cassandra 2013 2022 DB-Engines popularity ranking (log)
  • 14. ScyllaDB Alternator + Alternator is part of ScyllaDB open-source and Enterprise editions - + ScyllaDB listens for DynamoDB API requests in addition to CQL. + Same installation, setup, etc. just run with extra options: + alternator_port and/or alternator_https_port alternator_write_isolation (choose how read-modify-write operations are isolated) + Available in ScyllaDB Cloud since June 2020.
  • 15. Alternator vs. DynamoDB + Alternator goal: full compatibility with DynamoDB API. + Support unmodified or mostly-unmodified applications designed for DynamoDB. + But run them anywhere that ScyllaDB can run - avoid vendor lock-in! + Already mostly compatible except some unimplemented features listed in docs/alternator/compatibility.md. + Authentication supported but not access control (IAM policies). + GSI supported but can’t be added after the table’s creation. + “Projection” parameter of GSI/LSI is not honored - all base table attributes are available in the index. + All of Alternator’s tables are “Global Tables”, i.e., same on all DCs. + DynamoDB’s Backup APIs not supported - use Scylla’s backup tools instead. + DynamoDB’s new multi-item “transactions” feature is not supported. + Kinesis Streams API not supported (but we do support DynamoDB Streams). + New PartiQL syntax not supported. Use CQL if you want an SQL-like syntax. + Export to S3.
  • 16. Alternator vs. DynamoDB Continued + Like ScyllaDB, Alternator is a dedicated installation, not multi-tenant service like DynamoDB: + Cluster is dedicated to one customer. + DynamoDB users are not aware of individual nodes, Scylla users are - + We’ll discuss load balancing in a few minutes. + Powerful monitoring framework from ScyllaDB (Prometheus, Grafana) - + Understand your workload’s performance and get insights on how to improve it.
  • 17. Trying Alternator To try Alternator quickly, you can: + Create an Alternator cluster on ScyllaDB Cloud + Run one Alternator node on your machine in 5 minutes, using docker: docker pull scylladb/scylla:latest docker run --name scylla -d -p 8000:8000 scylladb/scylla:latest --alternator-port=8000 --alternator-write-isolation=always
  • 18. Migrating from DynamoDB to Alternator + Install ScyllaDB or get a managed cluster on ScyllaDB Cloud + Tell your application, written to use DynamoDB, to use Scylla’s nodes (see “load balancing”) + Migrate existing data from DynamoDB to ScyllaDB using the DynamoDB API + E.g. ScyllaDB migrator: https://www.scylladb.com/2021/11/04/migrating-dynamodb-workloads-from-aws-to-google-cloud-si mplified-with-scylladb-alternator/
  • 20. Why Python + Multiplatform, available by default on most Linux distributions + Simplicity + Huge list of libraries available + Extensive use in data-science
  • 21. Run Anywhere + Run your application anywhere using ScyllaDB Alternator + Any cloud-provider; + On-prem; + On your CI/CD pipeline; + On your dev machine; + Fully featured installation + Get the exact same features in any of the deployment options;
  • 22. Tic-Tac-Toe Example + Tic-tac-toe sample using the boto3 framework; + Code is licensed under the Apache-2.0 and initially written by Amazon; + Works out of the box with Alternator; + Online web multiplayer game; Code is available on: https://github.com/hopugop/dynamodb-tictactoe-example-app
  • 23. Application Structure / ├─ application.py ├─ config ├─ models/ │ ├─ game.py ├─ dynamodb/ │ ├─ setupDynamoDB.py │ ├─ connectionManager.py │ ├─ gameController.py ├─ static/ │ ├─ ... ├─ templates/ │ ├─ ...
  • 25. Python Has Built in Batteries… But that’s not always enough! In this project, we used the following additional libraries: + boto3 + flask + alternator_boto3 (ScyllaDB-provided)
  • 26. Library: flask + Micro web framework for Python; + It does not require particular tools or libraries; + No database abstraction layer, form validation, etc; + Extensions to add functionalities, + Chosen for its lightweight footprint and very easy configurability
  • 27. Library: boto3 + Interact with several AWS service APIs + Built on top of botocore + core functionality to access to different types of AWS services + Not restricted to DynamoDB. Actually many services are supported: + S3 + Lambda + EC2 + CloudWatch + And many more… + Our example uses the DynamoDB API only
  • 28. alternator_boto3 (ScyllaDB) + Not an actual library; + A library in a file; + Sample code to build a resilient connection against an Alternator cluster; + Live node detection and connection balancing; We will circle back to this library in a moment… See https://github.com/scylladb/alternator-load-balancing
  • 30. DynamoDB vs Alternator Load-balancing + DynamoDB is a fully managed solution; + Load balancing is provided by AWS; + Alternator is self-hosted or as a managed solution; + Multi-node cluster architecture, no leaders or main contact points; + Load-balancing flexibility: + Deploy a load balancer between client and server; + Client-side balancing;
  • 31. Alternator Local Nodes API + Exposes an API for checking cluster nodes + High-availability workload balancer for the cluster nodes ScyllaDB boto3 alternator load balancer + ScyllaDB-provided sample + Provides balanced connectivity to boto3 programs + Background thread ensures node list is updated
  • 32. Alternator Client-side Balancing + Previously-mentioned sample alternator_boto3 library-in-a-file; + Implemented on client-side; + Checks for live nodes in a set interval; + Updates connection string for a live node; + Random selection of nodes to balance out requests; + Ensure only live nodes are tried; + Not token/shard aware;
  • 35. Observability in Alternator + Monitoring stack + Prometheus collects metrics + Grafana visualization + Alert manager, Advisor + Hundreds of different metrics. + Counters, rates, histograms, etc. + Total, per node, per shard. 35 Just a small part of the many detailed dashboards in Scylla’s Grafana UI
  • 36. Throughput and Latency During Stress YCSB write-only stress test A 3-node cluster Each of the 3 nodes reaching 100% load (CPU utilization)
  • 37. How many DynamoDB API requests of each type are served per second? Per-instance (node) graph: About 25,000 PutItem requests per second handled by each node Can also see total of entire cluster: About 75,000 PutItems per second.
  • 38. In addition to rate of each operation, we can see its latency PutItem throughput (again) - 75,000 per second Average PutItem latency - 7ms 95th percentile latency - 11ms 99th percentile latency - 12ms Because the cluster is 100% loaded in this example, high latency is expected, but we can see it’s still not unacceptably high.
  • 40. Poll How much data do you have under management of your database?
  • 41. Q&A WANT TO KEEP LEARNING? Join ScyllaDB University for Free: university.scylladb.com SCYLLADB VIRTUAL WORKSHOP Getting Started with ScyllaDB 29 September, 2022, 12PM GMT | 8 AM ET | 5:30 PM IST
  • 42. Thank you for joining us today. @scylladb scylladb/ slack.scylladb.com @scylladb company/scylladb/ scylladb/