[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Low cost] Wasabi object storage construction and operation service

[Low cost] Wasabi object storage construction and operation service

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with over 200 countries] Global eSIM “beSIM”

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[Compatible with Chinese corporations] Chinese cloud / server construction, operation and maintenance

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

【MySQL互換/派生】MariaDB の特徴について【アザラシ】

技術営業部の大原です。

今回はMySQLから派生したMySQL互換のDBである「MariaDB」の特徴について記載します。
ちなみに「MySQL」の「マイ」は開発者の長女の名前、「MariaDB」の「マリア」は次女の名前です。

※ 本記事は2020年9月時点での内容です。

MariaDB独自の主な仕様・機能(MariaDB 10.3 以降)

元々 MySQLの互換・派生という位置付けで登場したMariaDBですが、最近ではMariaDBの方がアップデートが早く、また本家のMySQLにはない、MariaDB独自の仕様になっている仕様や機能も多くあります。

ここでは MariaDB独自の仕様・機能をまとめてみました。
※ MySQL ⇔ MariaDB では、双方でアップデートを繰り返すので、今後にMySQLがMariaDBの仕様・機能を逆輸入する可能性は十分にあります。

項目 概要
IDの強制終了 指定したID のクエリを強制終了
正規表現エンジンの変更 正規表現エンジンの変更による、正規表現の機能強化
削除結果の取得 DELETE ... RETURNING 構文を使うと、削除対象が1つのテーブルの場合、削除結果を返す。
BLOB列・テキスト列の初期値設定 BLOB列(巨大バイナリデータ型)とTEXT列に初期値を設定できる
動的SQLの実行 OracleDatabaseのように、文字列から強制的にSQLを生成する
システムバージョニングテーブル データ更新日時を記録し、データ履歴を保存する機能
Oracle互換モード OracleDatabase のSQLが使えるモード
テーブル値コンストラクタ データの組み合わせをその場で生成する機能
アプリケーションファンクション ストアドファンクションとして集計関数を定義できる機能
シーケンステーブル 連番を生成する機能
FORループ FOR構文を使ってループできる機能
アプリケーション期間テーブル 時刻を任意に設定できる

MariaDBのオススメ機能

先ほどはMySQLにはない、MariaDBの独自の仕様・機能を記載しましたが、その中でもオススメのポイントを「3つ」ご紹介します。

● システムバージョニングテーブル:

・DBデータを変更(更新)するときは 上書きが基本ですが、この システムバージョニングの機能を有効にすれば、すべての変更の履歴が保存されます。履歴に残っているデータを明示 / 指定すれば、該当するデータを取得できるようになり、任意の時点のデータ分析 / 変更の監査 / 異なる時点のデータの比較が可能になります。

● Oracle互換モード:

・商用データベースのOracleDatabaseとの互換性を有効にする機能です。OracleDatabase独自の構文を使えたり、独自のストアドプロシージャ言語(PL/SQL)も実行できるため、OracleDatabaseからの移行をしやすくしています。

● シーケンステーブル:

・PostgresSQLにある、連番を管理するシーケンス機能のように、別のテーブルで連番を扱えます。現在の連番の値を確認したり、連番の再割り当てをしたりする操作が容易になります。

MariaDBの注意点(MySQLとの非互換性)

MariaDB と MySQLを比較した場合、仕様 / 機能として似通った部分は多くありますが、全てにおいて互換性があるわけでは無いので、下記のような項目に注意が必要です。

● 関数の違い(JSON や GTID の実装が異なる など)
● システム変数の違い(デフォルト値が異なる)
● 文字セット / 照合順序まではサポートされない

まとめ

以上、MariaDBに関する概要と特徴をご紹介しました。

普段MySQLを操作していれば、作法の違いはあれどMariaDBに取っ付きやすいはずです。

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
0
読み込み中...
0 票, 平均: 0.00 / 10
5,538
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

ohara

I started my career in the telecommunications industry as a salesperson in charge of introducing IT products such as NW services, OA equipment, and groupware for corporations.

After that, he worked as a pre-sales engineer for physical servers/hosting services and as a customer engineer for SaaS-type SFA/CRM/BtoB e-commerce at an SIer-based data center business company, before joining his current company, Beyond.

Currently, I am stationed in Shenzhen, China, the Silicon Valley of Asia, and am working as a wholesaler and trade agent for Chinese hardware.

My daily routine is to watch Chinese dramas and billbill.

Qualification: Second class bookkeeping