SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Gofer
   A scalable stateless proxy for DBI




Tim.Bunce@pobox.com - September 2008
DBI Layer Cake
Application
    DBI
 DBD::Foo
Database API



                 Database
New Layers
 Application          Gofer Transport

     DBI                    DBI
 DBD::Gofer               DBD::Foo
Gofer Transport       Database API



                          Database
Gofer gives you...
                               Few
        Application         round-trips           Gofer Transport

              DBI                                        DBI
        DBD::Gofer                                   DBD::Foo
       Gofer Transport
                             Stateless
                             protocol                           Server-side
                                               Database DBD      caching
Client-side                                     only needed
 caching                                         on server
                              Pluggable
   Retry on     Configure     transports        Flexible and easy to extend
    error        via DSN   ssh, http, etc...         e.g. DBIx::Router
DBD::Proxy vs DBD::Gofer
                              DBD::Proxy   DBD::Gofer
  Supports transactions           ✓         ✗(not yet)
Supports very large results       ✓        ✗(memory)
      Large test suite            ✗             ✓
   Minimal round-trips            ✗             ✓
 Automatic retry on error         ✗             ✓
Modular & Pluggable classes       ✗             ✓
    Tunable via Policies          ✗             ✓
         Scalable                 ✗             ✓
   Connection pooling             ✗             ✓
    Client-side caching           ✗             ✓
    Server-side caching           ✗             ✓
Gofer, logically
•   Gofer is
    - A scalable stateless proxy architecture for DBI
    - Transport independent
    - Highly configurable on client and server side
    - Efficient, in CPU time and minimal round-trips
    - Well tested
    - Scalable
    - Cacheable
    - Simple and reliable
Gofer, structurally
•   Gofer is
    - A simple stateless request/response protocol
    - A DBI proxy driver: DBD::Gofer
    - A request executor module
    - A set of pluggable transport modules
    - An extensible client configuration mechanism


•   Development sponsored by Shopzilla.com
Gofer Protocol
•   DBI::Gofer::Request & DBI::Gofer::Response
•   Simple blessed hashes
    - Request contains all required information to
      connect and execute the requested methods.
    - Response contains results from methods calls,
      including result sets (rows of data).
•   Serialized and transported by transport
    modules like DBI::Gofer::Transport::http
Using DBD::Gofer
•   Via DSN
    - By adding a prefix
    $dsn = “dbi:Driver:dbname”;
    $dsn = “dbi:Gofer:transport=foo;dsn=$dsn”;


•   Via DBI_AUTOPROXY environment variable
    - Automatically applies to all DBI connect calls
    $ export DBI_AUTOPROXY=“dbi:Gofer:transport=foo”;
    - No code changes required!
Gofer Transports
•   DBI::Gofer::Transport::null
    - The ‘null’ transport.
    - Serializes request object,
      transports it nowhere,
      then deserializes and passes it to
      DBI::Gofer::Execute to execute
    - Serializes response object,
      transports it nowhere,
      then deserializes and returns it to caller
  - Very useful for testing.
DBI_AUTOPROXY=“dbi:Gofer:transport=null”
Gofer Transports
•   DBD::Gofer::Transport::stream (ssh)
    - Can ssh to remote system to self-start server
       ssh -xq user@host.domain 
       perl -MDBI::Gofer::Transport::stream 
       -e run_stdio_hex
  - Automatically reconnects if required
  - ssh gives you security and optional compression
DBI_AUTOPROXY=’dbi:Gofer:transport=stream
;url=ssh:user@host.domain’
Gofer Transports
•   DBD::Gofer::Transport::http
    - Sends requests as http POST requests
    - Server typically Apache mod_perl running
      DBI::Gofer::Transport::http
    - Very flexible server-side configuration options
    - Can use https for security
    - Can use web techniques for scaling and high-
      availability. Will support web caching.
