SlideShare a Scribd company logo
1 of 10
Scylladb 3.0 New
Chen Shi
2019/1/23
Agenda
• Hinted Handoff
• Allow Filtering support
• Streaming improvements
• Materialized Views
• Global Secondary Indexes
• Full, Multi-partition scan improvements
• New sstable format
Hinted Handoff
• 原因
• 很高的写负载
• 网络故障
• 硬件故障
• 好处
• 降低在节点故障期间造成的数据不一致的影响
• 降低repair工作量
• 降低read-repair时,checksum不一致的概率
Allow filtering
CREATE TABLE blogs (blogId int,
time1 int,
time2 int,
author text,
content text,
PRIMARY KEY(blogId, time1, time2));
SELECT * FROM blogs WHERE time1 = 1418306451235;
SELECT * FROM blogs WHERE author = ‘Jonathan Ellis’; Ok if author column is indexed
SELECT * FROM blogs WHERE author=’Jonathan Ellis’ and time2 = 1418306451235;
filtering is needed even author
and time2 column are indexed
DONOT always use allow filtering for your problem !
为了保持对cassandra和spark-Cassandra connector的兼容,以及对老数据集灵活查询的支持
Streaming
• 当有新节点加入(bootstrap)、退出(decommission)、repair时,节点
对应的数据从一方流向另一方
• 老版本中,接收方需要先将数据放到memtable,满了后,再flush到
sstable;新版本绕过memtable直接写sstable
• 好处
• 降低内存开销(可用于服务于请求)
• 不用再对迁移过来的数据的memtable插入、排序,降低CPU cycles
• 更少的sstable compactions
Materialized Views
• 一个存储某种查询的结果的表 (base table -> view table, denormalization)
• 不能直接对其更新,但更新base table会异步更新它
• 二级索引建立在其上
Scylla Summit 2017- Distributed Materialized Views
Global Secondary Indexes
• Cassandra 二级索引 (local indexes)
• 数据在哪,索引就在哪
• 写很快,但读可能要查询其它节点;且不具备扩展性
• Scylla global indexing
CREATE TABLE ks.users (
userid uuid,
name text,
email text,
country text,
PRIMARY KEY (userid)
);
CREATE INDEX ON ks.users (email); CREATE MATERIALIZED VIEW
ks.users_email_idx_index AS
SELECT email, userid
FROM ks.users
WHERE email IS NOT NULL
PRIMARY KEY (email, userid)
WITH CLUSTERING ORDER BY
(userid ASC);
选用二级索引还是MV取决于应用
Full, Multi-partition scan improvements
• 一种控制算法,提高range query性能
• 算法本身使用了缓冲和预读,以防止读被中止
• 好处
• 提高了系统响应
• 减少了disk read,range scan性能提高
New sstable format
• 兼容Cassandra 3.x sstables
• 比Scylla 老版本快
Reference
• Scylla blog: 3.0 Overview
• 3.0 Release Notes
• Scylla doc: Hinted handoff
• Cassandra blog: Allow filtering
• Scylla blog: secondary index & Cassandra blog: native secondary index

More Related Content

What's hot

ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索Will Huang
 
Frontend Devops at Cloudinsight
Frontend Devops at CloudinsightFrontend Devops at Cloudinsight
Frontend Devops at CloudinsightYan Wang
 
Elastic Stack 最新动态
Elastic Stack 最新动态Elastic Stack 最新动态
Elastic Stack 最新动态Elasticsearch
 
把玩 Jenkins CI
把玩 Jenkins CI把玩 Jenkins CI
把玩 Jenkins CIHao Lee
 
網站上線了,然後呢?
網站上線了,然後呢?網站上線了,然後呢?
網站上線了,然後呢?Kirk Chen
 
Envrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chefEnvrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chefmingjin
 
Continuous Delivery: automated testing, continuous integration and continuous...
Continuous Delivery: automated testing, continuous integration and continuous...Continuous Delivery: automated testing, continuous integration and continuous...
Continuous Delivery: automated testing, continuous integration and continuous...Jimmy Lai
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)Will Huang
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)Will Huang
 
