SlideShare a Scribd company logo
Gofer
A scalable stateless proxy for DBI




                                     1
Gofer, logically
• Gofer is
  - A scalable stateless proxy architecture for DBI
  - Transport independent
  - Highly configuable on client and server side
  - Efficient, in CPU time and minimal round-trips
  - Well tested
  - Scalable
  - Cachable
  - Simple and reliable


                                                      2
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

                                                   3
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




                                                    4
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!



                                                     5
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”

                                                 6
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’




                                                      7
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’


                                                   8
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’




                                                    9
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+)

                                                  10
DBD::Gofer
• A proxy driver
• Accumulates details of DBI method calls
• Delays forwarding request for as long as
    possible
•   Aims to be as ‘transparent’ as possible
•   Policy mechanism allows fine-grained tuning
    to trade transparency for speed
•   execute_array() is a single round-trip



                                                 11
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”




                                                    12
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




                                                                13
Gofer Caveats
• State-less-ness has implications
  - No transactions. AutoCommit only.
  - Can’t alter $dbh attributes after connect
  - Can’t use temp tables, locks, and other per-connection
    persistent state, except via stored procedures
  - Code using last_insert_id needs a (simple) change
  - See the docs for a few other very obscure caveats




                                                             14
An Example
Using Gofer for Connection Pooling




                                     15
The Problem
               40 worker processes per ser ver
    Apache

                                  +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
     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
                             1 overloaded database
     Worker
     Workers


-

                                                                16
A Solution
                        A ‘database proxy’ that
    Apache
                        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
     Worker                                              Database
     Worker
     Worker                                               Server
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
                                  Holds a few
     Worker
     Worker
     Worker
     Worker
     Worker
                               connections open
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Worker
     Workers
                                                    Repeat for all ser vers
               Uses them to ser vice DBI requests
-

                                                                              17
An Implementation
                 Standard apache+mod_perl
    Apache
     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
     Worker
     Worker
     Worker
                           Apache

     Worker                                                  Database
     Worker
     Worker                                                   Server
     Worker
     Worker
     Worker                         !quot;#$%#&
     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
     Worker
     Worker
     Workers
                          modules implement stateless proxy

-       DBD::Gofer with http transport

                                                                        18
Load Balance and Cache
                                                                                                           High performance
                                                                                                           load balancing
 server




                                                            Apache running DBI Gofer
                                                                                                           and fail-over
  with
   40
workers
                                                                                                                   Far fewer db

                             HTTP Load Balancer and Cache
                                                                                                                   connections
                                                                                       Workers



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


                                                            Apache running DBI Gofer




                                                                                       Workers

                                                                                                           Caching results would
                                                                                                           reduce db load even
                                                                                                           further (not yet implemented)
   -                                      New middle tier

                                                                                                                                       19
Error Handling
• DBD::Gofer can automatically retry on failure
DBI_AUTOPROXY=“dbi:Gofer:transport=null
;retry_limit=3”
• Default behaviour is to retry if
                                      is true
     $request->is_idemponent
  - 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 { ... },
  });



                                                  20
DBD::Proxy vs DBD::Gofer
                                    DBD::Proxy   DBD::Gofer
                                        !
      Supports transactions                       !(not yet)
                                        !
   Supports very large results                   !(memory)
                                                      !
    Automatic retry on error            !
                                                      !
         Large test suite               !
                                                      !
       Minimal round-trips              !
                                                      !
   Modular & Pluggable classes          !
                                                      !
       Tunable via Policies             !
                                                      !
            Scalable                    !
                                                      !
       Connection pooling               !
Can support client and web caches                 !(not yet)
                                        !


                                                               21
Gofer’s Future
• Caching for http transport
• Optional JSON serialization
• Caching in DBD::Gofer
• Make state-less-ness optional
• Patches welcome!



                                  22
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!
                                                      23
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 or
• Patches welcome!

                                                24
Future: Client Caching
• DBD::Gofer could access a cache
 - Use serialized request as key to cache
 - If entry found then return that response
•Plug-able caching
 - Would include memcached to give a
   distributed shared cache
• Patches welcome!

                                              25
Future: Transactions
• State-less-ness could be made optional
 - If transport layer being used agrees
 - For http that means KeepAlive
 - Easiest to implement for stream / ssh
•Would be enabled by
    AutoCommit => 0
    $dbh->begin_work

• Patches welcome!
                                           26
Questions?


             27

More Related Content

What's hot

How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
Siddhartha Reddy Kothakapu
 
Ruby on Rails 2.1 What's New
Ruby on Rails 2.1 What's NewRuby on Rails 2.1 What's New
Ruby on Rails 2.1 What's New
Libin Pan
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Securityamiable_indian
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
Ben Ramsey
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
mattmatt
 
Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Jonathan Dahl
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleRaimonds Simanovskis
 
Varnish 4 cool features
Varnish 4 cool featuresVarnish 4 cool features
Varnish 4 cool features
Emanuelis Norbutas
 