DBI_AUTOPROXY=’dbi:Gofer:transport=http
;url=http://example.com/gofer’
Gofer Transports
•   DBD::Gofer::Transport::gearman
    - Distributes requests to a pool of workers
    - Gearman a lightweight distributed job queue
      http://www.danga.com/gearman
    - Gearman is implemented by the same people who
      wrote memcached, perlbal, mogileFS, & DJabberd


DBI_AUTOPROXY=’dbi:Gofer:transport=gearman
;url=http://example.com/gofer’
Pooling via gearman vs http
• I haven’t compared them in use myself yet
+ Gearman may have lower latency
+ Gearman spreads load over multiple machines
  without need for load-balancer
+ Gearman coalescing may be beneficial
+ Gearman async client may work well with POE
- Gearman clients need to be told about servers
• More gearman info http://danga.com/words/
  2007_04_linuxfest_nw/linuxfest.pdf (p61+)
DBD::Gofer
• A proxy driver
• Aims to be as ‘transparent’ as possible
• Accumulates details of DBI method calls
• Delays forwarding request for as long as
  possible
• execute_array() is a single round-trip
• Policy mechanism allows fine-grained tuning
  to trade transparency for speed
DBD::Gofer::Policy::*
•   Three policies supplied: pedantic, classic, and
    rush. Classic is the default.
•   Policies are implemented as classes
•   Currently 22 individual items within a policy
•   Policy items can be dynamic methods
•   Policy is selected via DSN:
DBI_AUTOPROXY=“dbi:Gofer:transport=null
;policy=pedantic”
Round-trips per Policy
                             pedantic classic       rush
$dbh = DBI->connect_cached   connect()     ✓
$dbh->ping                      ✓
                                          if not     if not
$dbh->quote                     ✓        default    default

$sth = $dbh->prepare            ✓
$sth->execute                   ✓          ✓          ✓
$sth->{NUM_OF_FIELDS}
$sth->fetchrow_array
                                                    cached
$dbh->tables                    ✓          ✓       after first
Error Handling
•   DBD::Gofer can automatically retry on failure
DBI_AUTOPROXY=“dbi:Gofer:transport=...;
retry_limit=3”
•   Default behaviour is to retry if
     $request->is_idemponent is true
    - looks at SQL, returns true for most SELECTs
•   Default is retry_limit=0, so disabled
•   You can define your own behaviour:
    DBI->connect(..., {
        go_retry_hook => sub { ... },
    });
Client-side Caching
•   DBD::Gofer can automatically cache results
DBI_AUTOPROXY=“dbi:Gofer:transport=null
;cache=CacheModuleName”
•   Default behaviour is to cache if
     $request->is_idemponent is true
      looks at SQL returns true for most SELECTs
•   Use any cache module with standard interface
      set($k,$v) and get($k)
•   You can define your own behaviour by
    subclassing
Server-side Caching
•   DBI::Gofer::Transport::* can automatically
    cache results
•   Use any cache module with standard interface
    - set($k,$v) and get($k)
•   You can define your own behaviour by
    subclassing
Gofer Caveats
•   Adds latency time cost per network round-trip
    - Can minimize round-trips by fine-tuning a policy
    - and/or using client-side caching
•   State-less-ness has implications...
    - No transactions, AutoCommit only, at the moment.
    - Can’t alter $dbh attributes after connect
    - Can’t use temp tables, locks, and other per-connection
      persistent state, except within a stored procedure
    - Code using last_insert_id needs a (simple) change
    - See the docs for a few other very obscure caveats
An Example
Using Gofer for Connection Pooling,
   Scaling, and High Availability
The Problem
    Apache
               40 worker processes per server
     Worker
     Worker
     Worker
     Worker
     Worker
                                  +vers
     Worker
     Worker
     Worker
     Worker
     Worker
                            150 ser
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker                                         Database
     Worker
     Worker                                          Server
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker

                             =
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Workers                1 overloaded database
-
A Solution
                        A ‘database proxy’ that
    Apache
     Worker
                        does connection pooling
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker                                             Database
     Worker
     Worker                                              Server
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
                                  Holds a few
     Worker
     Worker
     Worker
     Worker                    connections open
     Worker
     Worker
     Worker
     Worker
     Worker
     Workers
                                                    Repeat for all servers
