SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
Architecting petabyte-scale analytics by
scaling out Postgres on Azure with Citus
Alicja Kucharczyk
EMEA Global Blackbelt OSS Data Tech Specialist
DevOps Meetup Zürich, 2020-03-04
Nothing
Compares To
VACUUM/The
Ballad of Bloat
The naming
thing
Hyperscale
(Citus)
Hyperscale (Citus)
• Open source extension
• Pure Postgres, not a fork
• Turns Postgres into distributed, sharded database
• All the benefits of Postgres, without worry about
scale
Hyperscale (Citus)
• Open source extension
• Pure Postgres, not a fork
• Turns Postgres into distributed, sharded database
• All the benefits of Postgres, without worry about
scale
Why Microsoft
likes Hyperscale
(Citus)?
How do you know if the next update
to your software is ready for
hundreds of millions of customers?
Internal RQV analytics dashboard
RQV analytics dashboard is a critical tool
for Windows engineers, program managers,
and execs.
The short story
Min Wei, Principal Engineer at
Microsoft
discovered the open source Citus
extension to Postgres by listening
to a recorded conference talk on
his drive home
Impressed with the early results,
he transitioned the project from a
proof of concept into an official
project.
A few months later Microsoft had
acquired Citus Data.
Measuring
the quality of
Windows
“Release Quality View” (RQV) dashboard
tracks 20,000 diagnostic and quality metrics
over 800M unique devices monthly
supports over 6 million queries per day
hundreds of concurrent users
1000s of monthly active users
100s of dashboard pages
Production
database
cluster
2816 Cores, 18TB DRAM,
1PB Azure Premium Storage,
Multi-PB Azure Blob Storage - for the staging
queue and raw Windows event data
• 2 Physical clusters behind a query router (Azure
Web Service and Azure Redis Service)
• Ingest and delete ~5TB data per day
• P75 query latency ~90ms/200ms (response times
for 75 percent of queries are less than 200
milliseconds)
• Support long running queries up to 4 mins.
• Support batch scheduled jobs that can run up for
2hours
Run Anywhere
On-Premises
In the Cloud - Azure
Database for
PostgreSQL
M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY
Azure Database for PostgreSQL is available in
two deployment options
Single Server
Fully-managed, single-nodePostgreSQL
Example use cases
• Apps with JSON, geospatial support, or full-text search
• Transactional and operational analytics workloads
• Cloud-native apps built with modern frameworks
Hyperscale (Citus)
High-performancePostgres for scale out
Example use cases
• Scaling PostgreSQL multi-tenant, SaaS apps
• Real-time operational analytics
• Building high throughput transactional apps
Enterprise-ready,fully
managed community
PostgreSQL with built-in HA
and multi-layered security
We’re talking about
Hyperscale (Citus)
today
Shardyour Postgres database across multiple nodes
to give your application more memory, compute,
and disk storage
Easilyadd worker nodes to achieve horizontalscale
Scale up to 100s of nodes
Scale horizontally across hundreds of cores with Hyperscale (Citus)
Select from table Coordinator
Table metadata
Select from table_1001
Select from table_1003
Select from table_1002
Select from table_1004
Data node N
Data node 2
Data node 1
Table_1001
Table_1003
Table_1002
Table_1004
Each node PostgreSQL with Citus installed
1 shard = 1 PostgreSQL table
Sharding data across multiple nodes
Terminology
Coordinator – Stores Metadata. Node which application connects to.
Worker / Data nodes – Nodes which store data in form of shards.
Sharding – Process of dividing data among nodes.
Shards – A partition of the data containing a subset of rows.
Co-location
Co-location based on data-type of the distribution column. Not the name of the
column.
Co-location handles
Joins
Foreign keys/ Primary keys
Rollups
Others in future slides…
Co-located join
• APPLICATION
SELECT
FROM
WHERE
AND
count(*)
ads JOIN campaigns ON
ads.company_id = campaigns.company_id
ads.designer_name = ‘Isaac’
campaigns.company_id = ‘Elly Co’ ;
METADATA
COORDINATOR NODE
WORKER NODES
W1
W2
W3 … Wn
SELECT…
FROM
ads_1001,
campaigns_2001
…
It’s logical to place shards containing related rows of related tables together on the same nodes
Join queries between related rows can reduce the amount of data sent over the network
Effectively manage
data scale out
Shard rebalancer redistributes shards across
old and new worker nodes for balanced data
scale out without any downtime.
Shard rebalancer will recommend rebalance
when shards can be placed more evenly
For more control, use tenant isolation to easily
allocate dedicated to specific tenants with
greater needs
APPLICATION
BEGIN;
UPDATE
SET
WHERE
UPDATE
SET
WHERE
COMMIT;
campaigns
feedback = ‘relevance’
company_type = ‘platinum’ ;
ads
feedback = ‘relevance’
company_type = ‘platinum’ ;
METADATA
COORDINATOR NODE
W1
W2
W3 … Wn
BEGIN …
assign_Scaled-out_
transaction_id…
UPDATE campaigns_2009
…
COMMITPREPARED …
BEGIN …
assign_Scaled-out_
transaction_id…
UPDATE campaigns_2001
…
COMMITPREPARED …
BEGIN …
assign_Scaled-out_
transaction_id…
UPDATE campaigns_2017
…
COMMITPREPARED …
Scaled-out transaction
Hyperscale (Citus) leverages built-in 2PC protocol to prepare transactions via a
coordinator node
Once worker nodes commit to transactions, release their locks, and send
acknowledgements, the coordinator node completes the scaled-out transaction
WORKER NODES
Table Classification
3 Table Types
• Distributed Tables
• Reference Tables
• Local Tables
Distributed Tables
Definition:
• Tables that are sharded.
Classification:
• Large tables (>10GB) – shard on same key (may require addition of shard key)
• All tables are be co-located
• Enables localized and fast joins on workers
• Ex: transactions, events etc
SELECT create_distributed_table(table_name, column_name);
Definition:
• Replicated to all the nodes (extra latency)
Classification:
• Small tables < 10GB
• Efficient joins with distributed tables
• Cannot have sharding dimension
• Ex: countries, categories
SELECT create_reference_table(table_name);
Reference Tables
• Plain Postgres tables on the coordinator node.
• Admin Tables that don’t interact with main tables
• Separate micro-service that doesn’t need sharding
Local Tables
M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY
Hyperscale (Citus): Customer view
Application
PostgreSQL
client
Coordinator
w/ public IP
Worker node 0,
no public IP
Worker node 1,
no public IP
Server group
M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY
Hyperscale (Citus): High availability
Application
PostgreSQL
client
Coordinator
w/ public IP
Worker node 0,
no public IP
Worker node 1,
no public IP
AZ[0]
Coordinator’s
standby
Worker node 0’s
standby
Worker node 1’s
standby
AZ[1]
Postgres sync replication
Postgres sync replication
Postgres sync replication
M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY
Features: High availability (HA)
 Standby nodes for each primary node in Hyperscale (Citus)
 Standby nodes are created in another AZ selected by service
 Synchronous Postgres replication
 Transparent for apps: Same connection string after failover
 Detection, failover, new standby creation
 Detection: Up to 150 seconds (five 30 sec probes)
 Failover: Up to 90 seconds
 Total downtime: Up to 240 seconds
 New standby creation: Up to 1 hour
