SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
plProxy, pgBouncer,
     pgBalancer
        Asko Oja
Vertical Split
   All database access through functions requirement from the start
   Moved out functionality into separate servers and databases as load increased.
   Slony for replication, plpython for remote calls.
   As number of databases grew we ran into problems
      Slony replication became unmanageable because of listen/notify architecture
         and locking.
   We started looking for alternatives that ended up creating SkyTools PgQ and
    Londiste.


                               userdb             userdb          analysisdb
              userdb
              shopdb


                               shopdb             shopdb          servicedb


                                                                          Time
Vertical Split Picture
Horizontal Split
   One server could not service one table anymore
   We did first split with plpython remote calls
   Replaced it with plProxy language but it had still several problems
      complex configuration database
      internal pooler and complex internal structure
      scaleability issues



                                                        userdb      userdb
                         userdb

    userdb

                  userdb_p0 userdb_p2
                                           userdb_p0   userdb_p1 userdb_p2   userdb_p3
                  userdb_p1 userdb_p3

                                                                                  Time
plProxy Version 2
   plProxy second version
      just remote call language         FrontEnd              WebServer
      simplified internal structure
      added flexibility
      added features
      configuration and management
                                                      userdb
        improved
   Connection pooling separated into
    pgBouncer.                                      pgBouncer

   Resulting architecture is
      Scaleable
      Maintainable
      Beautiful in it's simplicity :)    userdb_p0             userdb_p1
Overall picture

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

 ● pgBouncers


 ● OLTP db's


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



 Support databases
 ● Queue db's
                                        queuedb
                                        SkyTools
 ● Datamining


 ● Batchjobs


 ● Backoffice


 ● Greenplum
                                  batchdb          analysisdb         backofficedb
plProxy: Installation
   Download PL/Proxy from http://pgfoundry.org/projects/plproxy and extract.
   Build PL/Proxy by running make and make install inside of the plproxy directory. If
    your having problems make sure that pg_config from the postgresql bin directory is
    in your path.
   To install PL/Proxy in a database execute the commands in the plproxy.sql file. For
    example psql -f $SHAREDIR/contrib/plproxy.sql mydatabase
   Steps 1 and 2 can be skipped if your installed pl/proxy from a packaging system
    such as RPM.
   Create a test function to validate that plProxy is working as expected.


    CREATE FUNCTION public.get_user_email(text) RETURNS text AS
    $_$ connect 'dbname=userdb'; $_$
    LANGUAGE plproxy SECURITY DEFINER;
plProxy Language
   The language is similar to plpgsql - string quoting, comments, semicolon at the
    statements end.It contains only 4 statements: CONNECT, CLUSTER, RUN and
    SELECT.
   Each function needs to have either CONNECT or pair of CLUSTER + RUN
    statements to specify where to run the function.
   CONNECT 'libpq connstr'; -- Specifies exact location where to connect and
    execute the query. If several functions have same connstr, they will use same
    connection.
   CLUSTER 'cluster_name'; -- Specifies exact cluster name to be run on. The cluster
    name will be passed to plproxy.get_cluster_* functions.
   CLUSTER cluster_func(..); -- Cluster name can be dynamically decided upon
    proxy function arguments. cluster_func should return text value of final cluster
    name.
plProxy Language RUN ON ...
   RUN ON ALL; -- Query will be run on all partitions in cluster in parallel.
   RUN ON ANY; -- Query will be run on random partition.
   RUN ON <NR>; -- Run on partition number <NR>.
   RUN ON partition_func(..); -- Run partition_func() which should return one or more
    hash values. (int4) Query will be run on tagged partitions. If more than one partition
    was tagged, query will be sent in parallel to them.

    CREATE FUNCTION public.get_user_email(text) RETURNS text AS
    $_$
        cluster 'userdb';
        run on public.get_hash($1);
    $_$
    LANGUAGE plproxy SECURITY DEFINER;
plProxy Configuration
   Schema plproxy and 3 functions are needed for plProxy
   plproxy.get_cluster_partitions(cluster_name text) – initializes
    plProxy connect strings to remote databases
   plproxy.get_cluster_version(cluster_name text) – used by plProxy to
    determine if configuration has changed and should be read again. Should be as fast
    as possible because it is called for every function call that goes through plProxy.
   plproxy.get_cluster_config(in cluster_name text, out key text,
    out val text) – can be used to change plProxy parameters like connection
    lifetime.
    CREATE FUNCTION plproxy.get_cluster_version(i_cluster text)
    RETURNS integer AS $$
        SELECT 1;
    $$ LANGUAGE sql SECURITY DEFINER;

    CREATE FUNCTION plproxy.get_cluster_config(
        cluster_name text, OUT "key" text, OUT val text)
    RETURNS SETOF record AS $$
        SELECT 'connection_lifetime'::text as key, text( 30*60 ) as val;
    $$ LANGUAGE sql;