-              Uses them to ser vice DBI requests
An Implementation
                 Standard apache+mod_perl
    Apache
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker                                   DBI + DBD::*
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
                           Apache

     Worker                                                  Database
     Worker
     Worker                                                   Server
     Worker
     Worker
     Worker                         !"#$%#&
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker                    DBI::Gofer::Execute and
     Worker
     Worker
     Worker
     Worker                  DBI::Gofer::Transport::http
     Workers
                          modules implement stateless proxy

-       DBD::Gofer with http transport
Load Balance and Cache
                                                                                                                Load balancing
 server                                                                                                         and fail-over




                                                                Apache running DBI Gofer
  with
   40
workers
                                                                                                                         Far fewer db

                                 HTTP Load Balancer and Cache
                                                                                                                         connections
                                                                                           Workers



   x          Many = 6000 db
  150         web                                                                                    Gofer          Database
                   connections
              servers                                                                                Servers         Server
servers


                                                                Apache running DBI Gofer




                                                                                           Workers


                                                                                                               Caching
   -                                          New middle tier
          Caching
Gofer’s Future
•   Caching for http transport
•   Optional JSON serialization
•   Caching in DBD::Gofer (now done)
•   Make state-less-ness of transport optional
    to support transactions
•   Patches welcome!
Future: http caching
• Potential big win
• DBD::Gofer needs to indicate cache-ability
 - via appropriate http headers
• Server side needs to agree
 - and respond with appropriate http headers
• Caching then happens just like for web pages
 - if there’s a web cache between client and server
• Patches welcome!
Future: JSON
• Turns DBI into a web service!
 - Service Oriented Architecture anyone?
• Accessible to anything that can talk JSON
• Clients could be JavaScript, Java, ...
 - and various languages that begin with P ...
• Patches welcome!
Future: Transactions
• State-less-ness could be made optional
 - If transport layer being used agrees
 - Easiest to implement for stream / ssh
• Would be enabled by
    AutoCommit => 0
    $dbh->begin_work
• Patches welcome!
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Tim Bunce
 
Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011CodeIgniter Conference
 
Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011Tim Bunce
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueGleicon Moraes
 
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientBuilding Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientMike Friedman
 
On UnQLite
On UnQLiteOn UnQLite
On UnQLitecharsbar
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layerKiyoto Tamura
 
Programming Hive Reading #4
Programming Hive Reading #4Programming Hive Reading #4
Programming Hive Reading #4moai kids
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUNCong Zhang
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in PerlLaurent Dami
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaJon Moore
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
Node.js streaming csv downloads proxy
Node.js streaming csv downloads proxyNode.js streaming csv downloads proxy
Node.js streaming csv downloads proxyIsmael Celis
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talkLocaweb
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117exsuns
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev ConfTom Croucher
 

Was ist angesagt? (20)

Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
 
Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011Bottom to Top Stack Optimization - CICON2011
Bottom to Top Stack Optimization - CICON2011
 
Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
 
RestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message QueueRestMQ - HTTP/Redis based Message Queue
RestMQ - HTTP/Redis based Message Queue
 
Building Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::ClientBuilding Scalable, Distributed Job Queues with Redis and Redis::Client
Building Scalable, Distributed Job Queues with Redis and Redis::Client
 
On UnQLite
On UnQLiteOn UnQLite
On UnQLite
 
Fluentd unified logging layer
Fluentd   unified logging layerFluentd   unified logging layer
Fluentd unified logging layer
 
Programming Hive Reading #4
Programming Hive Reading #4Programming Hive Reading #4
Programming Hive Reading #4
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Roll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and LuaRoll Your Own API Management Platform with nginx and Lua
Roll Your Own API Management Platform with nginx and Lua
 