M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY
Backup and restore
 Fully automated backup
 Enabled on each node
 Stored for 35 days
 Deleted server
 Backup is taken as a part of dropping the server and only this last backup is preserved
 Restore
 Can restore to a date stamp with 5-minute increment
 Need to open a support ticket to request PITR
Want to learn more?
http://tiny.cc/80lljz - Hyperscale
http://tiny.cc/n2lljz - ora2pg
Warsaw
Prague
Stuttgart
Geneva
Munich
Cologne
Paris
London
Amsterdam
Madrid
Oslo
Milan
Rome
Istanbul
Thank you!

Más contenido relacionado

La actualidad más candente

The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
Morgan Tocker
 

La actualidad más candente (20)

Distributing Queries the Citus Way | PostgresConf US 2018 | Marco Slot
Distributing Queries the Citus Way | PostgresConf US 2018 | Marco SlotDistributing Queries the Citus Way | PostgresConf US 2018 | Marco Slot
Distributing Queries the Citus Way | PostgresConf US 2018 | Marco Slot
 
JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0JSON improvements in MySQL 8.0
JSON improvements in MySQL 8.0
 
Presto Summit 2018 - 09 - Netflix Iceberg
Presto Summit 2018  - 09 - Netflix IcebergPresto Summit 2018  - 09 - Netflix Iceberg
Presto Summit 2018 - 09 - Netflix Iceberg
 
Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0Upgrade from MySQL 5.7 to MySQL 8.0
Upgrade from MySQL 5.7 to MySQL 8.0
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
MySQL Performance Tuning: Top 10 Tips
MySQL Performance Tuning: Top 10 TipsMySQL Performance Tuning: Top 10 Tips
MySQL Performance Tuning: Top 10 Tips
 