plProxy: Get Cluster Partitions
CREATE FUNCTION plproxy.get_cluster_partitions(cluster_name text)
RETURNS SETOF text AS $$
begin
    if cluster_name = 'userdb' then
        return next 'port=9000 dbname=userdb_p00 user=proxy';
        return next 'port=9000 dbname=userdb_p01 user=proxy';
        return;
    end if;
    raise exception 'no such cluster: %', cluster_name;
end; $$ LANGUAGE plpgsql SECURITY DEFINER;

CREATE FUNCTION plproxy.get_cluster_partitions(i_cluster_name text)
RETURNS SETOF text AS $$
declare
    r record;
begin
    for r in
         select connect_string
         from plproxy.conf
         where cluster_name = i_cluster_name
    loop
         return next r.connect_string;
    end loop;
    if not found then
         raise exception 'no such cluster: %', i_cluster_name;
    end if;
    return;
end; $$ LANGUAGE plpgsql SECURITY DEFINER;
plProxy: Remote Calls
   We use remote calls mostly for read only queries in cases where it is not reasonable
    to replicate data needed to calling database.
   For example balance data is changing very often but whenever doing decisions
    based on balance we must use the latest balance so we use remote call to get user
    balance.
   Another use case when occasionally archived data is needed together with online
    data.

                                                       userDB
                                                      get_email

                           shopDB                     balanceDB
                                                     get_balance


                                                      archiveDB
                                                    get_old_orders
plProxy: Remote Calls (update)
   plProxy remote calls inside transactions that change data in remote database
    should have special handling
   no 2 phase commit
   some mechanism should be used to handle possible problems like inserting events
    into PgQ queue and let consumer validate that transaction was committed or rolled
    back and act accordingly.




                                                        balanceDB
                                                      change_balance
                           shopDB
                                                          balance
                                                          events

                                    balance
                                    change
                                    handler
plProxy: Proxy Databases
   Additional layer between application and databases.
   Keep applications database connectivity simpler giving DBA's and developer's more
    flexibility for moving data and functionality around.
   Security layer. By giving access to proxy database DBA's can be sure that user has
    no way of accessing tables by accident or by any other means as only functions
    published in proxy database are visible to user.


                                                                  BackOffice
                                                                  Application


                          manualfixDb         backofficeDb
                            (proxy)             (proxy)




                         shopDb           userDB             internalDb
plProxy: Run On All              CREATE FUNCTION stats._get_stats(
                                     OUT stat_name text,
                                     OUT stat_value bigint
   Run on all executes              ) RETURNS SETOF record AS
    query on all partitions in   $_$
    cluster once. Partitions         cluster 'userdb';
    are identified by connect        run on all;
                                 $_$
    strings.                         LANGUAGE plproxy SECURITY DEFINER;
   Useful for gathering stats
                                 CREATE FUNCTION stats.get_stats(
    from several databases           OUT stat_name text,
    or database partitions.          OUT stat_value bigint
                                     ) RETURNS SETOF record AS
   Also usable when exact       $_$
    partition where data             select stat_name
    resides is not known.            , (sum(stat_value))::bigint
    Then function may be run         from stats._get_stats()
                                     group by stat_name
    on all partitions and only       order by stat_name;
    the one that has data        $_$
    does something.                  LANGUAGE sql SECURITY DEFINER;
plProxy: Geographical
   plProxy can be used to split database into partitions based on country code.
    Example database is split into 'us' and 'row' (rest of the world)
   Each function call caused by online users has country code as one of the
    parameters
   All data is replicated into internal database for use by internal applications and batch
    jobs. That also reduces number of indexes needed in online databases.

    CREATE FUNCTION public.get_cluster(
        i_key_cc text
                                                         onlinedb
        ) RETURNS text AS                                 (proxy)
    $_$
    BEGIN
        IF i_key_cc = 'us' THEN
             RETURN 'oltp_us';
        ELSE                       onlinedb_US           onlinedb_ROW        backenddb
             RETURN 'oltp_row';
        END IF;
    END;
    $_$ LANGUAGE plpgsql;
plProxy: Partitioning Proxy Functions
   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 pleasant.
   Multiple exact copies of proxy database are in use for scaleability and availability
    considerations.
    CREATE FUNCTION public.get_user_email(text) RETURNS text AS
    $_$
        cluster 'userdb';
        run on public.get_hash($1);
    $_$ LANGUAGE plproxy SECURITY DEFINER;

    CREATE FUNCTION public.get_hash(i_user text) RETURNS integer AS
    $_$
    BEGIN
        return hashtext(lower(i_user));
    END;
    $_$ LANGUAGE plpgsql SECURITY DEFINER;
plProxy: Partitioning Partition Functions
   Couple of functions in partconf schema added to each partition:
      partconf.global_id() - gives globally unique keys
      partconf.check_hash() - checks that function call is in right partition
      partconf.valid_hash() - used as trigger function
    CREATE FUNCTION public.get_user_email(i_username text) RETURNS text AS
    $_$
    DECLARE
        retval text;
    BEGIN
        PERFORM partconf.check_hash(lower(i_username));

        SELECT email
        FROM users
        WHERE username = lower(i_username)
        INTO retval;

         RETURN retval;
    END;
    $_$ LANGUAGE plpgsql SECURITY DEFINER;
