原文:http://www.ibm.com/developerworks/library/os-beyondmysql/

Introduction

MySQL is one of the most popular free and open source programs in history. It's the database backbone for thousands of websites and could arguably be given credit (along with Linux®) for the explosive growth of the Internet over the past 10 years.

So, if MySQL is so important, why is increasing amount of high profile off-shoots of the core MySQL product? Because MySQL is free and open source, developers have always been able to take the code, modify it as they see fit, and distribute it on their own. For a long time, there weren't any branches of MySQL that a developer would trust in their own production environment. However, that's changing rapidly. Several branches are getting a lot of attention.

This article will discuss three popular branches of MySQL that are gaining attention: Drizzle, MariaDB, and Percona Server, including the XtraDB engine. This article will talk briefly about the reasons for each branch and their goals, and whether to use them in your own production environment. By the time you finish this article, you should be able to answer the question "Are these MySQL branch products a good solution for my environment?"

Why branch?

Why does MySQL need to be branched? That's a very legitimate question. Thousands of websites depend on it and it seems to be a good solution for many people. However, as is often the case, what's good for many people isn't good for all people. Some developers are motivated to make things better for their own needs. What could be better than turning a great solution into the perfect solution?

Let's get into more specific details about what these branches sought to change. Some branches felt that MySQL was becoming too bloated and was offering many features that would never interest users, at the expense of simplicity of performance. If people were perfectly happy with the more streamlined MySQL 4, why should they deal with the additional complexity that was added with MySQL 5? For this branch, a preferred branch of MySQL would be simpler and faster — offer less features, but make them extremely quick, keeping in mind a target audience, in this case high availability websites.

To other branches, MySQL wasn't offering enough new features, or were adding them too slowly. They may have felt that MySQL wasn't keeping up with its target markets of high availability websites running on multi-core processors with lots of RAM. As people familiar with MySQL know, it offers two different storage enginges — MyISAM and InnoDB. This branch felt that neither of these storage engines offered them exactly what they were looking for, so they created a new storage engine perfectly suited for their goals.

Further, some branches have a top goal to be a "drop in" replacement to MySQL, where you could simply drop in their branch and not have to change one line of code. The branch uses the same code and interfaces as MySQL, making a transition as easy as possible. Yet, another branch boasts that it's not compatible with MySQL, requiring code changes. Each branch is also at a different maturity level, with some claiming they are production ready, and some claiming they are far from that goal at this point.

Finally, there's uncertainty about how MySQL will fare under Oracle. Oracle bought Sun, who bought MySQL, and right now Oracle controls the MySQL product itself, and leads the development community in producing new finished products. Because Oracle already has a commercial database, there is concern that they may not put sufficient resources into MySQL to keep it cutting-edge. Therefore, many branches are also a result of the underlying fear that MySQL, the leading free and open source database, may see less features, slower release cycles, and more expensive support.

XtraDB

XtraDB is not a stand-alone product itself, but it is still considered a branch of MySQL. XtraDB is actually a storage engine for MySQL-based databases. This would be considered an additional storage engine to the standard MyISAM and InnoDB that are already a part of MySQL. MySQL 4 and 5 installs with each table using the default MyISAM storage engine. InnoDB is also a relatively newer option for a storage engine, and database administrators and developers can choose the types of storage engine, on a per table basis, when they set up the database. The major difference between the two storage engines is that MyISAM does not offer transactional support, while InnoDB does. Other differences are many small performance differences, with InnoDB offering many small performance improvements over MyISAM, and more reliability and safety when dealing with potential data loss. As it appears that InnoDB is the better-suited storage engine for future improvements, MySQL has switched the default storage engine to InnoDB instead of MyISAM starting with the 5.5 release.

Building on these advantages, the InnoDB storage engine itself has been branched into a newer storage engine called XtraDB. Just how new is this storage engine? It was first released less than 3 years ago by Percona. So, it's relatively new. It was designed specifically to deal with modern high availability websites running on modern servers. It was designed to run on servers with a dozen or more cores and lots of RAM (32 GB and more). These are the kinds of servers any company can order from a server management company, and therefore, a database should be designed to take full advantage of these servers.