MySQL Timeout Variables Explained
MySQL Timeout Variables Explained MySQL Timeout Variables Explained
MySQL Timeout Variables Explained
 
Row Pattern Matching in SQL:2016
Row Pattern Matching in SQL:2016Row Pattern Matching in SQL:2016
Row Pattern Matching in SQL:2016
 
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
Deep Dive on Amazon Aurora MySQL Performance Tuning (DAT429-R1) - AWS re:Inve...
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Parallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDBParallel Replication in MySQL and MariaDB
Parallel Replication in MySQL and MariaDB
 
ClickHouse Intro
ClickHouse IntroClickHouse Intro
ClickHouse Intro
 
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
 
Patroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easyPatroni - HA PostgreSQL made easy
Patroni - HA PostgreSQL made easy
 
Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우
 
Introduction to Kafka Cruise Control
Introduction to Kafka Cruise ControlIntroduction to Kafka Cruise Control
Introduction to Kafka Cruise Control
 
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -
[AKIBA.AWS] EC2の基礎 - パフォーマンスを100%引き出すオプション設定 -
 
Scylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla OperatorScylla on Kubernetes: Introducing the Scylla Operator
Scylla on Kubernetes: Introducing the Scylla Operator
 
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and OrchestratorAlmost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
Almost Perfect Service Discovery and Failover with ProxySQL and Orchestrator
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 

Similar a Architecting peta-byte-scale analytics by scaling out Postgres on Azure with CItus | Devops Meetup Zurich | Alicja Kucharczyk

MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
MongoDB
 
DS_2016_StreamAnalytix_real_time_streaming_analytics_platform
DS_2016_StreamAnalytix_real_time_streaming_analytics_platformDS_2016_StreamAnalytix_real_time_streaming_analytics_platform
DS_2016_StreamAnalytix_real_time_streaming_analytics_platform
Aditya Singh
 

Similar a Architecting peta-byte-scale analytics by scaling out Postgres on Azure with CItus | Devops Meetup Zurich | Alicja Kucharczyk (20)

Azure Data Explorer deep dive - review 04.2020
Azure Data Explorer deep dive - review 04.2020Azure Data Explorer deep dive - review 04.2020
Azure Data Explorer deep dive - review 04.2020
 
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
DCEU 18: From Legacy Mainframe to the Cloud: The Finnish Railways Evolution w...
 
Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services Introduction to Cloud Computing with Amazon Web Services
Introduction to Cloud Computing with Amazon Web Services
 
AWS Cloud for HPC and Big Data
AWS Cloud for HPC and Big DataAWS Cloud for HPC and Big Data
AWS Cloud for HPC and Big Data
 
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
Scaling Security on 100s of Millions of Mobile Devices Using Apache Kafka® an...
 
MongoDB 4.0 새로운 기능 소개
MongoDB 4.0 새로운 기능 소개MongoDB 4.0 새로운 기능 소개
MongoDB 4.0 새로운 기능 소개
 
inmation Presentation
inmation Presentationinmation Presentation
inmation Presentation
 
HIPAS UCP HSP Openstack Sascha Oehl
HIPAS UCP HSP Openstack Sascha OehlHIPAS UCP HSP Openstack Sascha Oehl
HIPAS UCP HSP Openstack Sascha Oehl
 
