SlideShare a Scribd company logo
1 of 31
Download to read offline
A Cassandra driver from and
for the Lua community
LuaConf 2017 - Rio de Janeiro
Thibault Charbonnier
Kong lead engineer
OpenResty contributor
https://github.com/thibaultcha
1
Cassandra - History & Use Cases
2
Apache Cassandra - History
- Free and open-source NoSQL database
- Published by Facebook in 2008
- Joined the Apache Foundation in 2010
3
Apache Cassandra - Use cases
- Decentralized
- Multi datacenter replication
- Horizontal scalability (linear)
- “Key/Value meets column-oriented”
- CQL
A typical Cassandra cluster, often
represented as a ring
4
Apache Cassandra - Use cases
- Leans towards AP
- Tunable Consistency
5
Kong - History & Use Cases
6
Kong - History & Use Cases
- API Gateway/Microservices orchestration tool
- Started in 2014
- Free and open-source (Community Edition)
More on Kong during Thijs Schreijer’s lightning talk at 4:45 PM
https://github.com/Mashape/kong
7
Kong - Use Case
8
Why Cassandra for Kong?
Long story short: business requirements!
- Multi data center support “out of the box”
- Ease to scale (linear + multi DC support)
- Counters! Great for rate-limiting APIs
- Great for time series data (logging & monitoring)
One drawback... We need a pure Lua implementation!
9
Enters: lua-resty-cassandra
10
lua-resty-cassandra - History
- Written by Juarez Bochi (@jbochi) in 2014
- Pure Lua (uses OpenResty’s cosockets)
- Used by globo.com for its video streaming platform
- Released under MIT License
- Support for binary protocol v2 (Cassandra 2.x)
- Single node
https://github.com/jbochi/lua-resty-cassandra
11
lua-resty-cassandra - First Improvements
Better support for Lua/OpenResty interoperability
“Hmmm this is going to be a problem…”
oops
12
lua-resty-cassandra - First Improvements
Batch support, yay!
“Thanks Juarez!”
Batch support is necessary to provide Atomicity when updating
several partition keys at once.
13
lua-resty-cassandra - First Improvements
Pagination Support!
14
lua-resty-cassandra - A fork?
- No love for our binary protocol v3 contribution :’(
- Lack of responses from @jbochi :’(
- Business requirements!
Cassandra 3.x
Binary protocol v3
Load balancing
policies
Retry policies
Cluster awareness
Multi data center
Client-to-node SSL
Client
authentication
Schema consensus
15
Introducing: lua-cassandra
16
Introducing: lua-cassandra
Datastax-like driver for Lua:
- Support for cluster awareness
- Load balancing/retry/reconnection policies
- Support for SSL connections
- Cassandra 3.x - binary protocol v3
- Good documentation with concrete examples
- Interoperability between OpenResty/Lua for
community usage
Forked in May 2015
We keep the lua-resty-cassandra
marshallers!
17
lua-cassandra - Two Modules
Single node:
Cluster aware:
OpenResty only :’(
- Cluster topology discovery
- Auto-prepared statements
- Schema consensus wait on
DDL queries
- Retries
- Policies
- Automatic binary protocol
selection (v2/v3/v4)
- Support for SSL connections
- Support for authentication
18
lua-cassandra - CQL queries
Example of a DDL query
19
lua-cassandra - CQL queries
Example of a DML query
20
lua-cassandra - CQL queries
Example of a DML query with
Cluster module
21
lua-cassandra - Authentication
Support for PasswordAuthenticator:
22
lua-cassandra - Policies
Load balancing - round-robin or datacenter-aware round-robin
Reconnection - simple or exponential
23
lua-cassandra - Policies
24
leafo/pgmoon has the original Lua/OpenResty interoperability module
https://github.com/leafo/pgmoon
lua-resty-socket: An improved version released as a separate library
https://github.com/thibaultcha/lua-resty-socket
- Fallback on LuaSocket when cosockets are not available
- Fallback on LuaSec when SSL is enabled
lua-cassandra - Interoperability
25
lua-cassandra - Testing
LuaCheck - https://github.com/mpeterv/luacheck
busted - https://github.com/Olivine-Labs/busted
Test::Nginx - https://github.com/openresty/test-nginx
LuaCov - https://github.com/keplerproject/luacov
26
lua-cassandra - Documentation
Built with LDoc - https://github.com/stevedonovan/LDoc
Hosted on GitHub - https://thibaultcha.github.io/lua-cassandra/
27
Reflexions
28
Maintaining code for Lua/LuaJIT/OpenResty
- Sometimes hard because of disparities:
- Language: (table.unpack, “table.new”…)
- Environment: cosockets vs LuaSocket (or other…) & embedding
application
- Requires a heavy test suite
- Modularization really helped
- Consider the needs for the clients of your library, to avoid fragmentation
Dropping support for PUC-Lua?
More modularization to support cluster-awareness in PUC-Lua
29
We are hiring!
https://mashape.com/jobs
And contributors are welcome!
30
Thank you!
Questions time!
31

More Related Content

What's hot

KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...KubeAcademy
 
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...tdc-globalcode
 
CNCF explore k8s api using java client
CNCF explore k8s api using java clientCNCF explore k8s api using java client
CNCF explore k8s api using java clientErhwen Kuo
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Waysmalltown
 
Elk for applications on k8s
Elk for applications on k8sElk for applications on k8s
Elk for applications on k8sChe-Chia Chang
 
Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209mffiedler
 
A day in the life of a log message
A day in the life of a log messageA day in the life of a log message
A day in the life of a log messageJosef Karásek
 
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)Lee Myring
 
Docker pipelines
Docker pipelinesDocker pipelines
Docker pipelinesChris Mague
 
ONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaVictor Morales
 
Lifecycle of a pod
Lifecycle of a podLifecycle of a pod
Lifecycle of a podHarshal Shah
 
AWS Lambda and serverless Java | DevNation Live
AWS Lambda and serverless Java | DevNation LiveAWS Lambda and serverless Java | DevNation Live
AWS Lambda and serverless Java | DevNation LiveRed Hat Developers
 
Load Balancing 101
Load Balancing 101Load Balancing 101
Load Balancing 101HungWei Chiu
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API GatewayYohann Ciurlik
 
Logging presentation
Logging presentationLogging presentation
Logging presentationJatan Malde
 
Cncf k8s_network_part1
Cncf k8s_network_part1Cncf k8s_network_part1
Cncf k8s_network_part1Erhwen Kuo
 
Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...
 Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go... Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...
Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...Publicis Sapient Engineering
 
Building Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSSBuilding Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSSSemih Hakkıoğlu
 

What's hot (19)

KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
KubeCon EU 2016: Templatized Application Configuration on OpenShift and Kuber...
 
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
 
CNCF explore k8s api using java client
CNCF explore k8s api using java clientCNCF explore k8s api using java client
CNCF explore k8s api using java client
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
 
Elk for applications on k8s
Elk for applications on k8sElk for applications on k8s
Elk for applications on k8s
 
Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209Testing kubernetes and_open_shift_at_scale_20170209
Testing kubernetes and_open_shift_at_scale_20170209
 
A day in the life of a log message
A day in the life of a log messageA day in the life of a log message
A day in the life of a log message
 
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
Log aggregation: using Elasticsearch, Fluentd/Fluentbit and Kibana (EFK)
 
Docker pipelines
Docker pipelinesDocker pipelines
Docker pipelines
 
ONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s CasablancaONAP MultiCloud/K8s Casablanca
ONAP MultiCloud/K8s Casablanca
 
Lifecycle of a pod
Lifecycle of a podLifecycle of a pod
Lifecycle of a pod
 
AWS Lambda and serverless Java | DevNation Live
AWS Lambda and serverless Java | DevNation LiveAWS Lambda and serverless Java | DevNation Live
AWS Lambda and serverless Java | DevNation Live
 
Load Balancing 101
Load Balancing 101Load Balancing 101
Load Balancing 101
 
Introduction to Kong API Gateway
Introduction to Kong API GatewayIntroduction to Kong API Gateway
Introduction to Kong API Gateway
 
Logging presentation
Logging presentationLogging presentation
Logging presentation
 
Cncf k8s_network_part1
Cncf k8s_network_part1Cncf k8s_network_part1
Cncf k8s_network_part1
 
Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...
 Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go... Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...
Paris Container Day 2016 : Kubernetes, votre assurance-vie pour le cloud (Go...
 
Building Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSSBuilding Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSS
 
Kubernetes debug like a pro
Kubernetes debug like a proKubernetes debug like a pro
Kubernetes debug like a pro
 

Similar to A Cassandra driver from and for the Lua community

Webinar | Better Together: Apache Cassandra and Apache Kafka
Webinar  |  Better Together: Apache Cassandra and Apache KafkaWebinar  |  Better Together: Apache Cassandra and Apache Kafka
Webinar | Better Together: Apache Cassandra and Apache KafkaDataStax
 
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...Data Con LA
 
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and CassandraReal-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and CassandraJoe Stein
 
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...DataStax Academy
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...DataStax Academy
 
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...Lviv Startup Club
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...Radhika Puthiyetath
 
DEVNET-1106 Upcoming Services in OpenStack
DEVNET-1106	Upcoming Services in OpenStackDEVNET-1106	Upcoming Services in OpenStack
DEVNET-1106 Upcoming Services in OpenStackCisco DevNet
 
Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Guido Schmutz
 
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...Databricks
 
Streaming Data with Apache Kafka
Streaming Data with Apache KafkaStreaming Data with Apache Kafka
Streaming Data with Apache KafkaMarkus Günther
 
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...Amazon Web Services
 
Cassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesCassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesScyllaDB
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Guido Schmutz
 
Linked Media Management with Apache Marmotta
Linked Media Management with Apache MarmottaLinked Media Management with Apache Marmotta
Linked Media Management with Apache MarmottaThomas Kurz
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overviewCisco DevNet
 
Kafka 탄생과 생태계
Kafka 탄생과 생태계Kafka 탄생과 생태계
Kafka 탄생과 생태계Gee Yeol Nahm
 
Big Data_Architecture.pptx
Big Data_Architecture.pptxBig Data_Architecture.pptx
Big Data_Architecture.pptxbetalab
 

Similar to A Cassandra driver from and for the Lua community (20)

Webinar | Better Together: Apache Cassandra and Apache Kafka
Webinar  |  Better Together: Apache Cassandra and Apache KafkaWebinar  |  Better Together: Apache Cassandra and Apache Kafka
Webinar | Better Together: Apache Cassandra and Apache Kafka
 
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
Stream your Operational Data with Apache Spark & Kafka into Hadoop using Couc...
 
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and CassandraReal-Time Log Analysis with Apache Mesos, Kafka and Cassandra
Real-Time Log Analysis with Apache Mesos, Kafka and Cassandra
 
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
 
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
 
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
On CloudStack, Docker, Kubernetes, and Big Data…Oh my ! By Sebastien Goasguen...
 
Kafka Explainaton
Kafka ExplainatonKafka Explainaton
Kafka Explainaton
 
DEVNET-1106 Upcoming Services in OpenStack
DEVNET-1106	Upcoming Services in OpenStackDEVNET-1106	Upcoming Services in OpenStack
DEVNET-1106 Upcoming Services in OpenStack
 
Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!Apache Kafka - Scalable Message Processing and more!
Apache Kafka - Scalable Message Processing and more!
 
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...
Alchemist: An Apache Spark <=> MPI Interface with Michael Mahoney and Kai Rot...
 
Streaming Data with Apache Kafka
Streaming Data with Apache KafkaStreaming Data with Apache Kafka
Streaming Data with Apache Kafka
 
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...
(BDT305) Lessons Learned and Best Practices for Running Hadoop on AWS | AWS r...
 
Cassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesCassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary Differences
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
Linked Media Management with Apache Marmotta
Linked Media Management with Apache MarmottaLinked Media Management with Apache Marmotta
Linked Media Management with Apache Marmotta
 
Apache Marmotta - Introduction
Apache Marmotta - IntroductionApache Marmotta - Introduction
Apache Marmotta - Introduction
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overview
 
Kafka 탄생과 생태계
Kafka 탄생과 생태계Kafka 탄생과 생태계
Kafka 탄생과 생태계
 
Big Data_Architecture.pptx
Big Data_Architecture.pptxBig Data_Architecture.pptx
Big Data_Architecture.pptx
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 

A Cassandra driver from and for the Lua community

  • 1. A Cassandra driver from and for the Lua community LuaConf 2017 - Rio de Janeiro Thibault Charbonnier Kong lead engineer OpenResty contributor https://github.com/thibaultcha 1
  • 2. Cassandra - History & Use Cases 2
  • 3. Apache Cassandra - History - Free and open-source NoSQL database - Published by Facebook in 2008 - Joined the Apache Foundation in 2010 3
  • 4. Apache Cassandra - Use cases - Decentralized - Multi datacenter replication - Horizontal scalability (linear) - “Key/Value meets column-oriented” - CQL A typical Cassandra cluster, often represented as a ring 4
  • 5. Apache Cassandra - Use cases - Leans towards AP - Tunable Consistency 5
  • 6. Kong - History & Use Cases 6
  • 7. Kong - History & Use Cases - API Gateway/Microservices orchestration tool - Started in 2014 - Free and open-source (Community Edition) More on Kong during Thijs Schreijer’s lightning talk at 4:45 PM https://github.com/Mashape/kong 7
  • 8. Kong - Use Case 8
  • 9. Why Cassandra for Kong? Long story short: business requirements! - Multi data center support “out of the box” - Ease to scale (linear + multi DC support) - Counters! Great for rate-limiting APIs - Great for time series data (logging & monitoring) One drawback... We need a pure Lua implementation! 9
  • 11. lua-resty-cassandra - History - Written by Juarez Bochi (@jbochi) in 2014 - Pure Lua (uses OpenResty’s cosockets) - Used by globo.com for its video streaming platform - Released under MIT License - Support for binary protocol v2 (Cassandra 2.x) - Single node https://github.com/jbochi/lua-resty-cassandra 11
  • 12. lua-resty-cassandra - First Improvements Better support for Lua/OpenResty interoperability “Hmmm this is going to be a problem…” oops 12
  • 13. lua-resty-cassandra - First Improvements Batch support, yay! “Thanks Juarez!” Batch support is necessary to provide Atomicity when updating several partition keys at once. 13
  • 14. lua-resty-cassandra - First Improvements Pagination Support! 14
  • 15. lua-resty-cassandra - A fork? - No love for our binary protocol v3 contribution :’( - Lack of responses from @jbochi :’( - Business requirements! Cassandra 3.x Binary protocol v3 Load balancing policies Retry policies Cluster awareness Multi data center Client-to-node SSL Client authentication Schema consensus 15
  • 17. Introducing: lua-cassandra Datastax-like driver for Lua: - Support for cluster awareness - Load balancing/retry/reconnection policies - Support for SSL connections - Cassandra 3.x - binary protocol v3 - Good documentation with concrete examples - Interoperability between OpenResty/Lua for community usage Forked in May 2015 We keep the lua-resty-cassandra marshallers! 17
  • 18. lua-cassandra - Two Modules Single node: Cluster aware: OpenResty only :’( - Cluster topology discovery - Auto-prepared statements - Schema consensus wait on DDL queries - Retries - Policies - Automatic binary protocol selection (v2/v3/v4) - Support for SSL connections - Support for authentication 18
  • 19. lua-cassandra - CQL queries Example of a DDL query 19
  • 20. lua-cassandra - CQL queries Example of a DML query 20
  • 21. lua-cassandra - CQL queries Example of a DML query with Cluster module 21
  • 22. lua-cassandra - Authentication Support for PasswordAuthenticator: 22
  • 23. lua-cassandra - Policies Load balancing - round-robin or datacenter-aware round-robin Reconnection - simple or exponential 23
  • 25. leafo/pgmoon has the original Lua/OpenResty interoperability module https://github.com/leafo/pgmoon lua-resty-socket: An improved version released as a separate library https://github.com/thibaultcha/lua-resty-socket - Fallback on LuaSocket when cosockets are not available - Fallback on LuaSec when SSL is enabled lua-cassandra - Interoperability 25
  • 26. lua-cassandra - Testing LuaCheck - https://github.com/mpeterv/luacheck busted - https://github.com/Olivine-Labs/busted Test::Nginx - https://github.com/openresty/test-nginx LuaCov - https://github.com/keplerproject/luacov 26
  • 27. lua-cassandra - Documentation Built with LDoc - https://github.com/stevedonovan/LDoc Hosted on GitHub - https://thibaultcha.github.io/lua-cassandra/ 27
  • 29. Maintaining code for Lua/LuaJIT/OpenResty - Sometimes hard because of disparities: - Language: (table.unpack, “table.new”…) - Environment: cosockets vs LuaSocket (or other…) & embedding application - Requires a heavy test suite - Modularization really helped - Consider the needs for the clients of your library, to avoid fragmentation Dropping support for PUC-Lua? More modularization to support cluster-awareness in PUC-Lua 29
  • 30. We are hiring! https://mashape.com/jobs And contributors are welcome! 30