The XtraDB branch had another goal — be a simple drop-in replacement for the InnoDB storage engine, so that users could simply switch their storage engine without having to change any of their underlying application code. XtraDB had to be backwards-compatible with InnoDB in addition to providing all the new features and improvements they wanted to add. They accomplished this goal.

How much faster is XtraDB? One performance test I found said that it offered 2.7x more transactions per minute than the built-in MySQL 5.1 InnoDB engine (See Resources). That's certainly not something to dismiss, especially considering it's drop-and-go.

Percona

XtraDB offers some great improvements over built-in MySQL storage engines, but it's not a stand-alone product, and nor is it something that you can simply drop into your existing MySQL installation. So, if you want to use this new storage engine, you have to use a product that offers it.

Percona Server is just such a product, put out by the leading MySQL consulting company, Percona. It's a stand-alone database product that offers users the ability to swap out their MySQL installation and swap in the Percona Server product, and by doing so, take advantage of the XtraDB storage engine. It makes the claim that it is fully compatible with MySQL, so in theory no code would have to change in your software. That's definitely a huge advantage, and great for quality control when you're looking for a quick performance improvement. So, a good reason for looking at Percona Server is to take advantage of the XtraDB engine with as few changes to your core code as possible.

Additionally, they are the original authors of the XtraDB storage engine. Percona open-sourced this code so you can find it in other products, but the original creators of the engine are the same ones who wrote this product. You can use this information as you wish.

Here are the purported claims of Percona Server, coming from their own website:

  • Scalability: Handles more transactions; scales up on powerful servers
  • Performance: Percona Server with XtraDB is blazingly fast
  • Reliability: Resilience to corruption, crash-safe replication
  • Management: Online backup, online table import/export
  • Diagnostics: Advanced profiling and instrumentation
  • Flexibility: Variable page size, improved buffer pool management

The final claim by the Percona team is that it is "the closest to the official MySQL Enterprise releases from Oracle", thereby differentiating it from the other branches who have changed more underlying core MySQL code. One negative to Percona Server is that they manage the code themselves, and don't accept contributions from outside developers without reviewing it first, ensuring that they control the features put into the product.

MariaDB

Another product that offers the XtraDB storage engine is the MariaDB product. It is very similar to the Percona product, but offers more underlying code changes in an effort to tweak out even more performance improvements over the standard MySQL. It utilizes the XtraDB engine directly from Percona, so there's no underlying differences in the storage engines each employ, since they utilize the same exact one.

Further, MariaDB offers the standard storage engines that MySQL offers, MyISAM and InnoDB. So, in effect, it can be considered a superset of MySQL, offering everything that MySQL does, and more. It also makes the claim that it's a drop-in replacement for MySQL, so you can install it with the knowledge that no underlying code changes would be necessary to switch from MySQL to MariaDB.

Finally, and perhaps most importantly, the lead creator of the MariaDB is Monty Widenius, the original creator of MySQL. Monty has formed a company to manage the development of MariaDB called Monty Program, which hires developers to write and improve the MariaDB product. This is potentially both a good and bad thing: it's good in that they are the lead in the features and bugs fixed with Maria, but it's potentially troublesome in that the company isn't revenue-focused, but rather product driven. Companies that don't generate revenue don't always last forever.

Drizzle

The final product we'll be looking at is Drizzle. Unlike the other two finished products we've looked at, Drizzle is a major departure from MySQL and even makes the claim that they are not a drop-and-go with MySQL. They are looking to make more major changes from MySQL and have a goal of providing a great solution to the high availability problem, even if that means changing aspects of MySQL that we are accustomed to.

On the company's FAQ page, reading through the questions further reinforces their underlying goals. They weren't happy with the changes made to the MySQL core after the 4.1 release, claiming that many developers didn't want that additional overhead. They admit that their product is not even an SQL-compliant relation database. That really is a departure from MySQL.

