SlideShare a Scribd company logo
1 of 12
Download to read offline
Small Overview of Skype
    Database Tools
          Asko Oja
Skype Databases
   Skype is communications company that provides calling and chatting services over
    internet. Thanks to the fact that a lot of activity goes on in p2p network not
    everything that user does hits databases.
   We have used PostgreSQL from the beginning for all our OLTP databases.
   Over 100 database servers and 200 databases
   Largest OLTP table has several billions of records.
   Over 10,000 transactions per second.
   Databases are used mainly for web store, billing and other centrally provided
    services.
   All access through stored procedures.
Layers of Databases

Online databases      proxydb          proxydb
                                                         pgBouncer
● Proxy db's
                     pgBouncer        pgBouncer

● pgBouncers


● OLTP db's


● read only db's    onlinedb_p01     onlinedb_p01          shopdb           shopdb_ro
                      SkyTools         SkyTools           SkyTools           SkyTools



Support databases
● Queue db's
                                       queuedb
                                       SkyTools
● Datamining


● Batchjobs


● Backoffice


● Greenplum
                                 batchdb          analysisdb         backofficedb
pgBouncer – PostgreSQL Connection pooler
   pgBouncer is lightweight and robust
    connection pooler for PostgreSQL.            FrontEnd          WebServer
   Reduces thousands of incoming connections
    to only tens of connections in database.
   Low number of connections is important
    because each connection uses computer
    resources and each new connection is quite              pgBouncer
    expensive as prepared plans have to be
    created each time from scratch.
   We are not using pgBouncer for load                       userdb
    balancing.
   Can be used to redirect database calls
    (database aliases).
plProxy: Remote Call Language
    PL/Proxy is compact language for remote calls
     between PostgreSQL databases.
    With PL/Proxy user can create proxy functions that
     have same signature as remote functions to be called.
                                                             userdb
     The function body describes how the remote
     connection should be acquired.
    plProxy adds very little overhead when used together
     with pgBouncer.
    On the other hand plProxy adds complexity to                userdb_ro
     development and maintenance so it must be used with
     care but that is true for most everything.

CREATE FUNCTION get_user_email(username text) RETURNS text AS $$
    CONNECT 'dbname=shopdb_ro';
$$ LANGUAGE plproxy;
plProxy: Horizontal Partitioning
   We have partitioned most of our database by username using PostgreSQL hashtext
    function to get equal distribution between partitions.
   When splitting databases we usually prepare new partitions in other servers and
    then switch all traffic at once to keep our life simple.
   As proxy databases are stateless we can have several exact duplicates for load
    balancing and high availability.


                                                   userdb    userdb




                                      userdb_p0   userdb_p1 userdb_p2   userdb_p3
SkyTools: Package of Database Tools
   Contain most everything we have found useful in our
    everyday work with databases and PostgreSQL.
   PgQ that adds event queues to PostgreSQL.                              database
   Londiste replication.
   Walmgr for wal based log shipping.
   DBScript framework which provide database
    connectivity, logging, stats management, encoding,
    decoding etc for batch jobs. Developers need only to                          batch
                                                                database           job
    take care of business logic in batch jobs all the rest is
    handled by batch jobs.
   SkyTools contains tens of reusable generic scripts for
    doing various data related tasks.
                                                                     database
PgQ: PostgreSQL Queueing Implementation
   PgQ is PostgreSQL based event processing system. It is part of SkyTools package
    that contains several useful tools built on it.
   Producers - applications that write events into queue. Producer can be written in
    any language that is able to run stored procedures in PostgreSQL.
   Consumers - applications that read events from queue. Consumers can be written
    in any language that can interact with PostgreSQL.

                                                                        java
        python                                                        consumer
       producer
                                      Database
                                 sql trigger or                          php
         c++:                     function call                       consumer
       producer
                                     function:                          c++
          php:                   pgq.create_event                    consumer
        producer
                                                                      python:
                                                                     consumer
          java:
        producer                              queue