1 Introduction to Microsoft data platform analytics for release
1 Introduction to Microsoft data platform analytics for release1 Introduction to Microsoft data platform analytics for release
1 Introduction to Microsoft data platform analytics for release
 
Azure Databases for PostgreSQL, MySQL and MariaDB
Azure Databases for PostgreSQL, MySQL and MariaDBAzure Databases for PostgreSQL, MySQL and MariaDB
Azure Databases for PostgreSQL, MySQL and MariaDB
 
Microsoft Azure
Microsoft AzureMicrosoft Azure
Microsoft Azure
 
Keynote sp summit 2014 final
Keynote sp summit 2014  finalKeynote sp summit 2014  final
Keynote sp summit 2014 final
 
Azure SQL DB Managed Instances Built to easily modernize application data layer
Azure SQL DB Managed Instances Built to easily modernize application data layerAzure SQL DB Managed Instances Built to easily modernize application data layer
Azure SQL DB Managed Instances Built to easily modernize application data layer
 
MongoDB and the Internet of Things
MongoDB and the Internet of ThingsMongoDB and the Internet of Things
MongoDB and the Internet of Things
 
AWS Summit Atlanta Keynote
AWS Summit Atlanta KeynoteAWS Summit Atlanta Keynote
AWS Summit Atlanta Keynote
 
Red hat's updates on the cloud & infrastructure strategy
Red hat's updates on the cloud & infrastructure strategyRed hat's updates on the cloud & infrastructure strategy
Red hat's updates on the cloud & infrastructure strategy
 
Managing and Deploying High Performance Computing Clusters using Windows HPC ...
Managing and Deploying High Performance Computing Clusters using Windows HPC ...Managing and Deploying High Performance Computing Clusters using Windows HPC ...
Managing and Deploying High Performance Computing Clusters using Windows HPC ...
 
AWS Summit Berlin 2013 - Big Data Analytics
AWS Summit Berlin 2013 - Big Data AnalyticsAWS Summit Berlin 2013 - Big Data Analytics
AWS Summit Berlin 2013 - Big Data Analytics
 
DS_2016_StreamAnalytix_real_time_streaming_analytics_platform
DS_2016_StreamAnalytix_real_time_streaming_analytics_platformDS_2016_StreamAnalytix_real_time_streaming_analytics_platform
DS_2016_StreamAnalytix_real_time_streaming_analytics_platform
 
Peek into Neo4j Product Strategy and Roadmap
Peek into Neo4j Product Strategy and RoadmapPeek into Neo4j Product Strategy and Roadmap
Peek into Neo4j Product Strategy and Roadmap
 

Más de Citus Data

Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Citus Data
 

Más de Citus Data (20)

Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
Data Modeling, Normalization, and De-Normalization | PostgresOpen 2019 | Dimi...
 
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
JSONB Tricks: Operators, Indexes, and When (Not) to Use It | PostgresOpen 201...
 
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
Tutorial: Implementing your first Postgres extension | PGConf EU 2019 | Burak...
 
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig KerstiensWhats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
Whats wrong with postgres | PGConf EU 2019 | Craig Kerstiens
 