So, with such a major change from your accustomed-to MySQL, why should we even consider this product? Exactly for those same reasons — it's a major rewrite of the MySQL engines, with the features judged non-optimal and unneeded stripped out, and with much of the code rewritten to be optimized, even going so far as to switch from C to C++ for the code. And, it doesn't end there, this product has a specific target market in mind with its design — multi-core servers with lots of RAM, 64-bit machines running Linux, servers used in Cloud computing, servers hosting websites, servers getting tens of thousands of hits per minute. That's a pretty specific market. Is it too specific? Keep in mind how much money those types of companies spend on their databases currently — if they can install Drizzle instead of MySQL and cut their server costs in half that's a lot of money!

So, everyone should be using Drizzle then, right? Wait, as they point out repeatedly, it's not compatible with MySQL. Therefore, if you have an existing MySQL platform, there would be a lot of code rewriting in order to get it working properly within your environment.

Even though it requires extra work to get running and doesn't appear to be as quick and easy to use as Percona or MariaDB, I include Drizzle because, though it may not be your choice today, in a few years time, it will likely be some people's choice. Because the goal of this article is to raise your awareness of tools you'll be using in the future, this is a good opportunity to show you this product. Many leading DB experts believe that Drizzle will be the choice of high availability database installations in five years.

Drizzle is 100 percent open source and openly takes contributions from developers. There's no underlying company backing development of it like MariaDB, and it's not closed to outside contributions, like Percona. It's in a good position for growth and new features, which it may need, given its scope to rewrite a majority of MySQL.

Comparison chart

Here is a summary of the three MySQL branch products mentioned in this article.

Product Price Goal Main Feature Ready for Production?
Percona Server Free Provide a wrapper for XtraDB storage engine and additional analysis tools XtraDB Yes
MariaDB Free Extend MySQL to include XtraDB and other perfomance improvements XtraDB Yes
Drizzle Free Offer massive scalability and performance improvements over MySQL High-availability Yes

Conclusion

This article discussed three new branches of the MySQL product that aim to solve some issue they've identified with MySQL. All three are free and open source products themselves. You need to weigh the pros and cons of using them against what MySQL already offers. I believe, for nearly everyone reading this article, MySQL will still be the preferred choice for your database needs. I highly doubt very many readers of this article are the owners of websites getting 1,000,000 hits an hour. I want to stress that again — MySQL is still an incredibly great product that is a perfectly suitable database for most use cases.

However, for those of you who think your site requires more high availability, scalability, and perfomance than MySQL can currently offer, one of these three products may likely provide the solution you are looking for. Going further, if you feel that your site will become a billion-dollar idea, you might consider starting out with one of these three products, and thereby solve these types of problems before they ever start.

Finally, the root cause of these branches of MySQL is to change some underlying feature of MySQL that the authors felt they couldn't wait for MySQL to do themselves. Further, the spectre of Oracle hangs over the future of MySQL, and many developers, including the original developer of MySQL, are concerned about the future of the product and whether Oracle will show the devotion to the product that a leading-edge database requires. These are all valid concerns in my opinion, and for this reason, you should keep these three products in mind as we move into the future.