PgQ: PostgreSQL Queuing
   Transactional. Event insertion is committed or rolled back       onlinedb
                                                                     SkyTools
    together with the other things that transaction changes.
   Efficient. Usually database based queue implementations
    are not efficient but we managed to solve it because
    PostgreSQL makes transaction state visible to users.                  queuedb
   Fast. Events are processed in batches which gives low per             SkyTools
    event overhead.
   Flexible. Each queue can have several producers and
    consumers and any number of event types handled in it.
   Robust. PgQ guarantees that each consumers sees event                 batchdb
    at least once. There several methods how the processed
    events can be tracked depending on business needs.
   Ideally suited for all kinds of batch processing.
                                                                 batch
                                                                  job
PgQ: Use cases
   Batch jobs. PgQ is very convenient media for providing events for background
    processing.
      email senders
      sms sender
      external partners communication handling (payment handling)
   Moving data out of online databases into internal databases (logs, detail records).
   Replication. Copying data between databases.
   Partitioning data into daily batches for business intelligence.
Londiste: Replication
   We use replication
       to transfer online data into internal databases
       to create failover databases for online databases.
       to switch between PostgreSQL versions
       to distribute internally produced data into online servers
       to create read only replicas for load balancing
   Londiste is implemented using PgQ as transport layer.
                                                                       shopdb
   It has DBA friendly command line interface.                        (online)




                                        shopdb_ro          shopdb          analysisdb
                                        (read only)       (failover)        (internal)
Summary
   We have managed to create a beautiful mess of vertically and horizontally split
    databases that are connected by hundreds of replication processes and remote
    calls.
   But all this mess is still quite easy to manage and we see no architectural limits for
    Skype to grow some more magnitudes except need for better management tools.
   No license fees..

More Related Content

What's hot

What's hot (20)

Open source Technology
Open source TechnologyOpen source Technology
Open source Technology
 
In memory databases presentation
In memory databases presentationIn memory databases presentation
In memory databases presentation
 
MongoDB - An Introduction
MongoDB - An IntroductionMongoDB - An Introduction
MongoDB - An Introduction
 
MongoDB
MongoDBMongoDB
MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
CouchDB
CouchDBCouchDB
CouchDB
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
In-Memory DataBase
In-Memory DataBaseIn-Memory DataBase
In-Memory DataBase
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
No SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability MeetupNo SQL and MongoDB - Hyderabad Scalability Meetup
No SQL and MongoDB - Hyderabad Scalability Meetup
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
Couch db
Couch dbCouch db
Couch db
 
Mongo db report
Mongo db reportMongo db report
Mongo db report
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JS
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
 
Couch db
Couch dbCouch db
Couch db
 
NoSql
NoSqlNoSql
NoSql
 

Similar to Small Overview of Skype Database Tools

Database Tools by Skype
Database Tools by SkypeDatabase Tools by Skype
Database Tools by Skypeelliando dias
 
Asko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadAsko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadOntico
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture HighloadOntico
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerelliando dias
 
Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Corneil du Plessis
 
Lunar Way and the Cloud Native "stack"
Lunar Way and the Cloud Native "stack"Lunar Way and the Cloud Native "stack"
Lunar Way and the Cloud Native "stack"Kasper Nissen
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Md. Sadhan Sarker
 
Replication - Nick Carboni - ManageIQ Design Summit 2016
Replication - Nick Carboni - ManageIQ Design Summit 2016Replication - Nick Carboni - ManageIQ Design Summit 2016
Replication - Nick Carboni - ManageIQ Design Summit 2016ManageIQ
 
20181116 Massive Log Processing using I/O optimized PostgreSQL
20181116 Massive Log Processing using I/O optimized PostgreSQL20181116 Massive Log Processing using I/O optimized PostgreSQL
20181116 Massive Log Processing using I/O optimized PostgreSQLKohei KaiGai
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsGavin Roy
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kuberneteskloia
 