Tuning Solr for Logs
Tuning Solr for LogsTuning Solr for Logs
Tuning Solr for Logs
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Top Node.js Metrics to Watch
Top Node.js Metrics to WatchTop Node.js Metrics to Watch
Top Node.js Metrics to Watch
 
Fluentd meetup at Slideshare
Fluentd meetup at SlideshareFluentd meetup at Slideshare
Fluentd meetup at Slideshare
 
Node.js streaming csv downloads proxy
Node.js streaming csv downloads proxyNode.js streaming csv downloads proxy
Node.js streaming csv downloads proxy
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 
Hadoop 20111117
Hadoop 20111117Hadoop 20111117
Hadoop 20111117
 
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
Using Node.js to  Build Great  Streaming Services - HTML5 Dev ConfUsing Node.js to  Build Great  Streaming Services - HTML5 Dev Conf
Using Node.js to Build Great Streaming Services - HTML5 Dev Conf
 

Ähnlich wie DBD::Gofer 200809

Gofer 200707
Gofer 200707Gofer 200707
Gofer 200707oscon2007
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderSadayuki Furuhashi
 
JClouds at San Francisco Java User Group
JClouds at San Francisco Java User GroupJClouds at San Francisco Java User Group
JClouds at San Francisco Java User GroupMarakana Inc.
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009Jason Davies
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ TokopediaQasim Zaidi
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemdelagoya
 
Oozie sweet
Oozie sweetOozie sweet
Oozie sweetmislam77
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best PracticesEric Bottard
 
Going Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGoing Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGeorge Tourkas
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoidrobin_sy
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleSean Chittenden
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case Kai Sasaki
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance DrupalJeff Geerling
 

Ähnlich wie DBD::Gofer 200809 (20)

Os Bunce
Os BunceOs Bunce
Os Bunce
 
Gofer 200707
Gofer 200707Gofer 200707
Gofer 200707
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
JClouds at San Francisco Java User Group
JClouds at San Francisco Java User GroupJClouds at San Francisco Java User Group
JClouds at San Francisco Java User Group
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
 
October 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.xOctober 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.x
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Couchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problemCouchdb: No SQL? No driver? No problem
Couchdb: No SQL? No driver? No problem
 
Oozie sweet
Oozie sweetOozie sweet
Oozie sweet
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Cloud Best Practices
Cloud Best PracticesCloud Best Practices
Cloud Best Practices
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
Going Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGoing Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAM
 
Web Optimization Level: Paranoid
Web Optimization Level: ParanoidWeb Optimization Level: Paranoid
Web Optimization Level: Paranoid
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at ScaleCreating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
SQL Saturday San Diego
SQL Saturday San DiegoSQL Saturday San Diego
SQL Saturday San Diego
 
MongoDB
MongoDBMongoDB
MongoDB
 

Mehr von Tim Bunce

Perl6 DBDI YAPC::EU 201008
Perl6 DBDI YAPC::EU 201008Perl6 DBDI YAPC::EU 201008
Perl6 DBDI YAPC::EU 201008Tim Bunce
 
Perl 6 DBDI 201007 (OUTDATED, see 201008)
Perl 6 DBDI 201007 (OUTDATED, see 201008)Perl 6 DBDI 201007 (OUTDATED, see 201008)
Perl 6 DBDI 201007 (OUTDATED, see 201008)Tim Bunce
 
DBI Advanced Tutorial 2007
DBI Advanced Tutorial 2007DBI Advanced Tutorial 2007
DBI Advanced Tutorial 2007Tim Bunce
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Tim Bunce
 
Perl Myths 200909
Perl Myths 200909Perl Myths 200909
Perl Myths 200909Tim Bunce
 
DashProfiler 200807
DashProfiler 200807DashProfiler 200807
DashProfiler 200807Tim Bunce
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007Tim Bunce
 
Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Tim Bunce
 

