SlideShare una empresa de Scribd logo
1 de 20
LSPE @Yahoo mysql-proxy ,[object Object],- Overview and architecture - Making The case for a proxy - Lua - Lua examples - The admin interface - currently known issues
Overview and Architecture ,[object Object]
Overview and Arhitecture Read only Load Balancing with multiple –proxy-read-only-backend-addresses option
Making The case for mysql-proxy ,[object Object]
No need to restart for configuration or behavioral changes. It all happens in real time.
Making the case for mysql-proxy ,[object Object]
Deny/allow queries based on DB or DB User.
Deny/allow based on a regex
Construct your own results set and return it to the application without ever actually querying the backend database.
LUA embedded
Making the case for a proxy ,[object Object]
Coded in C
implements connection pooling
Doesn't need to do NS lookups every time
Has never “crashed” on me so far!
Making the case for mysql-proxy Open source.
LUA ,[object Object]
Small: its whole distribution fits in a floppy disk.
Extensible; it is easy to interface with C code.
LUA ,[object Object]

Más contenido relacionado

La actualidad más candente

La actualidad más candente (18)

Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
My sql administration
My sql administrationMy sql administration
My sql administration
 
SQL – A Tutorial I
SQL – A Tutorial  ISQL – A Tutorial  I
SQL – A Tutorial I
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012
 
PPT
PPTPPT
PPT
 
MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher MuleSoft ESB Message Enricher
MuleSoft ESB Message Enricher
 
4.3 MySQL + PHP
4.3 MySQL + PHP4.3 MySQL + PHP
4.3 MySQL + PHP
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
Compress and decompress
Compress and decompressCompress and decompress
Compress and decompress
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Advance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.ServletAdvance Java Programming (CM5I) 6.Servlet
Advance Java Programming (CM5I) 6.Servlet
 
MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64MuleSoft ESB scatter-gather and base64
MuleSoft ESB scatter-gather and base64
 