plProxy: Summary
   plProxy adds 1-10ms overhead when used together with pgBouncer.
   Quote from Gavin M. Roy's blog “After closely watching machine stats for the first 30
    minutes of production, it appears that plProxy has very little if any impact on
    machine resources in our infrastructure.”
   On the other hand plProxy adds complexity to development and maintenance so it
    must be used with care but that is true for most everything.
   Our largest cluster is currently running in 16 partitions on 16 servers.
pgBouncer
   pgBouncer is lightweight and robust connection pooler
    for Postgres.
                                                                Applications
   Low memory requirements (2k per connection by
    default). This is due to the fact that PgBouncer does not
    need to see full packet at once.                                           thousands of
   It is not tied to one backend server, the destination                       connections
    databases can reside on different hosts.
   Supports pausing activity on all or only selected           pgBouncer
    databases.
   Supports online reconfiguration for most of the settings.
                                                                                 tens of
   Supports online restart/upgrade without dropping client                    connections
    connections.
   Supports protocol V3 only, so backend version must be
    >= 7.4.                                                      Database

   Does not parse SQL so is very fast and uses little CPU
    time.
pgBouncer Pooling Modes
   Session pooling - Most polite method. When client connects, a server connection
    will be assigned to it for the whole duration it stays connected. When client
    disconnects, the server connection will be put back into pool. Should be used with
    legacy applications that won't work with more efficient pooling modes.
   Transaction pooling - Server connection is assigned to client only during a
    transaction. When PgBouncer notices that transaction is over, the server will be put
    back into pool. This is a hack as it breaks application expectations of backend
    connection. You can use it only when application cooperates with such usage by not
    using features that can break.
   Statement pooling - Most aggressive method. This is transaction pooling with a
    twist - multi-statement transactions are disallowed. This is meant to enforce
    "autocommit" mode on client, mostly targeted for PL/Proxy.
pgBouncer Pictures
   http://www.last.fm/user/Russ/journal/2008/02/21/654597/
   Nice blog about pgBouncer