Mehr von Tim Bunce (8)

Perl6 DBDI YAPC::EU 201008
Perl6 DBDI YAPC::EU 201008Perl6 DBDI YAPC::EU 201008
Perl6 DBDI YAPC::EU 201008
 
Perl 6 DBDI 201007 (OUTDATED, see 201008)
Perl 6 DBDI 201007 (OUTDATED, see 201008)Perl 6 DBDI 201007 (OUTDATED, see 201008)
Perl 6 DBDI 201007 (OUTDATED, see 201008)
 
DBI Advanced Tutorial 2007
DBI Advanced Tutorial 2007DBI Advanced Tutorial 2007
DBI Advanced Tutorial 2007
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
Perl Myths 200909
Perl Myths 200909Perl Myths 200909
Perl Myths 200909
 
DashProfiler 200807
DashProfiler 200807DashProfiler 200807
DashProfiler 200807
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007
 
Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)Perl Myths 200802 with notes (OUTDATED, see 200909)
Perl Myths 200802 with notes (OUTDATED, see 200909)
 

Kürzlich hochgeladen

Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...amitlee9823
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Sheetaleventcompany
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceDamini Dixit
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture conceptP&CO
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfAdmir Softic
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLkapoorjyoti4444
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756dollysharma2066
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...lizamodels9
 
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000dlhescort
 

Kürzlich hochgeladen (20)

Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
Call Girls Electronic City Just Call 👗 7737669865 👗 Top Class Call Girl Servi...
 
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Nelamangala Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
Call Girls Zirakpur👧 Book Now📱7837612180 📞👉Call Girl Service In Zirakpur No A...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort ServiceEluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
Eluru Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Escort Service
 
Business Model Canvas (BMC)- A new venture concept
Business Model Canvas (BMC)-  A new venture conceptBusiness Model Canvas (BMC)-  A new venture concept
Business Model Canvas (BMC)- A new venture concept
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabiunwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
unwanted pregnancy Kit [+918133066128] Abortion Pills IN Dubai UAE Abudhabi
 
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRLBAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
BAGALUR CALL GIRL IN 98274*61493 ❤CALL GIRLS IN ESCORT SERVICE❤CALL GIRL
 
RSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors DataRSA Conference Exhibitor List 2024 - Exhibitors Data
RSA Conference Exhibitor List 2024 - Exhibitors Data
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Majnu Ka Tilla, Delhi Contact Us 8377877756
 
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
(Anamika) VIP Call Girls Napur Call Now 8617697112 Napur Escorts 24x7
 
Falcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in indiaFalcon Invoice Discounting platform in india
Falcon Invoice Discounting platform in india
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
Russian Call Girls In Gurgaon ❤️8448577510 ⊹Best Escorts Service In 24/7 Delh...
 
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
Call Girls In Majnu Ka Tilla 959961~3876 Shot 2000 Night 8000
 