When it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will LeinweberWhen it all goes wrong | PGConf EU 2019 | Will Leinweber
When it all goes wrong | PGConf EU 2019 | Will Leinweber
 
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise GrandjoncAmazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
Amazing SQL your ORM can (or can't) do | PGConf EU 2019 | Louise Grandjonc
 
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
What Microsoft is doing with Postgres & the Citus Data acquisition | PGConf E...
 
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff DavisDeep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
Deep Postgres Extensions in Rust | PGCon 2019 | Jeff Davis
 
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
Why Postgres Why This Database Why Now | SF Bay Area Postgres Meetup | Claire...
 
A story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise GrandjoncA story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
A story on Postgres index types | PostgresLondon 2019 | Louise Grandjonc
 
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
Why developers need marketing now more than ever | GlueCon 2019 | Claire Gior...
 
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine | Dimitri Fontaine
 
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
Optimizing your app by understanding your Postgres | RailsConf 2019 | Samay S...
 
When it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will LeinweberWhen it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
When it all goes wrong (with Postgres) | RailsConf 2019 | Will Leinweber
 
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri FontaineThe Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
The Art of PostgreSQL | PostgreSQL Ukraine Meetup | Dimitri Fontaine
 
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
Using Postgres and Citus for Lightning Fast Analytics, also ft. Rollups | Liv...
 
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineHow to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
 
When it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will LeinweberWhen it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
When it all Goes Wrong |Nordic PGDay 2019 | Will Leinweber
 
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire GiordanoWhy PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
Why PostgreSQL Why This Database Why Now | Nordic PGDay 2019 | Claire Giordano
 
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
Scaling Multi-Tenant Applications Using the Django ORM & Postgres | PyCaribbe...
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Architecting peta-byte-scale analytics by scaling out Postgres on Azure with CItus | Devops Meetup Zurich | Alicja Kucharczyk

  • 1. Architecting petabyte-scale analytics by scaling out Postgres on Azure with Citus Alicja Kucharczyk EMEA Global Blackbelt OSS Data Tech Specialist DevOps Meetup Zürich, 2020-03-04
  • 4. Hyperscale (Citus) • Open source extension • Pure Postgres, not a fork • Turns Postgres into distributed, sharded database • All the benefits of Postgres, without worry about scale
  • 5. Hyperscale (Citus) • Open source extension • Pure Postgres, not a fork • Turns Postgres into distributed, sharded database • All the benefits of Postgres, without worry about scale
  • 7. How do you know if the next update to your software is ready for hundreds of millions of customers?
  • 9. RQV analytics dashboard is a critical tool for Windows engineers, program managers, and execs.
  • 10. The short story Min Wei, Principal Engineer at Microsoft discovered the open source Citus extension to Postgres by listening to a recorded conference talk on his drive home Impressed with the early results, he transitioned the project from a proof of concept into an official project. A few months later Microsoft had acquired Citus Data.
  • 11. Measuring the quality of Windows “Release Quality View” (RQV) dashboard tracks 20,000 diagnostic and quality metrics over 800M unique devices monthly supports over 6 million queries per day hundreds of concurrent users 1000s of monthly active users 100s of dashboard pages
  • 12. Production database cluster 2816 Cores, 18TB DRAM, 1PB Azure Premium Storage, Multi-PB Azure Blob Storage - for the staging queue and raw Windows event data • 2 Physical clusters behind a query router (Azure Web Service and Azure Redis Service) • Ingest and delete ~5TB data per day • P75 query latency ~90ms/200ms (response times for 75 percent of queries are less than 200 milliseconds) • Support long running queries up to 4 mins. • Support batch scheduled jobs that can run up for 2hours
  • 13. Run Anywhere On-Premises In the Cloud - Azure Database for PostgreSQL
  • 14. M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY Azure Database for PostgreSQL is available in two deployment options Single Server Fully-managed, single-nodePostgreSQL Example use cases • Apps with JSON, geospatial support, or full-text search • Transactional and operational analytics workloads • Cloud-native apps built with modern frameworks Hyperscale (Citus) High-performancePostgres for scale out Example use cases • Scaling PostgreSQL multi-tenant, SaaS apps • Real-time operational analytics • Building high throughput transactional apps Enterprise-ready,fully managed community PostgreSQL with built-in HA and multi-layered security We’re talking about Hyperscale (Citus) today
  • 15. Shardyour Postgres database across multiple nodes to give your application more memory, compute, and disk storage Easilyadd worker nodes to achieve horizontalscale Scale up to 100s of nodes Scale horizontally across hundreds of cores with Hyperscale (Citus) Select from table Coordinator Table metadata Select from table_1001 Select from table_1003 Select from table_1002 Select from table_1004 Data node N Data node 2 Data node 1 Table_1001 Table_1003 Table_1002 Table_1004 Each node PostgreSQL with Citus installed 1 shard = 1 PostgreSQL table Sharding data across multiple nodes
  • 16. Terminology Coordinator – Stores Metadata. Node which application connects to. Worker / Data nodes – Nodes which store data in form of shards. Sharding – Process of dividing data among nodes. Shards – A partition of the data containing a subset of rows.
  • 17. Co-location Co-location based on data-type of the distribution column. Not the name of the column.
  • 18. Co-location handles Joins Foreign keys/ Primary keys Rollups Others in future slides…
  • 19. Co-located join • APPLICATION SELECT FROM WHERE AND count(*) ads JOIN campaigns ON ads.company_id = campaigns.company_id ads.designer_name = ‘Isaac’ campaigns.company_id = ‘Elly Co’ ; METADATA COORDINATOR NODE WORKER NODES W1 W2 W3 … Wn SELECT… FROM ads_1001, campaigns_2001 … It’s logical to place shards containing related rows of related tables together on the same nodes Join queries between related rows can reduce the amount of data sent over the network
  • 20. Effectively manage data scale out Shard rebalancer redistributes shards across old and new worker nodes for balanced data scale out without any downtime. Shard rebalancer will recommend rebalance when shards can be placed more evenly For more control, use tenant isolation to easily allocate dedicated to specific tenants with greater needs
  • 21. APPLICATION BEGIN; UPDATE SET WHERE UPDATE SET WHERE COMMIT; campaigns feedback = ‘relevance’ company_type = ‘platinum’ ; ads feedback = ‘relevance’ company_type = ‘platinum’ ; METADATA COORDINATOR NODE W1 W2 W3 … Wn BEGIN … assign_Scaled-out_ transaction_id… UPDATE campaigns_2009 … COMMITPREPARED … BEGIN … assign_Scaled-out_ transaction_id… UPDATE campaigns_2001 … COMMITPREPARED … BEGIN … assign_Scaled-out_ transaction_id… UPDATE campaigns_2017 … COMMITPREPARED … Scaled-out transaction Hyperscale (Citus) leverages built-in 2PC protocol to prepare transactions via a coordinator node Once worker nodes commit to transactions, release their locks, and send acknowledgements, the coordinator node completes the scaled-out transaction WORKER NODES
  • 23. 3 Table Types • Distributed Tables • Reference Tables • Local Tables
  • 24. Distributed Tables Definition: • Tables that are sharded. Classification: • Large tables (>10GB) – shard on same key (may require addition of shard key) • All tables are be co-located • Enables localized and fast joins on workers • Ex: transactions, events etc SELECT create_distributed_table(table_name, column_name);
  • 25. Definition: • Replicated to all the nodes (extra latency) Classification: • Small tables < 10GB • Efficient joins with distributed tables • Cannot have sharding dimension • Ex: countries, categories SELECT create_reference_table(table_name); Reference Tables
  • 26. • Plain Postgres tables on the coordinator node. • Admin Tables that don’t interact with main tables • Separate micro-service that doesn’t need sharding Local Tables
  • 27. M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY Hyperscale (Citus): Customer view Application PostgreSQL client Coordinator w/ public IP Worker node 0, no public IP Worker node 1, no public IP Server group
  • 28. M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY Hyperscale (Citus): High availability Application PostgreSQL client Coordinator w/ public IP Worker node 0, no public IP Worker node 1, no public IP AZ[0] Coordinator’s standby Worker node 0’s standby Worker node 1’s standby AZ[1] Postgres sync replication Postgres sync replication Postgres sync replication
  • 29. M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY Features: High availability (HA)  Standby nodes for each primary node in Hyperscale (Citus)  Standby nodes are created in another AZ selected by service  Synchronous Postgres replication  Transparent for apps: Same connection string after failover  Detection, failover, new standby creation  Detection: Up to 150 seconds (five 30 sec probes)  Failover: Up to 90 seconds  Total downtime: Up to 240 seconds  New standby creation: Up to 1 hour
  • 30. M ICR O S O FT CO N FIDE N T IAL – IN T E R N AL O N LY Backup and restore  Fully automated backup  Enabled on each node  Stored for 35 days  Deleted server  Backup is taken as a part of dropping the server and only this last backup is preserved  Restore  Can restore to a date stamp with 5-minute increment  Need to open a support ticket to request PITR
  • 31. Want to learn more? http://tiny.cc/80lljz - Hyperscale http://tiny.cc/n2lljz - ora2pg Warsaw Prague Stuttgart Geneva Munich Cologne Paris London Amsterdam Madrid Oslo Milan Rome Istanbul