Python (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network AutomationPython (Jinja2) Templates for Network Automation
Python (Jinja2) Templates for Network Automation
 
Python SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite DatabasePython SQite3 database Tutorial | SQlite Database
Python SQite3 database Tutorial | SQlite Database
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
 

Destacado

Website Development
Website DevelopmentWebsite Development
Website Development8i Creations
 
Mysql proxy presentation_yahoo
Mysql proxy presentation_yahooMysql proxy presentation_yahoo
Mysql proxy presentation_yahooChris Westin
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012Chris Westin
 
eCommerce Development
eCommerce DevelopmenteCommerce Development
eCommerce Development8i Creations
 

Destacado (6)

Website Development
Website DevelopmentWebsite Development
Website Development
 
Mysql proxy presentation_yahoo
Mysql proxy presentation_yahooMysql proxy presentation_yahoo
Mysql proxy presentation_yahoo
 
Deportes extremos
Deportes extremosDeportes extremos
Deportes extremos
 
LW
LWLW
LW
 
mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012mongodb-brief-intro-february-2012
mongodb-brief-intro-february-2012
 
eCommerce Development
eCommerce DevelopmenteCommerce Development
eCommerce Development
 

Similar a Mysql Proxy Presentation Yahoo

PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part IIFirdaus Adib
 
MySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseMySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseweigon
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerelliando dias
 
Kafka Connect - debezium
Kafka Connect - debeziumKafka Connect - debezium
Kafka Connect - debeziumKasun Don
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18Derek Downey
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Michael Renner
 
Scripts Python Dbapi
Scripts Python DbapiScripts Python Dbapi
Scripts Python DbapiAkramWaseem
 
Oracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOsama Mustafa
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLUlf Wendel
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionjulien pauli
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionFrederic Descamps
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
 
Mysql connection
Mysql connectionMysql connection
Mysql connectionbeben benzy
 
Multiple instances second method
Multiple instances second methodMultiple instances second method
Multiple instances second methodVasudeva Rao
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnddo_aki
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
Confoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesConfoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesDave Stokes
 
Diving into the Deep End - Kafka Connect
Diving into the Deep End - Kafka ConnectDiving into the Deep End - Kafka Connect
Diving into the Deep End - Kafka Connectconfluent
 
Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1AkramWaseem
 

Similar a Mysql Proxy Presentation Yahoo (20)

PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part II
 
MySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuseMySQL Proxy: Architecture and concepts of misuse
MySQL Proxy: Architecture and concepts of misuse
 
plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
 
Kafka Connect - debezium
Kafka Connect - debeziumKafka Connect - debezium
Kafka Connect - debezium
 
HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18HandsOn ProxySQL Tutorial - PLSC18
HandsOn ProxySQL Tutorial - PLSC18
 
Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014Postgres Vienna DB Meetup 2014
Postgres Vienna DB Meetup 2014
 
Scripts Python Dbapi
Scripts Python DbapiScripts Python Dbapi
Scripts Python Dbapi
 
Oracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLinkOracle to MySQL DatabaseLink
Oracle to MySQL DatabaseLink
 
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQLHTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
HTTP, JSON, JavaScript, Map&Reduce built-in to MySQL
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017MySQL Replication Evolution -- Confoo Montreal 2017
MySQL Replication Evolution -- Confoo Montreal 2017
 
Mysql connection
Mysql connectionMysql connection
Mysql connection
 
Multiple instances second method
Multiple instances second methodMultiple instances second method
Multiple instances second method
 
20141011 mastering mysqlnd
20141011 mastering mysqlnd20141011 mastering mysqlnd
20141011 mastering mysqlnd
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Confoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New FeaturesConfoo 2021 -- MySQL New Features
Confoo 2021 -- MySQL New Features
 
Diving into the Deep End - Kafka Connect
Diving into the Deep End - Kafka ConnectDiving into the Deep End - Kafka Connect
Diving into the Deep End - Kafka Connect
 
Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1Www Kitebird Com Articles Pydbapi Html Toc 1
Www Kitebird Com Articles Pydbapi Html Toc 1
 
Pydbapi
PydbapiPydbapi
Pydbapi
 

Más de Chris Westin

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productionengChris Westin
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalChris Westin
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera managerChris Westin
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcacheChris Westin
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspeChris Westin
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspeChris Westin
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012Chris Westin
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Chris Westin
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed TechnologyChris Westin
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkChris Westin
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica setsChris Westin
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionChris Westin
 
MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011Chris Westin
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011Chris Westin
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011Chris Westin
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2Chris Westin
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011Chris Westin
 

Más de Chris Westin (20)

Data torrent meetup-productioneng
Data torrent meetup-productionengData torrent meetup-productioneng
Data torrent meetup-productioneng
 
Gripshort
GripshortGripshort
Gripshort
 
Ambari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.finalAmbari hadoop-ops-meetup-2013-09-19.final
Ambari hadoop-ops-meetup-2013-09-19.final
 
Cluster management and automation with cloudera manager
Cluster management and automation with cloudera managerCluster management and automation with cloudera manager
Cluster management and automation with cloudera manager
 
Building low latency java applications with ehcache
Building low latency java applications with ehcacheBuilding low latency java applications with ehcache
Building low latency java applications with ehcache
 
SDN/OpenFlow #lspe
SDN/OpenFlow #lspeSDN/OpenFlow #lspe
SDN/OpenFlow #lspe
 
cfengine3 at #lspe
cfengine3 at #lspecfengine3 at #lspe
cfengine3 at #lspe
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
 
Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19Nimbula lspe-2012-04-19
Nimbula lspe-2012-04-19
 
Stingray - Riverbed Technology
Stingray - Riverbed TechnologyStingray - Riverbed Technology
Stingray - Riverbed Technology
 
MongoDB's New Aggregation framework
MongoDB's New Aggregation frameworkMongoDB's New Aggregation framework
MongoDB's New Aggregation framework
 
Replication and replica sets
Replication and replica setsReplication and replica sets
Replication and replica sets
 
Architecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage SolutionArchitecting a Scale Out Cloud Storage Solution
Architecting a Scale Out Cloud Storage Solution
 
FlashCache
FlashCacheFlashCache
FlashCache
 
Large Scale Cacti
Large Scale CactiLarge Scale Cacti
Large Scale Cacti
 
MongoDB: An Introduction - July 2011
MongoDB:  An Introduction - July 2011MongoDB:  An Introduction - July 2011
MongoDB: An Introduction - July 2011
 
Practical Replication June-2011
Practical Replication June-2011Practical Replication June-2011
Practical Replication June-2011
 
MongoDB: An Introduction - june-2011
MongoDB:  An Introduction - june-2011MongoDB:  An Introduction - june-2011
MongoDB: An Introduction - june-2011
 
Ganglia Overview-v2
Ganglia Overview-v2Ganglia Overview-v2
Ganglia Overview-v2
 
MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011MongoDB Aggregation MongoSF May 2011
MongoDB Aggregation MongoSF May 2011
 

Mysql Proxy Presentation Yahoo

  • 1.
  • 2.
  • 3. Overview and Arhitecture Read only Load Balancing with multiple –proxy-read-only-backend-addresses option
  • 4.
  • 5. No need to restart for configuration or behavioral changes. It all happens in real time.
  • 6.
  • 7. Deny/allow queries based on DB or DB User.
  • 9. Construct your own results set and return it to the application without ever actually querying the backend database.
  • 11.
  • 14. Doesn't need to do NS lookups every time
  • 15. Has never “crashed” on me so far!
  • 16. Making the case for mysql-proxy Open source.
  • 17.
  • 18. Small: its whole distribution fits in a floppy disk.
  • 19. Extensible; it is easy to interface with C code.
  • 20.
  • 21.
  • 22.
  • 23. Lua examples Deny all queries to any backend DB: function read_query(packet) if string.byte(packet) == proxy.COM_QUERY then local fields = { } local rows = { } fields = { { name = “ message from DBA ”, type =proxy.MYSQL_TYPE_STRING}, } rows[1] = { “ maintenance ”} proxy.respose = { type = proxy.MYSQLD_PACKET_OK, resultset = { fields = fields, rows = rows } } return proxy.PROXY_SEND_RESULT –means bypass backend, return to client now end end
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. Choose your backend DB based on which IP address, or which mysql user the client has.
  • 29. Modify result set by adding or removing a column from the returned table.
  • 30. Time your queries. Gather statistics.
  • 31. Your limits are that of the Lua language.
  • 32.
  • 33. Start mysql-proxy with admin options:
  • 38. The admin interface Function read_query(packet) If packet:byte() ~= proxy.COM_QUERY then return_error(“ [admin] we only handle COM_QUERY ”); --user defined end Local rows = { } local fields = { } – no need for a semicolon in Lua if packet:sub(2) == “ls” then – if query is an ls fields = { { name = “ backend_ndx ”, type = proxy.MYSQL_TYPE_LONG }, { name = “ address ” , type = proxy.MYSQL_TYPE_STRING } , { name = “ connected_clients ”, type = proxy.MYSQL_TYPE_LONG}, } for i = 1 , #proxy.global.backends do Local b = proxy.global.backends[i] rows[#rows + 1 ] = { i, b.dst.name, b.connected_clients } end end … Now build proxy.response and return with proxy.PROXY_SEND_RESULT
  • 39. The admin interface Querying the previously Lua coded interface will return: mysql>msyql -u root -ppassword -h 127.0.0.1 -P 10008 mysql> ls; +------------------+--------------------------+-------------------------+ | backend_ndx | address | connected_clients | +------------------+--------------------------+-------------------------+ | 1 | 192.168.1.9:3309 | 23 | +------------------+--------------------------+-------------------------+ | 2 | 192.168.1.10:3309 | 142 | +------------------+--------------------------+-------------------------+
  • 40.
  • 41. A bit complicated. Everything has to be coded by you.
  • 42. You need to know Lua well. (not a bad thing though)