Distributed Ruby and Rails
Distributed Ruby and RailsDistributed Ruby and Rails
Distributed Ruby and RailsWen-Tien Chang
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
Dave Cross
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
dosire
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
Perrin Harkins
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
Sadayuki Furuhashi
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
Perrin Harkins
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
Wallace Reis
 
Php assíncrono com_react_php
Php assíncrono com_react_phpPhp assíncrono com_react_php
Php assíncrono com_react_php
Renato Lucena
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
Gabriele Lana
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
Fastly
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
Tatsuhiko Miyagawa
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
jeresig
 

What's hot (20)

How Flipkart scales PHP
How Flipkart scales PHPHow Flipkart scales PHP
How Flipkart scales PHP
 
Ruby on Rails 2.1 What's New
Ruby on Rails 2.1 What's NewRuby on Rails 2.1 What's New
Ruby on Rails 2.1 What's New
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Security
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
 
Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)Asynchronous Processing with Ruby on Rails (RailsConf 2008)
Asynchronous Processing with Ruby on Rails (RailsConf 2008)
 
Fast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on OracleFast Web Applications Development with Ruby on Rails on Oracle
Fast Web Applications Development with Ruby on Rails on Oracle
 
Varnish 4 cool features
Varnish 4 cool featuresVarnish 4 cool features
Varnish 4 cool features
 
Distributed Ruby and Rails
Distributed Ruby and RailsDistributed Ruby and Rails
Distributed Ruby and Rails
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
 
A reviravolta do desenvolvimento web
A reviravolta do desenvolvimento webA reviravolta do desenvolvimento web
A reviravolta do desenvolvimento web
 
Php assíncrono com_react_php
Php assíncrono com_react_phpPhp assíncrono com_react_php
Php assíncrono com_react_php
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
 

Viewers also liked

Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifmoscon2007
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5oscon2007
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Touroscon2007
 
Dynamic nested clustering for parallel phy layer processing in cloud-ra ns
Dynamic nested clustering for parallel phy layer processing in cloud-ra nsDynamic nested clustering for parallel phy layer processing in cloud-ra ns
Dynamic nested clustering for parallel phy layer processing in cloud-ra ns
ieeepondy
 

Viewers also liked (8)

Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 
Ndp Slides
Ndp SlidesNdp Slides
Ndp Slides
 
Dynamic nested clustering for parallel phy layer processing in cloud-ra ns
Dynamic nested clustering for parallel phy layer processing in cloud-ra nsDynamic nested clustering for parallel phy layer processing in cloud-ra ns
Dynamic nested clustering for parallel phy layer processing in cloud-ra ns
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Lamothe
Os LamotheOs Lamothe
Os Lamothe
 

Similar to Os Bunce

Gofer 200707
Gofer 200707Gofer 200707
Gofer 200707oscon2007
 
DBD::Gofer 200809
DBD::Gofer 200809DBD::Gofer 200809
DBD::Gofer 200809
Tim Bunce
 
Oozie sweet
Oozie sweetOozie sweet
Oozie sweet
mislam77
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
Evaldo Felipe
 
Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416
Chicago Hadoop Users Group
 
October 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.xOctober 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.x
Yahoo Developer Network
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBMongoDB
 
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for HadoopMay 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
Yahoo Developer Network
 
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
Sadayuki Furuhashi
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
Qasim Zaidi
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
Workhorse Computing
 
Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?
Adam Hodowany
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
PloneFoundation
 
HyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQLHyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQL
Evan Volgas
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructure
Michaël Lopez
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
Flowdock
 

Similar to Os Bunce (20)

Gofer 200707
Gofer 200707Gofer 200707
Gofer 200707
 
DBD::Gofer 200809
DBD::Gofer 200809DBD::Gofer 200809
DBD::Gofer 200809
 
Oozie sweet
Oozie sweetOozie sweet
Oozie sweet
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
Dev ops for developers
Dev ops for developersDev ops for developers
Dev ops for developers
 
DevOps for Developers
DevOps for DevelopersDevOps for Developers
DevOps for Developers
 
Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416Hadoop in a Windows Shop - CHUG - 20120416
Hadoop in a Windows Shop - CHUG - 20120416
 
October 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.xOctober 2013 HUG: Oozie 4.x
October 2013 HUG: Oozie 4.x
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for HadoopMay 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
May 2012 HUG: Oozie: Towards a scalable Workflow Management System for Hadoop
 
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
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
 
HyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQLHyperDB, MySQL Performance, & Flavors of MySQL
HyperDB, MySQL Performance, & Flavors of MySQL
 
Chef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructureChef - industrialize and automate your infrastructure
Chef - industrialize and automate your infrastructure
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 

More from oscon2007

Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Moleoscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashearsoscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swposcon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Mythsoscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholisticoscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillipsoscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdatedoscon2007
 
Adventures In Copyright Reform
Adventures In Copyright ReformAdventures In Copyright Reform
Adventures In Copyright Reformoscon2007
 
Railsconf2007
Railsconf2007Railsconf2007
Railsconf2007oscon2007
 
Oscon Mitchellbaker
Oscon MitchellbakerOscon Mitchellbaker
Oscon Mitchellbakeroscon2007
 