CCT (Check and Calculate Transfer)
CCT (Check and Calculate Transfer)CCT (Check and Calculate Transfer)
CCT (Check and Calculate Transfer)Francesca Pappalardo
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Pulsar summit asia 2021   apache pulsar with mqtt for edge computingPulsar summit asia 2021   apache pulsar with mqtt for edge computing
Pulsar summit asia 2021 apache pulsar with mqtt for edge computingTimothy Spann
 
Introduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationIntroduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationKnoldus Inc.
 
Introduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationIntroduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationKnoldus Inc.
 
Meiga Guadec 2009 English
Meiga Guadec 2009 EnglishMeiga Guadec 2009 English
Meiga Guadec 2009 Englisheocanha
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 

Similar to Small Overview of Skype Database Tools (20)

Database Tools by Skype
Database Tools by SkypeDatabase Tools by Skype
Database Tools by Skype
 
Asko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadAsko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture Highload
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture Highload
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
 
Sweet Streams (Are made of this)
Sweet Streams (Are made of this)Sweet Streams (Are made of this)
Sweet Streams (Are made of this)
 
Lunar Way and the Cloud Native "stack"
Lunar Way and the Cloud Native "stack"Lunar Way and the Cloud Native "stack"
Lunar Way and the Cloud Native "stack"
 
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
Up and Running with gRPC & Cloud Career [GDG-Cloud-Dhaka-IO/2022}
 
Replication - Nick Carboni - ManageIQ Design Summit 2016
Replication - Nick Carboni - ManageIQ Design Summit 2016Replication - Nick Carboni - ManageIQ Design Summit 2016
Replication - Nick Carboni - ManageIQ Design Summit 2016
 
20181116 Massive Log Processing using I/O optimized PostgreSQL
20181116 Massive Log Processing using I/O optimized PostgreSQL20181116 Massive Log Processing using I/O optimized PostgreSQL
20181116 Massive Log Processing using I/O optimized PostgreSQL
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
CCT (Check and Calculate Transfer)
CCT (Check and Calculate Transfer)CCT (Check and Calculate Transfer)
CCT (Check and Calculate Transfer)
 
Presentation CCT
Presentation CCTPresentation CCT
Presentation CCT
 
CCT Check and Calculate Transfer
CCT Check and Calculate TransferCCT Check and Calculate Transfer
CCT Check and Calculate Transfer
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Pulsar summit asia 2021   apache pulsar with mqtt for edge computingPulsar summit asia 2021   apache pulsar with mqtt for edge computing
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
 
Prestogres internals
Prestogres internalsPrestogres internals
Prestogres internals
 
Introduction to GCP Data Flow Presentation
Introduction to GCP Data Flow PresentationIntroduction to GCP Data Flow Presentation
Introduction to GCP Data Flow Presentation
 
Introduction to GCP DataFlow Presentation
Introduction to GCP DataFlow PresentationIntroduction to GCP DataFlow Presentation
Introduction to GCP DataFlow Presentation
 
Meiga Guadec 2009 English
Meiga Guadec 2009 EnglishMeiga Guadec 2009 English
Meiga Guadec 2009 English
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 

More from elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