Beyond MySQL --Branching the popular database--转载的更多相关文章

  1. MySQL的表分区(转载)

    MySQL的表分区(转载) 一.什么是表分区 通俗地讲表分区是将一大表,根据条件分割成若干个小表.mysql5.1开始支持数据表分区了. 如:某用户表的记录超过了600万条,那么就可以根据入库日期将表 ...

  2. [MySQL] 中 Schema和Database的区别

    在MySQL中,schema和database是同义词. CREATE SCHEMA和CREATE DATABASE是等效的. 但是其他的数据库产品(几乎所有数据库)有所不同.在oracle数据库产品 ...

  3. Mysql常用命令行大全——转载

    转载地址:http://www.blogjava.net/supperchen/archive/2012/10/11/389340.html 第一招.mysql服务的启动和停止 net stop my ...

  4. 如何写一个数据库How do you build a database?(转载)

    转载自:http://www.reddit.com/r/Database/comments/27u6dy/how_do_you_build_a_database/ciggal8 Its a great ...

  5. MySQL5.1升级5.6后,执行grant出错:ERROR 2013 (HY000): Lost connection to MySQL server during query【转载】

    转载: MySQL5.5升级5.6后,执行grant出错:ERROR 2013 (HY000): Lost connection to -mysql教程-数据库-壹聚教程网http://www.111 ...

  6. mysql配置和管理(转载)

    MySQL的配置与管理 (2012-08-09 13:06:59) 转载▼ 标签: mysql 配置 管理 分类: MySQL 安装 yum -y install mysql-server   启动服 ...

  7. python Mysql数据库连接池组件封装(转载)

    以前一直在用Java来开发,数据库连接池等都是有组件封装好的,直接使用即可,最近在尝试Python的学习,碰到了和数据库打交道的问题,和数据库打交道我们都知道,数据库连接池必不可少,不然要么就是程序异 ...

  8. mysql 应用 持续更新2 转载

    作者:彼岸Queen旅行链接:https://www.zhihu.com/question/27334963/answer/266624031来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非 ...

  9. cmd连接mysql的方法详解(转载)

    连接:mysql -h主机地址 -u用户名 -p用户密码 (注:u与root可以不用加空格,其它也一样)断开:exit (回车) 创建授权:grant select on 数据库.* to 用户名@登 ...

随机推荐

  1. jquery通过ajax获取数据(优化、封装)

    下载页面查看: makeGrid.js   ,column.js  ,XiangMuGuanLi.aspx <div class="tb_container" id=&quo ...

  2. WCF学习笔记(一):WCF简介

    转:http://www.cnblogs.com/wengyuli/archive/2009/11/04/1595693.html MSDN上关于WCF给出如下注解: 设计 Windows Commu ...

  3. 换博客啦o(* ̄▽ ̄*)ブ啦啦啦啦啦

    csdn总挂···而且觉得这里比较好看啦啦啦啦啦 一键搬家真好用TUT不用贴原地址了呢

  4. C# 中的枚举类型 enum (属于值类型)

    原文 C# 中的枚举类型 enum (属于值类型) C# 支持两种特殊的值类型:枚举和结构. 声明枚举:声明时要声明所有可能的值. using System; using System.Collect ...

  5. HDU 3085 Nightmare Ⅱ 双向BFS

    题意:很好理解,然后注意几点,男的可以一秒走三步,也就是三步以内的都可以,鬼可以穿墙,但是人不可以,鬼是一次走两步 分析:我刚开始男女,鬼BFS三遍,然后最后处理答案,严重超时,然后上网看题解,发现是 ...

  6. Java中线程顺序执行

    现有线程threadone.threadtwo和threadthree,想要的运行顺序为threadone->threadtwo->threadthree,应该如何处理?这里需要用到一个简 ...

  7. [原创]使用squish打包与混淆cocos2d-x的lua脚本

    squish是一个开源的用于打包lua脚本的小工具,它的主要功能是将多个lua文件整合成一个文件,并在此基础上做压缩和混淆等处理,混淆和压缩后的代码可以直接被执行而不需要先做解压还原等操作. 它的gi ...

  8. 【译】 AWK教程指南 8处理多行数据

    awk 每次从数据文件中只读取一行数据进行处理.awk是依照其内置变量 RS(Record Separator) 的定义将文件中的数据分隔成一行一行的Record.RS 的默认值是 "\n& ...

  9. 2013年信1204-1-2班小学期<程序设计技能训练>作品

    int add(int x,int y) { return x+y; } 请写明题目,学号,姓名,班级,日期 程序要有详细的注释

  10. 解决adb问题的方法

    The connection to adb is down,and a server error has occured. 在网上找的那个高端方法根本不管用,来,试试我的方法.. 先装个360手机助手 ...