Azure Web App on Linux @ Global Azure Bootcamp 2017 Taiwan
Azure Web App on Linux @ Global Azure Bootcamp 2017 TaiwanAzure Web App on Linux @ Global Azure Bootcamp 2017 Taiwan
Azure Web App on Linux @ Global Azure Bootcamp 2017 TaiwanWill Huang
 
W3CTech美团react专场-React Native 初探
W3CTech美团react专场-React Native 初探W3CTech美团react专场-React Native 初探
W3CTech美团react专场-React Native 初探美团点评技术团队
 
Extend the Kubernetes API with CRD and Custom API Server
Extend the Kubernetes API with CRD and Custom API ServerExtend the Kubernetes API with CRD and Custom API Server
Extend the Kubernetes API with CRD and Custom API Serverinwin stack
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Will Huang
 
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)Will Huang
 
Build your own kubernetes apiserver and resource type
Build your own kubernetes apiserver and resource typeBuild your own kubernetes apiserver and resource type
Build your own kubernetes apiserver and resource typeinwin stack
 

What's hot (15)

ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索ASP.NET Core 6.0 全新功能探索
ASP.NET Core 6.0 全新功能探索
 
Frontend Devops at Cloudinsight
Frontend Devops at CloudinsightFrontend Devops at Cloudinsight
Frontend Devops at Cloudinsight
 
Elastic Stack 最新动态
Elastic Stack 最新动态Elastic Stack 最新动态
Elastic Stack 最新动态
 
把玩 Jenkins CI
把玩 Jenkins CI把玩 Jenkins CI
把玩 Jenkins CI
 
網站上線了,然後呢?
網站上線了,然後呢?網站上線了,然後呢?
網站上線了,然後呢?
 
Envrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chefEnvrionment as a code with vagrant & chef
Envrionment as a code with vagrant & chef
 
Continuous Delivery: automated testing, continuous integration and continuous...
Continuous Delivery: automated testing, continuous integration and continuous...Continuous Delivery: automated testing, continuous integration and continuous...
Continuous Delivery: automated testing, continuous integration and continuous...
 
AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)AKS 與開發人員體驗 (Kubernetes 大講堂)
AKS 與開發人員體驗 (Kubernetes 大講堂)
 
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
使用 C#/Razor 開發互動式 WebAssembly 網站 (Modern Web 2018)
 
Azure Web App on Linux @ Global Azure Bootcamp 2017 Taiwan
Azure Web App on Linux @ Global Azure Bootcamp 2017 TaiwanAzure Web App on Linux @ Global Azure Bootcamp 2017 Taiwan
Azure Web App on Linux @ Global Azure Bootcamp 2017 Taiwan
 
W3CTech美团react专场-React Native 初探
W3CTech美团react专场-React Native 初探W3CTech美团react专场-React Native 初探
W3CTech美团react专场-React Native 初探
 
Extend the Kubernetes API with CRD and Custom API Server
Extend the Kubernetes API with CRD and Custom API ServerExtend the Kubernetes API with CRD and Custom API Server
Extend the Kubernetes API with CRD and Custom API Server
 
Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)Angular 开发技巧 (2018 ngChina 开发者大会)
Angular 开发技巧 (2018 ngChina 开发者大会)
 
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
 
Build your own kubernetes apiserver and resource type
Build your own kubernetes apiserver and resource typeBuild your own kubernetes apiserver and resource type
Build your own kubernetes apiserver and resource type
 

Similar to Scylladb 3.0 new

诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 maclean liu
 
My sql 5.6新特性深入剖析——innodb引擎
My sql 5.6新特性深入剖析——innodb引擎My sql 5.6新特性深入剖析——innodb引擎
My sql 5.6新特性深入剖析——innodb引擎frogd
 
Nosql三步曲
Nosql三步曲Nosql三步曲
Nosql三步曲84zhu
 
MySQL运维那些事
MySQL运维那些事MySQL运维那些事
MySQL运维那些事Jinrong Ye
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysqlZoom Quiet
 
Itpub电子杂志第四期第二稿
Itpub电子杂志第四期第二稿Itpub电子杂志第四期第二稿
Itpub电子杂志第四期第二稿yiditushe
 