Os Pruett Sessionnotes
Os Pruett SessionnotesOs Pruett Sessionnotes
Os Pruett Sessionnotesoscon2007
 
Os Keyshacks
Os KeyshacksOs Keyshacks
Os Keyshacksoscon2007
 
Os Buncetutorial
Os BuncetutorialOs Buncetutorial
Os Buncetutorialoscon2007
 

More from oscon2007 (20)

Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 
Adventures In Copyright Reform
Adventures In Copyright ReformAdventures In Copyright Reform
Adventures In Copyright Reform
 
Railsconf2007
Railsconf2007Railsconf2007
Railsconf2007
 
Oscon Mitchellbaker
Oscon MitchellbakerOscon Mitchellbaker
Oscon Mitchellbaker
 
Os Sharp
Os SharpOs Sharp
Os Sharp
 
Os Pruett Sessionnotes
Os Pruett SessionnotesOs Pruett Sessionnotes
Os Pruett Sessionnotes
 
Os Keyshacks
Os KeyshacksOs Keyshacks
Os Keyshacks
 
Os Buncetutorial
Os BuncetutorialOs Buncetutorial
Os Buncetutorial
 
Os Napier
Os NapierOs Napier
Os Napier
 
Os Treat
Os TreatOs Treat
Os Treat
 

Recently uploaded

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 

Recently uploaded (20)

Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

Os Bunce

  • 1. Gofer A scalable stateless proxy for DBI 1
  • 2. Gofer, logically • Gofer is - A scalable stateless proxy architecture for DBI - Transport independent - Highly configuable on client and server side - Efficient, in CPU time and minimal round-trips - Well tested - Scalable - Cachable - Simple and reliable 2
  • 3. 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 3
  • 4. 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 4
  • 5. 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! 5
  • 6. 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” 6
  • 7. 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’ 7
  • 8. 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’ 8
  • 9. 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’ 9
  • 10. 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+) 10
  • 11. DBD::Gofer • A proxy driver • Accumulates details of DBI method calls • Delays forwarding request for as long as possible • Aims to be as ‘transparent’ as possible • Policy mechanism allows fine-grained tuning to trade transparency for speed • execute_array() is a single round-trip 11
  • 12. 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” 12
  • 13. 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 13
  • 14. Gofer Caveats • State-less-ness has implications - No transactions. AutoCommit only. - Can’t alter $dbh attributes after connect - Can’t use temp tables, locks, and other per-connection persistent state, except via stored procedures - Code using last_insert_id needs a (simple) change - See the docs for a few other very obscure caveats 14
  • 15. An Example Using Gofer for Connection Pooling 15
  • 16. The Problem 40 worker processes per ser ver Apache +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 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 1 overloaded database Worker Workers - 16
  • 17. A Solution A ‘database proxy’ that Apache 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 Worker Database Worker Worker Server Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Worker Holds a few Worker Worker Worker Worker Worker connections open Worker Worker Worker Worker Worker Worker Worker Worker Workers Repeat for all ser vers Uses them to ser vice DBI requests - 17
  • 18. An Implementation Standard apache+mod_perl Apache 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 Worker Worker Worker Apache Worker Database Worker Worker Server Worker Worker Worker !quot;#$%#& 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 Worker Worker Workers modules implement stateless proxy - DBD::Gofer with http transport 18
  • 19. Load Balance and Cache High performance load balancing server Apache running DBI Gofer and fail-over with 40 workers Far fewer db HTTP Load Balancer and Cache connections Workers x Many = 6000 db Gofer Database 150 web connections Server Servers servers servers Apache running DBI Gofer Workers Caching results would reduce db load even further (not yet implemented) - New middle tier 19
  • 20. Error Handling • DBD::Gofer can automatically retry on failure DBI_AUTOPROXY=“dbi:Gofer:transport=null ;retry_limit=3” • Default behaviour is to retry if is true $request->is_idemponent - 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 { ... }, }); 20
  • 21. DBD::Proxy vs DBD::Gofer DBD::Proxy DBD::Gofer ! Supports transactions !(not yet) ! Supports very large results !(memory) ! Automatic retry on error ! ! Large test suite ! ! Minimal round-trips ! ! Modular & Pluggable classes ! ! Tunable via Policies ! ! Scalable ! ! Connection pooling ! Can support client and web caches !(not yet) ! 21
  • 22. Gofer’s Future • Caching for http transport • Optional JSON serialization • Caching in DBD::Gofer • Make state-less-ness optional • Patches welcome! 22
  • 23. 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! 23
  • 24. 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 or • Patches welcome! 24
  • 25. Future: Client Caching • DBD::Gofer could access a cache - Use serialized request as key to cache - If entry found then return that response •Plug-able caching - Would include memcached to give a distributed shared cache • Patches welcome! 25
  • 26. Future: Transactions • State-less-ness could be made optional - If transport layer being used agrees - For http that means KeepAlive - Easiest to implement for stream / ssh •Would be enabled by AutoCommit => 0 $dbh->begin_work • Patches welcome! 26