Small Overview of Skype Database Tools

  • 1. Small Overview of Skype Database Tools Asko Oja
  • 2. Skype Databases  Skype is communications company that provides calling and chatting services over internet. Thanks to the fact that a lot of activity goes on in p2p network not everything that user does hits databases.  We have used PostgreSQL from the beginning for all our OLTP databases.  Over 100 database servers and 200 databases  Largest OLTP table has several billions of records.  Over 10,000 transactions per second.  Databases are used mainly for web store, billing and other centrally provided services.  All access through stored procedures.
  • 3. Layers of Databases Online databases proxydb proxydb pgBouncer ● Proxy db's pgBouncer pgBouncer ● pgBouncers ● OLTP db's ● read only db's onlinedb_p01 onlinedb_p01 shopdb shopdb_ro SkyTools SkyTools SkyTools SkyTools Support databases ● Queue db's queuedb SkyTools ● Datamining ● Batchjobs ● Backoffice ● Greenplum batchdb analysisdb backofficedb
  • 4. pgBouncer – PostgreSQL Connection pooler  pgBouncer is lightweight and robust connection pooler for PostgreSQL. FrontEnd WebServer  Reduces thousands of incoming connections to only tens of connections in database.  Low number of connections is important because each connection uses computer resources and each new connection is quite pgBouncer expensive as prepared plans have to be created each time from scratch.  We are not using pgBouncer for load userdb balancing.  Can be used to redirect database calls (database aliases).
  • 5. plProxy: Remote Call Language  PL/Proxy is compact language for remote calls between PostgreSQL databases.  With PL/Proxy user can create proxy functions that have same signature as remote functions to be called. userdb The function body describes how the remote connection should be acquired.  plProxy adds very little overhead when used together with pgBouncer.  On the other hand plProxy adds complexity to userdb_ro development and maintenance so it must be used with care but that is true for most everything. CREATE FUNCTION get_user_email(username text) RETURNS text AS $$ CONNECT 'dbname=shopdb_ro'; $$ LANGUAGE plproxy;
  • 6. plProxy: Horizontal Partitioning  We have partitioned most of our database by username using PostgreSQL hashtext function to get equal distribution between partitions.  When splitting databases we usually prepare new partitions in other servers and then switch all traffic at once to keep our life simple.  As proxy databases are stateless we can have several exact duplicates for load balancing and high availability. userdb userdb userdb_p0 userdb_p1 userdb_p2 userdb_p3
  • 7. SkyTools: Package of Database Tools  Contain most everything we have found useful in our everyday work with databases and PostgreSQL.  PgQ that adds event queues to PostgreSQL. database  Londiste replication.  Walmgr for wal based log shipping.  DBScript framework which provide database connectivity, logging, stats management, encoding, decoding etc for batch jobs. Developers need only to batch database job take care of business logic in batch jobs all the rest is handled by batch jobs.  SkyTools contains tens of reusable generic scripts for doing various data related tasks. database
  • 8. PgQ: PostgreSQL Queueing Implementation  PgQ is PostgreSQL based event processing system. It is part of SkyTools package that contains several useful tools built on it.  Producers - applications that write events into queue. Producer can be written in any language that is able to run stored procedures in PostgreSQL.  Consumers - applications that read events from queue. Consumers can be written in any language that can interact with PostgreSQL. java python consumer producer Database sql trigger or php c++: function call consumer producer function: c++ php: pgq.create_event consumer producer python: consumer java: producer queue
  • 9. PgQ: PostgreSQL Queuing  Transactional. Event insertion is committed or rolled back onlinedb SkyTools together with the other things that transaction changes.  Efficient. Usually database based queue implementations are not efficient but we managed to solve it because PostgreSQL makes transaction state visible to users. queuedb  Fast. Events are processed in batches which gives low per SkyTools event overhead.  Flexible. Each queue can have several producers and consumers and any number of event types handled in it.  Robust. PgQ guarantees that each consumers sees event batchdb at least once. There several methods how the processed events can be tracked depending on business needs.  Ideally suited for all kinds of batch processing. batch job
  • 10. PgQ: Use cases  Batch jobs. PgQ is very convenient media for providing events for background processing.  email senders  sms sender  external partners communication handling (payment handling)  Moving data out of online databases into internal databases (logs, detail records).  Replication. Copying data between databases.  Partitioning data into daily batches for business intelligence.
  • 11. Londiste: Replication  We use replication  to transfer online data into internal databases  to create failover databases for online databases.  to switch between PostgreSQL versions  to distribute internally produced data into online servers  to create read only replicas for load balancing  Londiste is implemented using PgQ as transport layer. shopdb  It has DBA friendly command line interface. (online) shopdb_ro shopdb analysisdb (read only) (failover) (internal)
  • 12. Summary  We have managed to create a beautiful mess of vertically and horizontally split databases that are connected by hundreds of replication processes and remote calls.  But all this mess is still quite easy to manage and we see no architectural limits for Skype to grow some more magnitudes except need for better management tools.  No license fees..