Google LevelDB Study Discuss
Google LevelDB Study DiscussGoogle LevelDB Study Discuss
Google LevelDB Study Discusseverestsun
 
Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)frogd
 
企業導入微服務實戰 - updated
企業導入微服務實戰 - updated企業導入微服務實戰 - updated
企業導入微服務實戰 - updatedPaul Chao
 
基于 lucene 的站内搜索
基于 lucene 的站内搜索基于 lucene 的站内搜索
基于 lucene 的站内搜索fulin tang
 
设计高性能mysql应用-TechClub技术沙龙
设计高性能mysql应用-TechClub技术沙龙设计高性能mysql应用-TechClub技术沙龙
设计高性能mysql应用-TechClub技术沙龙banping
 
Golang 高性能实战
Golang 高性能实战Golang 高性能实战
Golang 高性能实战rfyiamcool
 
COSCUP 2019 - 開源大數據引擎 Greenplum
COSCUP 2019 - 開源大數據引擎 GreenplumCOSCUP 2019 - 開源大數據引擎 Greenplum
COSCUP 2019 - 開源大數據引擎 GreenplumOmni-Alex Chen
 
Exadata那点事
Exadata那点事Exadata那点事
Exadata那点事freezr
 
廣宣學堂: 企業導入微服務實戰
廣宣學堂: 企業導入微服務實戰廣宣學堂: 企業導入微服務實戰
廣宣學堂: 企業導入微服務實戰Paul Chao
 
企業導入微服務實戰 - updated
企業導入微服務實戰 - updated企業導入微服務實戰 - updated
企業導入微服務實戰 - updatedPaul Chao
 
改善Programmer生活的sql技能
改善Programmer生活的sql技能改善Programmer生活的sql技能
改善Programmer生活的sql技能Rack Lin
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构n716
 
数据架构方面的一些探讨
数据架构方面的一些探讨数据架构方面的一些探讨
数据架构方面的一些探讨Chao Zhu
 
MySQL5.6新功能
MySQL5.6新功能MySQL5.6新功能
MySQL5.6新功能郁萍 王
 

Similar to Scylladb 3.0 new (20)

诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础 诗檀软件 Oracle开发优化基础
诗檀软件 Oracle开发优化基础
 
My sql 5.6新特性深入剖析——innodb引擎
My sql 5.6新特性深入剖析——innodb引擎My sql 5.6新特性深入剖析——innodb引擎
My sql 5.6新特性深入剖析——innodb引擎
 
Nosql三步曲
Nosql三步曲Nosql三步曲
Nosql三步曲
 
MySQL运维那些事
MySQL运维那些事MySQL运维那些事
MySQL运维那些事
 
111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql111030 gztechparty-小路-云时代的mysql
111030 gztechparty-小路-云时代的mysql
 
Itpub电子杂志第四期第二稿
Itpub电子杂志第四期第二稿Itpub电子杂志第四期第二稿
Itpub电子杂志第四期第二稿
 
Google LevelDB Study Discuss
Google LevelDB Study DiscussGoogle LevelDB Study Discuss
Google LevelDB Study Discuss
 
Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)Mvcc (oracle, innodb, postgres)
Mvcc (oracle, innodb, postgres)
 
企業導入微服務實戰 - updated
企業導入微服務實戰 - updated企業導入微服務實戰 - updated
企業導入微服務實戰 - updated
 
基于 lucene 的站内搜索
基于 lucene 的站内搜索基于 lucene 的站内搜索
基于 lucene 的站内搜索
 
设计高性能mysql应用-TechClub技术沙龙
设计高性能mysql应用-TechClub技术沙龙设计高性能mysql应用-TechClub技术沙龙
设计高性能mysql应用-TechClub技术沙龙
 
Golang 高性能实战
Golang 高性能实战Golang 高性能实战
Golang 高性能实战
 
COSCUP 2019 - 開源大數據引擎 Greenplum
COSCUP 2019 - 開源大數據引擎 GreenplumCOSCUP 2019 - 開源大數據引擎 Greenplum
COSCUP 2019 - 開源大數據引擎 Greenplum
 
