The next most visible change are the additional storage engines that ship with MariaDB (enter
show storage engines;
for a list). These include the Aria, XtraDB (an enhanced and extended version of the InnoDB storage engine), PBXT, FederatedX (a drop-in replacement for Federated), OQGraph, and SphinxSE storage engines. All of these are available for MySQL; however, to use them, you need to compile or install them yourself. With MariaDB, they are part of the default install. All of the standard storage engines in MySQL (MyISAM, blackhole, CSV, Memory, etc.) are included in MariaDB.
The INFORMATION_SCHEMA has also been enhanced. MariaDB has added more data in various tables. For example, the INFORMATION_SCHEMA.PLUGINS table now has PLUGIN_MATURITY and PLUGIN_AUTH_VERSION columns, so you can see the version numbers of your plugins and whether a version you have installed is of stable, beta, or other quality.
The INFORMATION_SCHEMA.PROCESSLIST table has been given a new column, TIME_MS . This column provides the same information as the column TIME , but in units of milliseconds with microsecond precision.
The slow query log has also been improved. In MariaDB, you can set the verbosity, filter out queries you don’t want logged, and limit the logging rate (e.g., to log only a quarter or tenth of the queries). As with other new features, the default configuration has this extra functionality turned off to be compatible with the behavior of MySQL [1].
Other Changes
Other changes in MariaDB are not so visible, but they help to improve performance, give MariaDB more flexibility, or both. One example on the performance side is with the new “table elimination” feature. Often, when you have highly normalized data [2] in your database, “views” are used for convenience when querying the database.
A view is kind of like a saved query. You can think of it as a particular way of viewing the data in your database. Views are very handy when used properly, but they come with a performance cost. Every time you use a view, all of the tables to which it is connected are queried, even if your query doesn’t actually need to query one or more of them.
The table elimination feature in MariaDB is designed to detect when a query will not use certain tables and eliminate them from the query plan. The performance increase this provides can be dramatic (depending on your database usage).
If you use the MyISAM storage engine for your database tables, the segmented MyISAM key cache could benefit you. The MyISAM key cache can suffer from lock contention if you have many application threads accessing the cache. The segmented key cache alleviates this problem by dividing the key cache into a number of “segments.” Up to 64 segments can be specified. Not every application will benefit from this feature, but if key cache lock contention is a bottleneck, it is a great way to increase performance without any application changes. For compatibility, this feature is turned off by default.
One new feature in MariaDB that adds flexibility is virtual columns, which are columns that are calculated and updated “on the fly.” An early version of this feature was contributed to MySQL back in 2008 by Andrey Zhakov, but it never found its way into a stable release of MySQL.
Often, you want your applications to do all the calculations and have your database just hold the data. However, in some cases, pushing calculations down to the database layer can be beneficial. For example, if you have several applications interacting with the database, pushing some of the calculations down into the database might help simplify application development and enforce data integrity.
Other new features in MariaDB have been made to make the code more modular and prepare for future development. One example is with the new storage engine-specific CREATE table feature. Previously, if a storage engine wanted to implement a feature that required new options for the CREATE table command, a patch would have to be applied to that section of the server code.
Ideally, storage engine code should be isolated so that, if you add it and don’t use it, no other part of the server is affected. If storage engines patch other parts of the code, a new beta or alpha storage engine cannot be included safely in a stable release.
MariaDB now has a standard way for storage engines to extend the CREATE table statement that keeps the storage engine code isolated and independent. Now, new storage engines can be included earlier in development because, if you choose not to use it, there is no effect.
All of the above features and others are described in greater detail in the MariaDB Knowledgebase [3].
Compatibility
With MariaDB, every effort has been made to make all improvements and new features as seamless and as transparent to end users as possible so they don’t have to throw out all of their previous work. To this end:
Data and table definition files (.frm ) files are binary compatible.
All client APIs, protocols, and struct s are identical.
All filenames, binaries, paths, ports, sockets, and so on, are the same.
All MySQL connectors (PHP, Perl, Python, Java, MyODBC, Ruby, the MySQL C connector, etc.) work unchanged with MariaDB.
mysql-client packages work with MariaDB server and vice versa.
Therefore, for most cases, you can just uninstall MySQL and install MariaDB and you are good to go. If you use the same main version, you don’t need to convert any data files, just as when upgrading from one MySQL 5.1.x version to another.
Additionally, a lot of development and testing of the upgrade scripts (which update data files when such updating is required) has made it easier to upgrade from MySQL 5.0 to MariaDB 5.1 than from MySQL 5.0 to MySQL 5.1.
The standard policy for any new feature is this: If the feature would introduce a compatibility issue, the default MariaDB configuration for the feature will either turn it off entirely (as with segmented key cache) or configure it to behave like the equivalent version of MySQL.
Because enforcement of the standard policy is not always possible, some unavoidable incompatibilities exist between MariaDB and MySQL. For example, if you are using a binary-only storage engine library, it must be recompiled specifically for the version of MariaDB you are using because of some internal changes to the storage engine API. Also, some output, such as the slow query log and the results of the CHECKSUM TABLE command, are different. So, if your scripts parse this output, you might have to make some changes.
One last note about compatibility: If you start using any of the new features in or configuration options of MariaDB, you will not be able to go back easily to even an equivalent version of MySQL.
Conclusion
Your situation should determine whether you choose MariaDB over MySQL. If you have a support contract with Oracle, then the choice has already been made; they don’t support MariaDB. However, several companies, such as SkySQL, offer full 24/7 support for both MariaDB and MySQL.
MariaDB does trail behind the latest official MySQL version by anywhere from a few weeks to a few months, depending on how big the changes are between versions.
On the flip side, MariaDB includes many features you might find useful that you will not find in MySQL, and MariaDB eventually will have any new features introduced, after they’ve been vetted and tested extensively.
Another reason to choose MySQL over MariaDB is MySQL’s presence in the official repositories of just about every Linux distribution. Installing MySQL is a simple apt‑get or yum away from being installed. MariaDB is working toward inclusion in official repositories, but for now, it is only included in a few [6].
One reason to continue using MySQL is if you have a commercial license from Oracle that allows you incorporate MySQL into a closed source application. The MariaDB developers are bound by the terms of the GPL and cannot dual-license MariaDB.
Whichever database you ultimately choose, the competition between MariaDB and MySQL can only be good. After all, no one can say Microsoft’s Internet Explorer did not benefit from its long rivalry with Firefox.
การเปลี่ยนแปลงที่เห็นได้ชัดที่สุดคือการจัดเก็บเพิ่มเติมต่อไปว่า เรือที่มีเครื่องยนต์ MariaDB ( ระบุ
เครื่องยนต์ ; กระเป๋า
สำหรับแสดงรายการ ) เหล่านี้รวมถึงอาเรีย xtradb ( ปรับปรุงและขยายรุ่นของ InnoDB Storage Engine ) , pbxt federatedx , ( ลงแทนสหพันธ์ ) , oqgraph และเครื่องยนต์กระเป๋า sphinxse . ทั้งหมดเหล่านี้จะใช้ได้สำหรับ MySQL ; อย่างไรก็ตาม , ที่จะใช้พวกเขาคุณต้องรวบรวมหรือติดตั้งได้ด้วยตัวเอง กับ MariaDB , พวกเขาเป็นส่วนหนึ่งของการเริ่มต้นติดตั้ง ทั้งหมดของมาตรฐานเครื่องยนต์ MySQL จัดเก็บ ( MyISAM , หลุมดำ , CSV , หน่วยความจำ ฯลฯ ) จะรวมอยู่ใน information_schema MariaDB .
ยังได้รับการปรับปรุง mariadb has added more ของเขตได้ย่าง . ตัวอย่างเช่น information_schema .ตารางปลั๊กอินตอนนี้ได้ plugin_maturity และคอลัมน์ plugin_auth_version , เพื่อให้คุณสามารถดูหมายเลขรุ่นของปลั๊กอินของคุณและไม่ว่าจะเป็นรุ่นที่คุณได้ติดตั้งเป็นเบต้าคงที่หรือคุณภาพอื่น ๆ .
โต๊ะ information_schema.processlist ได้รับคอลัมน์ใหม่ time_ms . คอลัมน์นี้เป็นคอลัมน์มีข้อมูลเดียวกัน เวลาแต่ในหน่วยมิลลิวินาทีกับวินาทีแน่นอน
ถามช้าเข้าสู่ระบบนอกจากนี้ยังได้รับการปรับปรุง ใน MariaDB , คุณสามารถตั้งค่าการใช้ถ้อยคำมากเกินไป , กรองแบบสอบถามคุณไม่ต้องการเข้าสู่ระบบ และจำกัดอัตราการบันทึก ( เช่นการเข้าสู่ระบบเพียงหนึ่งในสี่หรือหนึ่งในสิบของแบบสอบถาม ) ด้วยคุณสมบัติใหม่อื่น ๆการกําหนดค่าเริ่มต้นมีฟังก์ชันการทำงานพิเศษนี้ปิดให้เข้ากับพฤติกรรมของ MySQL [ 1 ] .
การเปลี่ยนแปลงอื่น ๆอื่น ๆ MariaDB ไม่ค่อยมองเห็น แต่พวกเขาช่วยปรับปรุงประสิทธิภาพ ให้มีความยืดหยุ่นมากขึ้น MariaDB , หรือทั้งสองอย่าง ตัวอย่างหนึ่งในด้านการแสดงกับใหม่ " ตารางขจัด " คุณลักษณะ มักจะเมื่อคุณมีรูปข้อมูล [ 2 ] ในฐานข้อมูลของคุณ " มุมมอง " ที่ใช้เพื่อความสะดวก เมื่อสอบถามฐานข้อมูล .
ดูเป็นเหมือนบันทึกแบบสอบถาม คุณสามารถคิดว่ามันเป็นวิธีการเฉพาะของการดูข้อมูลในฐานข้อมูลของคุณ มุมมองมีประโยชน์มากเมื่อใช้อย่างถูกต้อง แต่พวกเขามาพร้อมกับประสิทธิภาพของต้นทุน ทุกครั้งที่คุณใช้มุมมองทั้งหมดของตารางที่เชื่อมต่อจะถูกสอบถาม ถ้าแบบสอบถามของคุณไม่ต้องการหนึ่งหรือมากกว่าของพวกเขา .
โต๊ะตัดคุณลักษณะใน MariaDB ถูกออกแบบมาเพื่อตรวจสอบเมื่อแบบสอบถามจะไม่ใช้ตารางบางและขจัดพวกเขาจากแผนแบบสอบถาม the โรงหนัง คนนั้น this provides : dramatic ( ผม usage database your ) . เก็บกวาดเก็บกวาดถ้าคุณใช้ MyISAM กระเป๋าเครื่องมือสำหรับตารางฐานข้อมูลของคุณ แบ่ง MyISAM คีย์แคชอาจได้รับประโยชน์คุณ ใช้ MyISAM คีย์แคชสามารถประสบจากการล็อคการต่อสู้ถ้าคุณมีหลายโปรแกรมในกระทู้ การเข้าถึงแคช แคชคีย์แบ่ง ช่วยปัญหานี้ โดยแบ่งเป็นจำนวนแคชคีย์ " ส่วน " ถึง 64 กลุ่มสามารถระบุ .ไม่ทุกโปรแกรมจะได้รับประโยชน์จากคุณลักษณะนี้ แต่ถ้าคีย์ล็อคการแคชเป็นคอขวด มันเป็นวิธีที่ดีเพื่อเพิ่มประสิทธิภาพโดยไม่ต้องมีการเปลี่ยนแปลง เข้ากันได้ , คุณลักษณะนี้ถูกปิดโดยค่าเริ่มต้น .
หนึ่งคุณลักษณะใหม่ที่เพิ่มความยืดหยุ่นใน MariaDB คอลัมน์เสมือนซึ่งเป็นคอลัมน์ที่คำนวณและปรับปรุง " ในการบิน" รุ่นแรกของคุณลักษณะนี้ถูกสนับสนุน MySQL กลับไปในปี 2008 โดย Andrey zhakov แต่ไม่เคยพบทางลงรุ่นมั่นคงของ MySQL .
บ่อย คุณต้องการโปรแกรมประยุกต์ของคุณเพื่อทำการคำนวณทั้งหมด และมีฐานข้อมูลของคุณ แค่เก็บข้อมูล อย่างไรก็ตาม , ในบางกรณี , ผลักดันการคำนวณลงในฐานข้อมูลชั้นสามารถเป็นประโยชน์ ตัวอย่างเช่นถ้าคุณมีหลายโปรแกรมที่โต้ตอบกับฐานข้อมูลผลักดันบางส่วนของการคำนวณลงในฐานข้อมูลจะช่วยลดความซับซ้อนของการพัฒนาโปรแกรม และใช้ความสมบูรณ์ของข้อมูล คุณสมบัติใหม่อื่น ๆ
ใน MariaDB ได้ให้รหัสเพิ่มเติมโมดูลาร์และเตรียมพร้อมสำหรับอนาคตการพัฒนา ตัวอย่างหนึ่งคือที่มีเครื่องยนต์กระเป๋าใหม่ที่เฉพาะเจาะจง สร้างตารางคุณสมบัติ ก่อนหน้านี้อยู่ a storage engine ของตัวเองไม่วนเวียน a feature ไม่ options ผล for the create table command กับ patch ทันทีฉันถึงเดือนกันยายนเพื่อ section ลิฟต์และ code server . เก็บกวาดเก็บกวาดโทรมา storage engine code should : isolated so นั้นอยู่คลิป it ? ที่จะ it , no part 12 ของ server is ที่ได้รับผลกระทบ ถ้าเครื่องยนต์กระเป๋าแพทช์อื่น ๆชิ้นส่วนของรหัสใหม่เบต้าหรือ Alpha กระเป๋าเครื่องยนต์ไม่สามารถรวมอย่างปลอดภัยในรุ่นมั่นคง
MariaDB ได้มาตรฐานวิธีสำหรับกระเป๋าเครื่องมือขยายงบสร้างตารางที่ช่วยให้กระเป๋ารหัสเครื่องยนต์แยกอิสระและ ตอนนี้เครื่องมือที่เก็บใหม่สามารถรวมก่อนหน้านี้ในการพัฒนา เพราะถ้าคุณเลือกที่จะไม่ใช้มัน ไม่มีผล
คุณสมบัติทั้งหมดข้างต้นและอื่น ๆ จะอธิบายในรายละเอียดมากขึ้นใน MariaDB ฐานความรู้ [ 3 ] .
กับความเข้ากันได้ MariaDB , ทุกความพยายามได้รับการทำเพื่อให้ทั้งหมดของการปรับปรุงและคุณสมบัติใหม่เป็นอย่างราบรื่นและโปร่งใสให้กับผู้ใช้ที่เป็นไปได้เพื่อให้พวกเขาไม่ต้องโยนออกทั้งหมดของการทำงานของพวกเขาก่อนหน้านี้ สุดท้าย :
ข้อมูลและตารางนิยามไฟล์ ( .FRM ) ไฟล์ไบนารีที่เข้ากันได้ .
ลูกค้าทั้งหมด APIs , โปรโตคอล , และซอฟต์แวร์ที่เป็นเหมือนกัน
ทั้งหมดชื่อไฟล์ไบนารี , เส้นทาง , พอร์ต , sockets , และดังนั้นบน เป็นเหมือนกัน
การเชื่อมต่อ MySQL ทั้งหมด ( PHP , Perl , Python , Java , myodbc , ทับทิม , MySQL C เชื่อมต่อ ฯลฯ ) งานไม่เปลี่ยนแปลงกับ MariaDB .
MySQL ลูกค้าแพคเกจเซิร์ฟเวอร์ทำงานกับ MariaDB และในทางกลับกัน
ดังนั้นสำหรับกรณีส่วนใหญ่จากคุณ : uninstall mysql สํา mariadb เกม good to go . ถ้าคุณใช้รุ่นหลักเดียวกัน ไม่ต้องแปลงไฟล์ ข้อมูลใด ๆเช่นเดียวกับเมื่อการอัพเกรดจาก MySQL 5.1 x รุ่นอื่น
นอกจากนี้ มากของการพัฒนาและการทดสอบการอัพเกรดสคริปต์ ( ซึ่งปรับปรุงแฟ้มข้อมูลเมื่อเช่นการปรับปรุงเป็นสิ่งจำเป็น ) ได้ทำให้มันง่ายที่จะปรับรุ่นจาก mysql 5 .0 กว่าจาก MySQL 5.0 MariaDB 5.1 เพื่อ MySQL 5.1
นโยบายมาตรฐานสำหรับคุณสมบัติใหม่นี้คือ : ถ้าคุณลักษณะจะแนะนำเรื่องการตั้งค่าความเข้ากันได้ , MariaDB ปริยายสำหรับคุณลักษณะอย่างใดอย่างหนึ่งจะปิดทั้งหมด ( เป็นกับแคชคีย์แบ่ง ) หรือปรับแต่งให้มันทำตัวเหมือนเทียบเท่ารุ่นของ MySQL
เพราะการบังคับใช้นโยบายมาตรฐานไม่เสมอไปได้บางคนย่อมเข้ากันไม่ได้อยู่ระหว่าง MariaDB และ MySQL ตัวอย่างเช่น ถ้าคุณใช้ไบนารีเท่านั้นกระเป๋าเครื่องมือห้องสมุด มันต้อง recompiled เฉพาะสำหรับรุ่นของ MariaDB คุณใช้เพราะบางเปลี่ยนแปลงภายในเพื่อจัดเก็บเครื่องมือ API นอกจากนี้ บางส่วนออก เช่น แบบสอบถามช้าเข้าสู่ระบบและผลลัพธ์ของการตรวจสอบตารางคำสั่งต่างกัน ดังนั้นถ้าสคริปต์ของคุณ แยก ออก คุณอาจต้องเปลี่ยนแปลง
หนึ่งบันทึกล่าสุดเกี่ยวกับความเข้ากันได้ : หากคุณเริ่มต้นการใช้ใด ๆของตัวเลือกการปรับแต่งคุณสมบัติใหม่ในหรือ MariaDB , คุณจะไม่สามารถกลับไปได้ แม้เป็นรุ่นเทียบเท่าของ MySQL .
สรุป
สถานการณ์ของคุณควร ตรวจสอบว่า คุณเลือก MariaDB ผ่าน MySQL ถ้าคุณมีสัญญาสนับสนุน Oracle ,แล้วเลือกเรียบร้อยแล้ว พวกเขาก็ MariaDB สนับสนุนไม่ได้ อย่างไรก็ตาม บริษัทหลายแห่ง เช่น skysql ให้เต็ม 24 / 7 สนับสนุนทั้ง MariaDB และ MySQL .
MariaDB ทำเส้นทางหลังล่าสุดอย่างเป็นทางการ MySQL รุ่นจากที่ใดก็ได้จากไม่กี่สัปดาห์เพื่อไม่กี่เดือน ขึ้นอยู่กับวิธีการใหญ่การเปลี่ยนแปลงระหว่างรุ่น
ในด้านพลิกMariaDB มีคุณสมบัติมากมายที่คุณอาจพบว่ามีประโยชน์ที่คุณจะไม่พบใน MySQL และ MariaDB ในที่สุดจะมีคุณสมบัติใหม่แนะนำ , หลังจากที่พวกเขาได้รับการตรวจสอบ และทดสอบอย่างกว้างขวาง
เหตุผลที่จะเลือก MySQL คือ MySQL ผ่าน MariaDB สถานะอย่างเป็นทางการใน repositories ของเพียงเกี่ยวกับทุกการกระจาย Linux .installing mysql กับ‑ apt simple ที่มี yum ครับแปลก being Internet ใน MariaDB ทำงานต่อรวมใน repositories อย่างเป็นทางการ แต่สำหรับตอนนี้ มันรวมเฉพาะในไม่กี่ [ 6 ] .
เหตุผลหนึ่งที่จะยังคงใช้ MySQL ถ้าคุณมีใบอนุญาตการค้าจาก Oracle MySQL ที่ช่วยให้คุณรวมในการปิดแหล่งโปรแกรมนักพัฒนา MariaDB ผูกพันตามข้อตกลงของสัญญาอนุญาต GPL และไม่สามารถ Dual MariaDB
แล้วแต่ฐานข้อมูลที่คุณเลือกในท้ายที่สุด ผลการแข่งขันระหว่าง MariaDB และ MySQL สามารถดี หลังจากที่ทุกคนไม่มีใครพูดของ Microsoft Internet Explorer ไม่ได้ประโยชน์จากการแข่งขันที่ยาวนานกับ Firefox
การแปล กรุณารอสักครู่..