DBD::Gofer 200809

  • 1. Gofer A scalable stateless proxy for DBI Tim.Bunce@pobox.com - September 2008
  • 2. DBI Layer Cake Application DBI DBD::Foo Database API Database
  • 3. New Layers Application Gofer Transport DBI DBI DBD::Gofer DBD::Foo Gofer Transport Database API Database
  • 4. Gofer gives you... Few Application round-trips Gofer Transport DBI DBI DBD::Gofer DBD::Foo Gofer Transport Stateless protocol Server-side Database DBD caching Client-side only needed caching on server Pluggable Retry on Configure transports Flexible and easy to extend error via DSN ssh, http, etc... e.g. DBIx::Router
  • 5. DBD::Proxy vs DBD::Gofer DBD::Proxy DBD::Gofer Supports transactions ✓ ✗(not yet) Supports very large results ✓ ✗(memory) Large test suite ✗ ✓ Minimal round-trips ✗ ✓ Automatic retry on error ✗ ✓ Modular & Pluggable classes ✗ ✓ Tunable via Policies ✗ ✓ Scalable ✗ ✓ Connection pooling ✗ ✓ Client-side caching ✗ ✓ Server-side caching ✗ ✓
  • 6. Gofer, logically • Gofer is - A scalable stateless proxy architecture for DBI - Transport independent - Highly configurable on client and server side - Efficient, in CPU time and minimal round-trips - Well tested - Scalable - Cacheable - Simple and reliable
  • 7. Gofer, structurally • Gofer is - A simple stateless request/response protocol - A DBI proxy driver: DBD::Gofer - A request executor module - A set of pluggable transport modules - An extensible client configuration mechanism • Development sponsored by Shopzilla.com
  • 8. Gofer Protocol • DBI::Gofer::Request & DBI::Gofer::Response • Simple blessed hashes - Request contains all required information to connect and execute the requested methods. - Response contains results from methods calls, including result sets (rows of data). • Serialized and transported by transport modules like DBI::Gofer::Transport::http
  • 9. Using DBD::Gofer • Via DSN - By adding a prefix $dsn = “dbi:Driver:dbname”; $dsn = “dbi:Gofer:transport=foo;dsn=$dsn”; • Via DBI_AUTOPROXY environment variable - Automatically applies to all DBI connect calls $ export DBI_AUTOPROXY=“dbi:Gofer:transport=foo”; - No code changes required!
  • 10. Gofer Transports • DBI::Gofer::Transport::null - The ‘null’ transport. - Serializes request object, transports it nowhere, then deserializes and passes it to DBI::Gofer::Execute to execute - Serializes response object, transports it nowhere, then deserializes and returns it to caller - Very useful for testing. DBI_AUTOPROXY=“dbi:Gofer:transport=null”
  • 11. Gofer Transports • DBD::Gofer::Transport::stream (ssh) - Can ssh to remote system to self-start server ssh -xq user@host.domain perl -MDBI::Gofer::Transport::stream -e run_stdio_hex - Automatically reconnects if required - ssh gives you security and optional compression DBI_AUTOPROXY=’dbi:Gofer:transport=stream ;url=ssh:user@host.domain’
  • 12. Gofer Transports • DBD::Gofer::Transport::http - Sends requests as http POST requests - Server typically Apache mod_perl running DBI::Gofer::Transport::http - Very flexible server-side configuration options - Can use https for security - Can use web techniques for scaling and high- availability. Will support web caching. DBI_AUTOPROXY=’dbi:Gofer:transport=http ;url=http://example.com/gofer’
  • 13. Gofer Transports • DBD::Gofer::Transport::gearman - Distributes requests to a pool of workers - Gearman a lightweight distributed job queue http://www.danga.com/gearman - Gearman is implemented by the same people who wrote memcached, perlbal, mogileFS, & DJabberd DBI_AUTOPROXY=’dbi:Gofer:transport=gearman ;url=http://example.com/gofer’
  • 14. Pooling via gearman vs http • I haven’t compared them in use myself yet + Gearman may have lower latency + Gearman spreads load over multiple machines without need for load-balancer + Gearman coalescing may be beneficial + Gearman async client may work well with POE - Gearman clients need to be told about servers • More gearman info http://danga.com/words/ 2007_04_linuxfest_nw/linuxfest.pdf (p61+)
  • 15. DBD::Gofer • A proxy driver • Aims to be as ‘transparent’ as possible • Accumulates details of DBI method calls • Delays forwarding request for as long as possible • execute_array() is a single round-trip • Policy mechanism allows fine-grained tuning to trade transparency for speed
  • 16. DBD::Gofer::Policy::* • Three policies supplied: pedantic, classic, and rush. Classic is the default. • Policies are implemented as classes • Currently 22 individual items within a policy • Policy items can be dynamic methods • Policy is selected via DSN: DBI_AUTOPROXY=“dbi:Gofer:transport=null ;policy=pedantic”
  • 17. Round-trips per Policy pedantic classic rush $dbh = DBI->connect_cached connect() ✓ $dbh->ping ✓ if not if not $dbh->quote ✓ default default $sth = $dbh->prepare ✓ $sth->execute ✓ ✓ ✓ $sth->{NUM_OF_FIELDS} $sth->fetchrow_array cached $dbh->tables ✓ ✓ after first
  • 18. Error Handling • DBD::Gofer can automatically retry on failure DBI_AUTOPROXY=“dbi:Gofer:transport=...; retry_limit=3” • Default behaviour is to retry if $request->is_idemponent is true - looks at SQL, returns true for most SELECTs • Default is retry_limit=0, so disabled • You can define your own behaviour: DBI->connect(..., { go_retry_hook => sub { ... }, });
  • 19. Client-side Caching • DBD::Gofer can automatically cache results DBI_AUTOPROXY=“dbi:Gofer:transport=null ;cache=CacheModuleName” • Default behaviour is to cache if $request->is_idemponent is true looks at SQL returns true for most SELECTs • Use any cache module with standard interface set($k,$v) and get($k) • You can define your own behaviour by subclassing
  • 20. Server-side Caching • DBI::Gofer::Transport::* can automatically cache results • Use any cache module with standard interface - set($k,$v) and get($k) • You can define your own behaviour by subclassing
  • 21. Gofer Caveats • Adds latency time cost per network round-trip - Can minimize round-trips by fine-tuning a policy - and/or using client-side caching • State-less-ness has implications... - No transactions, AutoCommit only, at the moment. - Can’t alter $dbh attributes after connect - Can’t use temp tables, locks, and other per-connection persistent state, except within a stored procedure - Code using last_insert_id needs a (simple) change - See the docs for a few other very obscure caveats
  • 22. An Example Using Gofer for Connection Pooling, Scaling, and High Availability
  • 23. The Problem Apache 40 worker processes per server Worker Worker Worker Worker Worker +vers Worker Worker Worker Worker Worker 150 ser Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Database Worker Worker Server Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker = Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Workers 1 overloaded database -
  • 24. A Solution A ‘database proxy’ that Apache Worker does connection pooling Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Database Worker Worker Server Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Holds a few Worker Worker Worker Worker connections open Worker Worker Worker Worker Worker Workers Repeat for all servers - Uses them to ser vice DBI requests
  • 25. An Implementation Standard apache+mod_perl Apache Worker Worker Worker Worker Worker Worker Worker Worker Worker DBI + DBD::* Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Apache Worker Database Worker Worker Server Worker Worker Worker !"#$%#& Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker DBI::Gofer::Execute and Worker Worker Worker Worker DBI::Gofer::Transport::http Workers modules implement stateless proxy - DBD::Gofer with http transport
  • 26. Load Balance and Cache Load balancing server and fail-over Apache running DBI Gofer with 40 workers Far fewer db HTTP Load Balancer and Cache connections Workers x Many = 6000 db 150 web Gofer Database connections servers Servers Server servers Apache running DBI Gofer Workers Caching - New middle tier Caching
  • 27.
  • 28. Gofer’s Future • Caching for http transport • Optional JSON serialization • Caching in DBD::Gofer (now done) • Make state-less-ness of transport optional to support transactions • Patches welcome!
  • 29. Future: http caching • Potential big win • DBD::Gofer needs to indicate cache-ability - via appropriate http headers • Server side needs to agree - and respond with appropriate http headers • Caching then happens just like for web pages - if there’s a web cache between client and server • Patches welcome!
  • 30. Future: JSON • Turns DBI into a web service! - Service Oriented Architecture anyone? • Accessible to anything that can talk JSON • Clients could be JavaScript, Java, ... - and various languages that begin with P ... • Patches welcome!
  • 31. Future: Transactions • State-less-ness could be made optional - If transport layer being used agrees - Easiest to implement for stream / ssh • Would be enabled by AutoCommit => 0 $dbh->begin_work • Patches welcome!