Exadata那点事
Exadata那点事Exadata那点事
Exadata那点事
 
廣宣學堂: 企業導入微服務實戰
廣宣學堂: 企業導入微服務實戰廣宣學堂: 企業導入微服務實戰
廣宣學堂: 企業導入微服務實戰
 
企業導入微服務實戰 - updated
企業導入微服務實戰 - updated企業導入微服務實戰 - updated
企業導入微服務實戰 - updated
 
改善Programmer生活的sql技能
改善Programmer生活的sql技能改善Programmer生活的sql技能
改善Programmer生活的sql技能
 
新浪微博平台与安全架构
新浪微博平台与安全架构新浪微博平台与安全架构
新浪微博平台与安全架构
 
数据架构方面的一些探讨
数据架构方面的一些探讨数据架构方面的一些探讨
数据架构方面的一些探讨
 
MySQL5.6新功能
MySQL5.6新功能MySQL5.6新功能
MySQL5.6新功能
 

Scylladb 3.0 new

  • 1. Scylladb 3.0 New Chen Shi 2019/1/23
  • 2. Agenda • Hinted Handoff • Allow Filtering support • Streaming improvements • Materialized Views • Global Secondary Indexes • Full, Multi-partition scan improvements • New sstable format
  • 3. Hinted Handoff • 原因 • 很高的写负载 • 网络故障 • 硬件故障 • 好处 • 降低在节点故障期间造成的数据不一致的影响 • 降低repair工作量 • 降低read-repair时,checksum不一致的概率
  • 4. Allow filtering CREATE TABLE blogs (blogId int, time1 int, time2 int, author text, content text, PRIMARY KEY(blogId, time1, time2)); SELECT * FROM blogs WHERE time1 = 1418306451235; SELECT * FROM blogs WHERE author = ‘Jonathan Ellis’; Ok if author column is indexed SELECT * FROM blogs WHERE author=’Jonathan Ellis’ and time2 = 1418306451235; filtering is needed even author and time2 column are indexed DONOT always use allow filtering for your problem ! 为了保持对cassandra和spark-Cassandra connector的兼容,以及对老数据集灵活查询的支持
  • 6. Materialized Views • 一个存储某种查询的结果的表 (base table -> view table, denormalization) • 不能直接对其更新,但更新base table会异步更新它 • 二级索引建立在其上 Scylla Summit 2017- Distributed Materialized Views
  • 7. Global Secondary Indexes • Cassandra 二级索引 (local indexes) • 数据在哪,索引就在哪 • 写很快,但读可能要查询其它节点;且不具备扩展性 • Scylla global indexing CREATE TABLE ks.users ( userid uuid, name text, email text, country text, PRIMARY KEY (userid) ); CREATE INDEX ON ks.users (email); CREATE MATERIALIZED VIEW ks.users_email_idx_index AS SELECT email, userid FROM ks.users WHERE email IS NOT NULL PRIMARY KEY (email, userid) WITH CLUSTERING ORDER BY (userid ASC); 选用二级索引还是MV取决于应用
  • 8. Full, Multi-partition scan improvements • 一种控制算法,提高range query性能 • 算法本身使用了缓冲和预读,以防止读被中止 • 好处 • 提高了系统响应 • 减少了disk read,range scan性能提高
  • 9. New sstable format • 兼容Cassandra 3.x sstables • 比Scylla 老版本快
  • 10. Reference • Scylla blog: 3.0 Overview • 3.0 Release Notes • Scylla doc: Hinted handoff • Cassandra blog: Allow filtering • Scylla blog: secondary index & Cassandra blog: native secondary index

Editor's Notes

  1. 2.x是试验性特性,3.0中production-ready
  2. 有多种方案,比如改变data model,增加索引、增加一张表
  3. base table 与view table的一致性问题 更新如何被propagated ? view table 如何保持写负载均衡?
  4. 若只查询特定的一些列,用MV,若查询不同的列,用GSI,因为索引可动态地添加、删除、且存储开销小
  5. 具体细节不太清楚