pgBalancer
   Keep pgBouncer small stable and
                                             client1
    focused
                                                               clientN
   pgBalancer is experiment with
    existing software to implement
    statement level load balancing.
   So we created sample configuration
    using existing software that shows       lvs        keepalived         lvs
    how load could be divided on several   (master)     daemon           (slave)
    read only databases.
   LVS – Linux Virtual Server is used (
    http://www.linuxvirtualserver.org/)
       Different load balancing
         algorithms
       Weights on resources.
                                           pgBouncer                 pgBouncer
                                           shopdb_ro1                shopdb_ro2
SODI Framework                               Application layer
                                             - java / php ...
   Rapid application development            - UI logic
                                             . mostly generated
   Cheap changes                            - sodi framework
   Most of the design is in metadata.
   Application design stays in sync with
    application over time.                  AppServer layer:
   Minimizes number of database            - java / php( ...
    roundtrips.                             - user authentication
                                            - roles rights
   Can send multiple recordsets to one     - no business logic
    function call.
   Can receive several recordsets from
    function call.                            Database layer
                                              - business logic
                                              - plPython
                                              - PostgreSQL
                                              - SkyTools
President
                                      President configuration management
                                       application
  President     President             Java Client allows updates Web
  Java RW       Web RO
                                       client view only access. All outside
                                       access to system over HTTPS and
                                       personal certificates can be
                                       generated if needed.
                         Host         Kuberner polls confdb periodically for
       Apache
                     - Harvester       commands and executes received
        PHP
                     - Discovery       commands.
                                      Harvester runs inside each host and
                                       writes machine hardware information
                                       into file for Kuberner to read
                                      Discovery plugin collects specific
      ConfDB
                                       configuration files and stores them
                      Kuberner         into ConfDB
                                      Kuberner: File upload plugin uploads
                                       new configuration files into hosts.
SkyTools
   SkyTools - Python scripting framework and collection of useful database scripts.
    Most of our internal tools are based on this framework.
      (centralized) logging and exception handling
      database connection handling
      configuration management
      starting and stopping scripts
   Some of scripts provided by SkyTools
      londiste – nice and simple replication tool
      walmgr - wal standby management script
      serial consumer – Script for executing functions based on data in queue
      queue mover – Move events from one queue into another
      queue splitter – Move events from one queue into several queues
      table dispatcher – writes data from queue into partitioned table
      cube dispatcher - writes data from queue into daily tables
SkyTools: Queue Mover
   Moves data from source queue in one database to another queue in other database.
   Used to move events from online databases to queue databases.
   We don't need to keep events in online database in case some consumer fails to
    process them.
   Consolidates events if there are several producers as in case of partitioned
    databases.


                                                                      Batch
          OLTP                 queue                                   job
                               mover
                                                  Batch
                                                   db
                               queue
          OLTP                 mover                                  Batch
                                                                       job
SkyTools: Queue Splitter
   Moves data from source queue in one database to one or more queue's in target
    database based on producer. That is another version of queue_mover but it has it's
    own benefits.
   Used to move events from online databases to queue databases.
                                                                         promotional
   Reduces number of dependencies of online databases.
                                                                              mailer

             Producer
          welcome_email
                                                      Queue:
               Producer                               welcome_email
            password_email
                                                      Queue:
                    Queue:                            password_email
                    user_events


                                  queue
                                  splitter                               transactional
                                                                             mailer
SkyTools: Table Dispatcher
   Has url encoded events as data source and writes them into table on target
    database.
   Used to partiton data. For example change log's that need to kept online only shortly
    can be written to daily tables and then dropped as they become irrelevant.
   Also allows to select which columns have to be written into target database
   Creates target tables according to configuration file as needed

                                        table                            Table: history
                                     dispatcher                             history_2007_01
                                                                            history_2007_02
       Queue:                                                                       ...
       call_records
                                  table
                               dispatcher            Tabel: cr
                                                     cr_2007_01_01
                                                     cr_2007_01_02
                                                           ...
SkyTools: Cube Dispatcher
   Has url encoded events as data source and writes them into partitoned tables in
    target database. Logutriga is used to create events.
   Used to provide batches of data for business intelligence and data cubes.
   Only one instance of each record is stored. For example if record is created and
    then updated twice only latest version of record stays in that days table.
   Does not support deletes.


         Producer                                Tabel: invoices        Tabel: payments
    send_welcome_email
         invoices
                                                  invoices_2007_01_01    payments_2007_01_01
                                                  invoices_2007_01_02    payments_2007_01_02
           Producer
           payments                                       ...                    ...


                   Queue:
                   cube_events                cube
                                           dispatcher
Questions, Problems?
   Use SkyTools, plProxy and pgBouncer mailing list at PgFoundry
   skype me: askoja

Contenu connexe

Tendances

[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기SeungYong Oh
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In DeepMydbops
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyAmit Aggarwal
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsPractical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsFlink Forward
 
Flink Forward Berlin 2017: Patrick Lucas - Flink in Containerland
Flink Forward Berlin 2017: Patrick Lucas - Flink in ContainerlandFlink Forward Berlin 2017: Patrick Lucas - Flink in Containerland
Flink Forward Berlin 2017: Patrick Lucas - Flink in ContainerlandFlink Forward
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practiceAlexey Lesovsky
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance CachingNGINX, Inc.
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorFlink Forward
 
YOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixYOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixBrendan Gregg
 
HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedGanapathi Kandaswamy
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google CloudPgDay.Seoul
 
Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Hao H. Zhang
 
Ceph scale testing with 10 Billion Objects
Ceph scale testing with 10 Billion ObjectsCeph scale testing with 10 Billion Objects
Ceph scale testing with 10 Billion ObjectsKaran Singh
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumScyllaDB
 
SSD Deployment Strategies for MySQL
SSD Deployment Strategies for MySQLSSD Deployment Strategies for MySQL
SSD Deployment Strategies for MySQLYoshinori Matsunobu
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep DiveRed_Hat_Storage
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with BarmanEDB
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)Mydbops
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisDvir Volk
 

Tendances (20)

[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기[NDC17] Kubernetes로 개발서버 간단히 찍어내기
[NDC17] Kubernetes로 개발서버 간단히 찍어내기
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In Deep
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
Practical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobsPractical learnings from running thousands of Flink jobs
Practical learnings from running thousands of Flink jobs
 
Flink Forward Berlin 2017: Patrick Lucas - Flink in Containerland
Flink Forward Berlin 2017: Patrick Lucas - Flink in ContainerlandFlink Forward Berlin 2017: Patrick Lucas - Flink in Containerland
Flink Forward Berlin 2017: Patrick Lucas - Flink in Containerland
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practice
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Introducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes OperatorIntroducing the Apache Flink Kubernetes Operator
Introducing the Apache Flink Kubernetes Operator
 
YOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at NetflixYOW2018 Cloud Performance Root Cause Analysis at Netflix
YOW2018 Cloud Performance Root Cause Analysis at Netflix
 
HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and Keepalived
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
 
Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2Kubernetes Architecture - beyond a black box - Part 2
Kubernetes Architecture - beyond a black box - Part 2
 
Ceph scale testing with 10 Billion Objects
Ceph scale testing with 10 Billion ObjectsCeph scale testing with 10 Billion Objects
Ceph scale testing with 10 Billion Objects
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in Cilium
 
SSD Deployment Strategies for MySQL
SSD Deployment Strategies for MySQLSSD Deployment Strategies for MySQL
SSD Deployment Strategies for MySQL
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Ceph Block Devices: A Deep Dive
Ceph Block Devices:  A Deep DiveCeph Block Devices:  A Deep Dive
Ceph Block Devices: A Deep Dive
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
 
ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)ProxySQL High Availability (Clustering)
ProxySQL High Availability (Clustering)
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 

En vedette

"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...
"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (..."Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...
"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...AvitoTech
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverJohn Paulett
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Robert Treat
 
Database Tools by Skype
Database Tools by SkypeDatabase Tools by Skype
Database Tools by Skypeelliando dias
 
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike SteenbergenMeet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergendistributed matters
 
Demystifying PostgreSQL
Demystifying PostgreSQLDemystifying PostgreSQL
Demystifying PostgreSQLNOLOH LLC.
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBAshnikbiz
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First LookRobert Treat
 
Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Robert Treat
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentRobert Treat
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRRobert Treat
 
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxThink_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxPayal Singh
 
Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Denish Patel
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.confRobert Treat
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLanandology
 
Best Practices for a Complete Postgres Enterprise Architecture Setup
Best Practices for a Complete Postgres Enterprise Architecture SetupBest Practices for a Complete Postgres Enterprise Architecture Setup
Best Practices for a Complete Postgres Enterprise Architecture SetupEDB
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanGabriele Bartolini
 
The Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQLThe Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQLAshnikbiz
 
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6Tomas Vondra
 

En vedette (20)

"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...
"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (..."Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...
"Отказоустойчивый standby PostgreSQL (HAProxy + PgBouncer)" Виктор Ягофаров (...
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And Failover
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016
 
Scaling postgres
Scaling postgresScaling postgres
Scaling postgres
 
Database Tools by Skype
Database Tools by SkypeDatabase Tools by Skype
Database Tools by Skype
 
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike SteenbergenMeet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
Meet Spilo, Zalando’s HIGH-AVAILABLE POSTGRESQL CLUSTER - Feike Steenbergen
 
Demystifying PostgreSQL
Demystifying PostgreSQLDemystifying PostgreSQL
Demystifying PostgreSQL
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDB
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First Look
 
Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016 Less Alarming Alerts - SRECon 2016
Less Alarming Alerts - SRECon 2016
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps Environment
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITR
 
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptxThink_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
Think_your_Postgres_backups_and_recovery_are_safe_lets_talk.pptx
 
Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.conf
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
 
Best Practices for a Complete Postgres Enterprise Architecture Setup
Best Practices for a Complete Postgres Enterprise Architecture SetupBest Practices for a Complete Postgres Enterprise Architecture Setup
Best Practices for a Complete Postgres Enterprise Architecture Setup
 
PostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with BarmanPostgreSQL Disaster Recovery with Barman
PostgreSQL Disaster Recovery with Barman
 
The Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQLThe Magic of Tuning in PostgreSQL
The Magic of Tuning in PostgreSQL
 
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6
 

Similaire à plProxy, pgBouncer, pgBalancer

Small Overview of Skype Database Tools
Small Overview of Skype Database ToolsSmall Overview of Skype Database Tools
Small Overview of Skype Database Toolselliando dias
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture HighloadOntico
 
Asko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadAsko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadOntico
 
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...Alan Pinstein
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsGavin Roy
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18Derek Downey
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaSpark Summit
 
New Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cNew Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cMarkus Flechtner
 
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
 
Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0Kaxil Naik
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interfaceJalal Zahid
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationKanwar Batra
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Michael Renner
 
Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1AkramWaseem
 
Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Cécile Benhamou
 
CUBRID Developer's Course
CUBRID Developer's CourseCUBRID Developer's Course
CUBRID Developer's CourseCUBRID
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practiceDocker, Inc.
 

Similaire à plProxy, pgBouncer, pgBalancer (20)

Small Overview of Skype Database Tools
Small Overview of Skype Database ToolsSmall Overview of Skype Database Tools
Small Overview of Skype Database Tools
 
Moskva Architecture Highload
Moskva Architecture HighloadMoskva Architecture Highload
Moskva Architecture Highload
 
Asko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture HighloadAsko Oja Moskva Architecture Highload
Asko Oja Moskva Architecture Highload
 
Plproxy
PlproxyPlproxy
Plproxy
 
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
Patterns and Tools for Database Versioning, Migration, Data Loading and Test ...
 
Scaling PostgreSQL with Skytools
Scaling PostgreSQL with SkytoolsScaling PostgreSQL with Skytools
Scaling PostgreSQL with Skytools
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
9.1 Grand Tour
9.1 Grand Tour9.1 Grand Tour
9.1 Grand Tour
 
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-MallaKerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
Kerberizing Spark: Spark Summit East talk by Abel Rincon and Jorge Lopez-Malla
 
New Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21cNew Features for Multitenant in Oracle Database 21c
New Features for Multitenant in Oracle Database 21c
 
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
 
Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0Airflow Best Practises & Roadmap to Airflow 2.0
Airflow Best Practises & Roadmap to Airflow 2.0
 
9.1 Mystery Tour
9.1 Mystery Tour9.1 Mystery Tour
9.1 Mystery Tour
 
Odoo command line interface
Odoo command line interfaceOdoo command line interface
Odoo command line interface
 
Setup oracle golden gate 11g replication
Setup oracle golden gate 11g replicationSetup oracle golden gate 11g replication
Setup oracle golden gate 11g replication
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
 
Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1
 
Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect Pres Db2 native rest json and z/OS connect
Pres Db2 native rest json and z/OS connect
 
CUBRID Developer's Course
CUBRID Developer's CourseCUBRID Developer's Course
CUBRID Developer's Course
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
 

Plus de 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
 

Plus de 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
 

Dernier

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

plProxy, pgBouncer, pgBalancer

  • 1. plProxy, pgBouncer, pgBalancer Asko Oja
  • 2. Vertical Split  All database access through functions requirement from the start  Moved out functionality into separate servers and databases as load increased.  Slony for replication, plpython for remote calls.  As number of databases grew we ran into problems  Slony replication became unmanageable because of listen/notify architecture and locking.  We started looking for alternatives that ended up creating SkyTools PgQ and Londiste. userdb userdb analysisdb userdb shopdb shopdb shopdb servicedb Time
  • 4. Horizontal Split  One server could not service one table anymore  We did first split with plpython remote calls  Replaced it with plProxy language but it had still several problems  complex configuration database  internal pooler and complex internal structure  scaleability issues userdb userdb userdb userdb userdb_p0 userdb_p2 userdb_p0 userdb_p1 userdb_p2 userdb_p3 userdb_p1 userdb_p3 Time
  • 5. plProxy Version 2  plProxy second version  just remote call language FrontEnd WebServer  simplified internal structure  added flexibility  added features  configuration and management userdb improved  Connection pooling separated into pgBouncer. pgBouncer  Resulting architecture is  Scaleable  Maintainable  Beautiful in it's simplicity :) userdb_p0 userdb_p1
  • 6. Overall picture Online databases proxydb proxydb pgBouncer ● Proxy db's pgBouncer pgBouncer ● pgBouncers ● OLTP db's ● read only db's userdb_p01 userdb_p01 shopdb shopdb_ro SkyTools SkyTools SkyTools SkyTools Support databases ● Queue db's queuedb SkyTools ● Datamining ● Batchjobs ● Backoffice ● Greenplum batchdb analysisdb backofficedb
  • 7. plProxy: Installation  Download PL/Proxy from http://pgfoundry.org/projects/plproxy and extract.  Build PL/Proxy by running make and make install inside of the plproxy directory. If your having problems make sure that pg_config from the postgresql bin directory is in your path.  To install PL/Proxy in a database execute the commands in the plproxy.sql file. For example psql -f $SHAREDIR/contrib/plproxy.sql mydatabase  Steps 1 and 2 can be skipped if your installed pl/proxy from a packaging system such as RPM.  Create a test function to validate that plProxy is working as expected. CREATE FUNCTION public.get_user_email(text) RETURNS text AS $_$ connect 'dbname=userdb'; $_$ LANGUAGE plproxy SECURITY DEFINER;
  • 8. plProxy Language  The language is similar to plpgsql - string quoting, comments, semicolon at the statements end.It contains only 4 statements: CONNECT, CLUSTER, RUN and SELECT.  Each function needs to have either CONNECT or pair of CLUSTER + RUN statements to specify where to run the function.  CONNECT 'libpq connstr'; -- Specifies exact location where to connect and execute the query. If several functions have same connstr, they will use same connection.  CLUSTER 'cluster_name'; -- Specifies exact cluster name to be run on. The cluster name will be passed to plproxy.get_cluster_* functions.  CLUSTER cluster_func(..); -- Cluster name can be dynamically decided upon proxy function arguments. cluster_func should return text value of final cluster name.
  • 9. plProxy Language RUN ON ...  RUN ON ALL; -- Query will be run on all partitions in cluster in parallel.  RUN ON ANY; -- Query will be run on random partition.  RUN ON <NR>; -- Run on partition number <NR>.  RUN ON partition_func(..); -- Run partition_func() which should return one or more hash values. (int4) Query will be run on tagged partitions. If more than one partition was tagged, query will be sent in parallel to them. CREATE FUNCTION public.get_user_email(text) RETURNS text AS $_$ cluster 'userdb'; run on public.get_hash($1); $_$ LANGUAGE plproxy SECURITY DEFINER;
  • 10. plProxy Configuration  Schema plproxy and 3 functions are needed for plProxy  plproxy.get_cluster_partitions(cluster_name text) – initializes plProxy connect strings to remote databases  plproxy.get_cluster_version(cluster_name text) – used by plProxy to determine if configuration has changed and should be read again. Should be as fast as possible because it is called for every function call that goes through plProxy.  plproxy.get_cluster_config(in cluster_name text, out key text, out val text) – can be used to change plProxy parameters like connection lifetime. CREATE FUNCTION plproxy.get_cluster_version(i_cluster text) RETURNS integer AS $$ SELECT 1; $$ LANGUAGE sql SECURITY DEFINER; CREATE FUNCTION plproxy.get_cluster_config( cluster_name text, OUT "key" text, OUT val text) RETURNS SETOF record AS $$ SELECT 'connection_lifetime'::text as key, text( 30*60 ) as val; $$ LANGUAGE sql;
  • 11. plProxy: Get Cluster Partitions CREATE FUNCTION plproxy.get_cluster_partitions(cluster_name text) RETURNS SETOF text AS $$ begin if cluster_name = 'userdb' then return next 'port=9000 dbname=userdb_p00 user=proxy'; return next 'port=9000 dbname=userdb_p01 user=proxy'; return; end if; raise exception 'no such cluster: %', cluster_name; end; $$ LANGUAGE plpgsql SECURITY DEFINER; CREATE FUNCTION plproxy.get_cluster_partitions(i_cluster_name text) RETURNS SETOF text AS $$ declare r record; begin for r in select connect_string from plproxy.conf where cluster_name = i_cluster_name loop return next r.connect_string; end loop; if not found then raise exception 'no such cluster: %', i_cluster_name; end if; return; end; $$ LANGUAGE plpgsql SECURITY DEFINER;
  • 12. plProxy: Remote Calls  We use remote calls mostly for read only queries in cases where it is not reasonable to replicate data needed to calling database.  For example balance data is changing very often but whenever doing decisions based on balance we must use the latest balance so we use remote call to get user balance.  Another use case when occasionally archived data is needed together with online data. userDB get_email shopDB balanceDB get_balance archiveDB get_old_orders
  • 13. plProxy: Remote Calls (update)  plProxy remote calls inside transactions that change data in remote database should have special handling  no 2 phase commit  some mechanism should be used to handle possible problems like inserting events into PgQ queue and let consumer validate that transaction was committed or rolled back and act accordingly. balanceDB change_balance shopDB balance events balance change handler
  • 14. plProxy: Proxy Databases  Additional layer between application and databases.  Keep applications database connectivity simpler giving DBA's and developer's more flexibility for moving data and functionality around.  Security layer. By giving access to proxy database DBA's can be sure that user has no way of accessing tables by accident or by any other means as only functions published in proxy database are visible to user. BackOffice Application manualfixDb backofficeDb (proxy) (proxy) shopDb userDB internalDb
  • 15. plProxy: Run On All CREATE FUNCTION stats._get_stats( OUT stat_name text, OUT stat_value bigint  Run on all executes ) RETURNS SETOF record AS query on all partitions in $_$ cluster once. Partitions cluster 'userdb'; are identified by connect run on all; $_$ strings. LANGUAGE plproxy SECURITY DEFINER;  Useful for gathering stats CREATE FUNCTION stats.get_stats( from several databases OUT stat_name text, or database partitions. OUT stat_value bigint ) RETURNS SETOF record AS  Also usable when exact $_$ partition where data select stat_name resides is not known. , (sum(stat_value))::bigint Then function may be run from stats._get_stats() group by stat_name on all partitions and only order by stat_name; the one that has data $_$ does something. LANGUAGE sql SECURITY DEFINER;
  • 16. plProxy: Geographical  plProxy can be used to split database into partitions based on country code. Example database is split into 'us' and 'row' (rest of the world)  Each function call caused by online users has country code as one of the parameters  All data is replicated into internal database for use by internal applications and batch jobs. That also reduces number of indexes needed in online databases. CREATE FUNCTION public.get_cluster( i_key_cc text onlinedb ) RETURNS text AS (proxy) $_$ BEGIN IF i_key_cc = 'us' THEN RETURN 'oltp_us'; ELSE onlinedb_US onlinedb_ROW backenddb RETURN 'oltp_row'; END IF; END; $_$ LANGUAGE plpgsql;
  • 17. plProxy: Partitioning Proxy Functions  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 pleasant.  Multiple exact copies of proxy database are in use for scaleability and availability considerations. CREATE FUNCTION public.get_user_email(text) RETURNS text AS $_$ cluster 'userdb'; run on public.get_hash($1); $_$ LANGUAGE plproxy SECURITY DEFINER; CREATE FUNCTION public.get_hash(i_user text) RETURNS integer AS $_$ BEGIN return hashtext(lower(i_user)); END; $_$ LANGUAGE plpgsql SECURITY DEFINER;
  • 18. plProxy: Partitioning Partition Functions  Couple of functions in partconf schema added to each partition:  partconf.global_id() - gives globally unique keys  partconf.check_hash() - checks that function call is in right partition  partconf.valid_hash() - used as trigger function CREATE FUNCTION public.get_user_email(i_username text) RETURNS text AS $_$ DECLARE retval text; BEGIN PERFORM partconf.check_hash(lower(i_username)); SELECT email FROM users WHERE username = lower(i_username) INTO retval; RETURN retval; END; $_$ LANGUAGE plpgsql SECURITY DEFINER;
  • 19. plProxy: Summary  plProxy adds 1-10ms overhead when used together with pgBouncer.  Quote from Gavin M. Roy's blog “After closely watching machine stats for the first 30 minutes of production, it appears that plProxy has very little if any impact on machine resources in our infrastructure.”  On the other hand plProxy adds complexity to development and maintenance so it must be used with care but that is true for most everything.  Our largest cluster is currently running in 16 partitions on 16 servers.
  • 20. pgBouncer  pgBouncer is lightweight and robust connection pooler for Postgres. Applications  Low memory requirements (2k per connection by default). This is due to the fact that PgBouncer does not need to see full packet at once. thousands of  It is not tied to one backend server, the destination connections databases can reside on different hosts.  Supports pausing activity on all or only selected pgBouncer databases.  Supports online reconfiguration for most of the settings. tens of  Supports online restart/upgrade without dropping client connections connections.  Supports protocol V3 only, so backend version must be >= 7.4. Database  Does not parse SQL so is very fast and uses little CPU time.
  • 21. pgBouncer Pooling Modes  Session pooling - Most polite method. When client connects, a server connection will be assigned to it for the whole duration it stays connected. When client disconnects, the server connection will be put back into pool. Should be used with legacy applications that won't work with more efficient pooling modes.  Transaction pooling - Server connection is assigned to client only during a transaction. When PgBouncer notices that transaction is over, the server will be put back into pool. This is a hack as it breaks application expectations of backend connection. You can use it only when application cooperates with such usage by not using features that can break.  Statement pooling - Most aggressive method. This is transaction pooling with a twist - multi-statement transactions are disallowed. This is meant to enforce "autocommit" mode on client, mostly targeted for PL/Proxy.
  • 22. pgBouncer Pictures  http://www.last.fm/user/Russ/journal/2008/02/21/654597/  Nice blog about pgBouncer
  • 23. pgBalancer  Keep pgBouncer small stable and client1 focused clientN  pgBalancer is experiment with existing software to implement statement level load balancing.  So we created sample configuration using existing software that shows lvs keepalived lvs how load could be divided on several (master) daemon (slave) read only databases.  LVS – Linux Virtual Server is used ( http://www.linuxvirtualserver.org/)  Different load balancing algorithms  Weights on resources. pgBouncer pgBouncer shopdb_ro1 shopdb_ro2
  • 24. SODI Framework Application layer - java / php ...  Rapid application development - UI logic . mostly generated  Cheap changes - sodi framework  Most of the design is in metadata.  Application design stays in sync with application over time. AppServer layer:  Minimizes number of database - java / php( ... roundtrips. - user authentication - roles rights  Can send multiple recordsets to one - no business logic function call.  Can receive several recordsets from function call. Database layer - business logic - plPython - PostgreSQL - SkyTools
  • 25. President  President configuration management application President President  Java Client allows updates Web Java RW Web RO client view only access. All outside access to system over HTTPS and personal certificates can be generated if needed. Host  Kuberner polls confdb periodically for Apache - Harvester commands and executes received PHP - Discovery commands.  Harvester runs inside each host and writes machine hardware information into file for Kuberner to read  Discovery plugin collects specific ConfDB configuration files and stores them Kuberner into ConfDB  Kuberner: File upload plugin uploads new configuration files into hosts.
  • 26. SkyTools  SkyTools - Python scripting framework and collection of useful database scripts. Most of our internal tools are based on this framework.  (centralized) logging and exception handling  database connection handling  configuration management  starting and stopping scripts  Some of scripts provided by SkyTools  londiste – nice and simple replication tool  walmgr - wal standby management script  serial consumer – Script for executing functions based on data in queue  queue mover – Move events from one queue into another  queue splitter – Move events from one queue into several queues  table dispatcher – writes data from queue into partitioned table  cube dispatcher - writes data from queue into daily tables
  • 27. SkyTools: Queue Mover  Moves data from source queue in one database to another queue in other database.  Used to move events from online databases to queue databases.  We don't need to keep events in online database in case some consumer fails to process them.  Consolidates events if there are several producers as in case of partitioned databases. Batch OLTP queue job mover Batch db queue OLTP mover Batch job
  • 28. SkyTools: Queue Splitter  Moves data from source queue in one database to one or more queue's in target database based on producer. That is another version of queue_mover but it has it's own benefits.  Used to move events from online databases to queue databases. promotional  Reduces number of dependencies of online databases. mailer Producer welcome_email Queue: Producer welcome_email password_email Queue: Queue: password_email user_events queue splitter transactional mailer
  • 29. SkyTools: Table Dispatcher  Has url encoded events as data source and writes them into table on target database.  Used to partiton data. For example change log's that need to kept online only shortly can be written to daily tables and then dropped as they become irrelevant.  Also allows to select which columns have to be written into target database  Creates target tables according to configuration file as needed table Table: history dispatcher history_2007_01 history_2007_02 Queue: ... call_records table dispatcher Tabel: cr cr_2007_01_01 cr_2007_01_02 ...
  • 30. SkyTools: Cube Dispatcher  Has url encoded events as data source and writes them into partitoned tables in target database. Logutriga is used to create events.  Used to provide batches of data for business intelligence and data cubes.  Only one instance of each record is stored. For example if record is created and then updated twice only latest version of record stays in that days table.  Does not support deletes. Producer Tabel: invoices Tabel: payments send_welcome_email invoices invoices_2007_01_01 payments_2007_01_01 invoices_2007_01_02 payments_2007_01_02 Producer payments ... ... Queue: cube_events cube dispatcher
  • 31. Questions, Problems?  Use SkyTools, plProxy and pgBouncer mailing list at PgFoundry  skype me: askoja