Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

22
Supercharging MySQL and MariaDB with Plug-ins Antony T Curtis <[email protected] >

description

Slides for the presentation at SCaLE 12x Conference (21 Feb 2014) A quick introduction to popular plug-ins for MySQL/MariaDB and ideas for how to use plug-ins to supercharge MySQL/MariaDB.

Transcript of Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Page 1: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Supercharging MySQLand MariaDB with Plug-ins

Antony T Curtis <[email protected]>

Page 2: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

AuditAuthenticationDaemonFull-text ParserInformation SchemaReplicationStorage Engines.

Plug-ins types for MySQL / MariaDB

Page 3: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Plug-ins allow the server to be extendedin a controlled manner.

(third-party plugin types do exist too)

Page 4: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Plug-ins for Storage

InnoDB Storage EngineEveryone should be using it by default.Default in recent releases of MariaDB and MySQL

TokuDB Storage EngineSupports sustained inserts better.Available in MariaDB.

Page 5: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

OQGraph EngineSearch shortest path on modest graphs.More than 100k nodes/second search possible.

Plug-ins for Storage

Sphinx EngineConnects to distributed full-text search engine.

Connect Engine (MariaDB)FederatedX Engine (MySQL)

Page 6: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Replication Plugins:

Semi-Sync Replication(multiple implementations: Google/Facebook/Oracle)

Alternative replication sync options...

Heartbeat/observer

Page 7: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Information Schema Plugins:

Easier to write than Storage Engine plugins.

Can be used to bring in static data.

Can be used to bring in simple dynamic data.

Page 8: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

“Black Box” to plug in extra functionality intothe database server.

Page 9: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Audit Plugins:

Designed to be installed/uninstalled at run time.

Simple to write.

Syslog, log to table.

Page 10: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

How to supercharge MySQL/MariaDB?

Page 11: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

How to supercharge MySQL/MariaDB?

When everything else has been optimized,how to get the last extra bit of performance...

Page 12: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Plug-ins for Storage

Implementing a storage engine for bulk loadingdata.

OQGraph EngineExtend OQGraph for some custom traversal.

Page 13: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Audit Plugins:

May be used to send logs to another machine.May be used to monitor specific users.Poor man’s replication.Triggers.

Page 14: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

How to supercharge MySQL/MariaDB?

Reducing the number of round-trips.

Page 15: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

How to supercharge MySQL/MariaDB?

Reducing the number of round-trips.Stored Procedures are tricky to debug.

Page 16: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

How to supercharge MySQL/MariaDB?

Reducing the number of round-trips.Stored Procedures are tricky to debug.

No external stored procedures in MySQLbut ...

Page 17: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

Suggested ideas:Server health watch-dog.Run a Python program.Run a node.js instance.

mysqld

daemon

client

Page 18: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

Daemon Plugin for Python Idea:gevented with pure-Python MySQL client.XML-RPC Server.Can perform multi-statement transactions.

Page 19: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

Do:Lightweight processing.Data validation.Serve other protocols.

Do Not:Create many threads.“number crunching”.

Page 20: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

Do:Lightweight processing.Data validation.Serve other protocols.

Do Not:Create many threads.“number crunching”.

Database storage engines, such

as InnoDB *assume* that they are the only service

on a machine!

Page 21: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Daemon Plugins:

Limited by imagination!

Page 22: Supercharging MySQL and MariaDB with Plug-ins (SCaLE 12x)

Questions?

G+ page: http://goo.gl/7kev1C