Technology Day 2011 MySQL & MariaDB


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Technology Day 2011 MySQL & MariaDB

  1. 1. MySQL & diaspora Dan-Claudiu DRAGOŞ
  2. 2. MySQL & diaspora A little bit of history…• MySQL first came into existence back in 1995 – well, I doubt it was the first relational database ever developed from scratch ;)• People began to use MySQL and to appreciate it when the Web turned from “presentation only” to the “interactive” paradigm – Version 3.23 released early 2001 was probably the most important milestone• Incremental development continued, new features were added – Version 4.0 : March 2003 – Version 4.1: October 2004 – Version 5.0: October 2005 – Version x.x: ... 2006? not quite! 2
  3. 3. MySQL & diaspora A little bit of history… (2)• Sun Microsystems buys MySQL in 2008 – At that time the main development seemed like it had lost some momentum – Version 5.1 was released in November 2008, 3 years after the previous major release; unfortunately it was full of severe bugs – The performance that made MySQL a winner on the web did not prove to be good enough for the demanding enterprise corporate environment – Version 6.0-alpha announced in 2009; it was never officially released – The source files from the CVS were later used to build a plugin-based database called “Drizzle” ( ) 3
  4. 4. MySQL & diaspora A little bit of history… (3)• Oracle buys Sun Microsystems in 2010 – The MySQL development strategy gets redefined – Version 5.5 was released in December 2010 – “Enterprise” no longer means “support” but also new closed-source features – Version 5.6 was announced and is currently available for developers to test – Experimental features are available at 4
  5. 5. MySQL & diaspora A little bit of history… (4)• Not everybody is happy with the current state – The current Oracle strategy is to focus the main development effort on the closed source features, monetize them and then maybe provide them to the community – Oracle has promised not to change the current dual licensing strategy until at least 2015 – One of the original MySQL developers (Monty Widenius) has forked the MySQL GPL source code; the new project is called MariaDB ( ) 5
  6. 6. MySQL & diaspora What is new in MySQL 5.5 ?• This is the first Oracle release• It comes in 2 flavors, the “community” (open source) and the “enterprise” (with closed source content)• The new common features are: – InnoDB is now the default storage engine – The InnoDB subsystem was improved for scalability (from a fixed thread count to a variable thread count to accommodate for faster I/O) – SMP support is better (atomic CPU instructions replacing use of mutexes) 6
  7. 7. MySQL & diaspora What is new in MySQL 5.5 ? (2)• New common features (continued) – Semi-synchronous replication (transactions ran on master end only after at least one slave acknowledges it) – Diagnostic improvements (better SHOW ENGINE INNODB STATUS, etc) – Extended Unicode support (utf16, utf32…) – SIGNAL / RESIGNAL keywords (used to send errors based on conditions, useful in stored procedures) – Enhancements regarding table partitioning 7
  8. 8. MySQL & diaspora What is new in MySQL 5.5 ? (3)• “Enterprise” (closed source) features: – Thread pool (probably the most marketed new feature by Oracle): this improves database scalability by improving the performance under heavy load – The benchmark from shows a 20x scalability improvement, not bad! 8
  9. 9. MySQL & diaspora What is new in MySQL 5.5 ? (4)• “Enterprise” (closed source) features (continued) – “Thread Pool” works by changing the paradigm from the “1 connection = 1 thread” to defining a fixed set of threads that take care of all the connections – This scalability trick obviously works if each of the requests imply a quite small processing effort (e.g. simple selects) – A GPL implementation of such feature is already present in MariaDB! 9
  10. 10. MySQL & diaspora What is new in MySQL 5.5 ? (5)• “Enterprise” (closed source) features (continued) – “Pluggable Authentication”; for now 2 plugins are provided – PAM and Active Directory (Windows) – This architecture allows for more plugins to be written, maybe interfacing with LDAP, Kerberos… name it – A GPL implementation is also present in MariaDB! (well, plugins are still to be written) 10
  11. 11. MySQL & diaspora What comes with MySQL 5.6• Quick description – Oracle advertises this release as being an incremental, more like a better 5.5 – It is available for download and test but it is not recommended for production environments ( )• The short list of improvements? – Better query optimizer – “NoSQL” type of access with memcached API – Better performance statistics (not covered here) – Better InnoDB (not covered here) – Better replication (not covered here) 11
  12. 12. MySQL & diaspora New in MySQL 5.6 (1)• Query Optimizer – Faster sorting for ORDER BY clauses on non-indexed columns with small LIMIT values – Index condition pushdown (“ICP”): CREATE TABLE person ( id INTEGER PRIMARY KEY, name VARCHAR(100), postalcode INTEGER, age INTEGER, key (postalcode, age) ); SELECT name FROM person WHERE postalcode BETWEEN 5000 AND 5500 AND age BETWEEN 21 AND 22; With ICP on a million row table the run time goes from seconds to milliseconds. 12
  13. 13. MySQL & diaspora New in MySQL 5.6 (2)• Query optimizer (continued) – Later materialization of subqueries and views in FROM clauses (evaluate subqueries only when needed) – EXPLAIN for INSERT, UPDATE and DELETE – Precomputed statistics (e.g. for deciding which index to use in a query); the statistics now “survive” server restarts and can be updated with ANALYZE – Optimizer tracing (TRACE keyword; it shows more data than EXPLAIN – how the query resolving plan was generated, decision making steps of the optimizer) 13
  14. 14. MySQL & diaspora New in MySQL 5.6 (3)• “NoSQL” type of access – The API is branded as “Not only SQL” – The InnoDB engine is directly accessed by a Memcached plugin ( ) – Existing memcached clients can be used; this access type obviously bypasses the SQL parser and is a low latency method of accessing the database – It can be used for key-value operations only – This is currently available as a separate download from 14
  15. 15. MySQL & diaspora MariaDB ?• Key points about MariaDB – MariaDB advertises itself as a “drop in” replacement for MySQL – Current stable version is 5.3; this is a actually a replacement for MySQL 5.1 – For MySQL 5.5 there will sometime be a Maria DB 5.5 release – The fact is that MariaDB 5.3 already includes most of the features of MySQL 5.5, including GPL versions of the enterprise, closed source ones 15
  16. 16. MySQL & diaspora MariaDB? (2)• Key points about MariaDB (continued) – It was released as GPL only – It includes all the open source features and patches from MySQL; it can only be better than the MySQL community version – It also includes a GPL drop-in replacement for InnoDB – It is sometimes considered to be more like “MySQL on steroids” due to the extra scalability features that are not available in the community MySQL version – It already comes with “NoSQL” type of access (HandlerSocket plugin) 16
  17. 17. MySQL & diaspora MariaDB? (3)• New things available in MariaDB only – Dynamic columns (have a column defined for one row or a couple of rows only) – Virtual columns (defined by a query run on the fixed columns) – Table elimination (query optimization: ignore tables specified in query that are not required for resolving; useful mostly when working with views) – Extended statistics (on user, client...) – Microsecond precision at SHOW PROCESSLIST 17
  18. 18. MySQL & diaspora Out of time!• Questions? 18