server
MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Top Related Projects
MySQL Server, the world's most popular open source database, and MySQL Cluster, a real-time, open source transactional database.
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
The MongoDB Database
Official Git mirror of the SQLite source tree
Quick Overview
MariaDB Server is an open-source relational database management system (RDBMS) that is a fork of the popular MySQL database. It is designed to be a drop-in replacement for MySQL, providing the same functionality and API, while also introducing new features and improvements.
Pros
- Performance Improvements: MariaDB has been optimized for performance, with features like the ColumnStore storage engine and advanced query optimization techniques.
- Enhanced Security: MariaDB includes several security enhancements, such as improved user authentication and encryption capabilities.
- Expanded Functionality: MariaDB has added new features and capabilities beyond the original MySQL, including support for JSON data, improved geospatial functions, and better handling of large datasets.
- Active Development: The MariaDB project is actively maintained and developed, with regular releases and a large community of contributors.
Cons
- Compatibility Concerns: While MariaDB is designed to be compatible with MySQL, there may be some minor differences in syntax or behavior that can cause issues when migrating from MySQL.
- Limited Enterprise Support: Compared to MySQL, which is backed by Oracle, MariaDB may have fewer enterprise-level support options and resources available.
- Smaller Ecosystem: The ecosystem of third-party tools and integrations for MariaDB may not be as extensive as the one for MySQL, which has been around for a longer time.
- Potential Vendor Lock-in: Some organizations may be hesitant to adopt MariaDB due to concerns about potential vendor lock-in, as the project is primarily developed and maintained by the MariaDB Corporation.
Getting Started
To get started with MariaDB Server, you can follow these steps:
- Download the appropriate version of MariaDB for your operating system from the official website.
- Install the MariaDB server package on your system.
- Start the MariaDB server using the appropriate command for your operating system (e.g.,
systemctl start mariadb
on Linux). - Connect to the MariaDB server using a client tool, such as the built-in
mysql
command-line client:
mysql -u root -p
- Create a new database and table:
CREATE DATABASE my_database;
USE my_database;
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
email VARCHAR(255)
);
- Insert some data into the table:
INSERT INTO users (name, email) VALUES
('John Doe', 'john.doe@example.com'),
('Jane Smith', 'jane.smith@example.com'),
('Bob Johnson', 'bob.johnson@example.com');
- Query the data from the table:
SELECT * FROM users;
- Explore the MariaDB documentation and community resources to learn more about the advanced features and capabilities of the database.
Competitor Comparisons
MySQL Server, the world's most popular open source database, and MySQL Cluster, a real-time, open source transactional database.
Pros of MySQL Server
- Larger community and more extensive ecosystem of tools and resources
- Better performance for read-heavy workloads and specific use cases
- More frequent updates and releases
Cons of MySQL Server
- Proprietary licensing for some features and enterprise editions
- Less transparent development process compared to MariaDB
- Slower adoption of new features and innovations
Code Comparison
MySQL Server:
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(100) UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
MariaDB Server:
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(100) UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
The basic SQL syntax for creating tables is identical in both MySQL and MariaDB, as MariaDB was originally forked from MySQL. However, differences may arise in advanced features, storage engines, and specific optimizations. For example, MariaDB supports additional storage engines like Aria and ColumnStore, which are not available in MySQL.
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
Pros of Postgres
- More advanced features like table inheritance and custom data types
- Better support for concurrent transactions and ACID compliance
- Stronger community-driven development with frequent updates
Cons of Postgres
- Generally slower performance for read-heavy workloads
- Higher resource consumption, especially memory usage
- Steeper learning curve for administration and optimization
Code Comparison
Postgres:
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);
MariaDB:
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
The main differences in this example are:
- Postgres uses
SERIAL
for auto-incrementing columns, while MariaDB usesAUTO_INCREMENT
- Postgres supports
WITH TIME ZONE
for timestamp columns, offering better timezone handling - Syntax for default values is slightly different
Both databases offer similar basic SQL functionality, but Postgres generally provides more advanced features and stricter adherence to SQL standards.
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Pros of CockroachDB
- Designed for horizontal scalability and distributed architecture
- Built-in support for geo-partitioning and multi-region deployments
- Strong consistency model with serializable isolation
Cons of CockroachDB
- Higher resource consumption and overhead
- Steeper learning curve for administration and optimization
- Limited support for legacy applications and tools
Code Comparison
MariaDB (SQL syntax):
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
email VARCHAR(255) UNIQUE
);
CockroachDB (SQL syntax):
CREATE TABLE users (
id INT PRIMARY KEY DEFAULT unique_rowid(),
name STRING,
email STRING UNIQUE
);
Both databases use SQL, but CockroachDB has some syntax differences:
- Uses
STRING
instead ofVARCHAR
unique_rowid()
function for auto-incrementing IDs- No need for explicit
AUTO_INCREMENT
keyword
CockroachDB also supports distributed SQL operations:
CREATE TABLE users (
id INT PRIMARY KEY,
name STRING,
email STRING UNIQUE
) PARTITION BY LIST (id) (
PARTITION us VALUES IN (1, 2, 3),
PARTITION eu VALUES IN (4, 5, 6)
);
This partitioning feature allows for geo-distributed data storage, which is not natively supported in MariaDB.
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
Pros of CouchDB
- Document-oriented NoSQL database, ideal for flexible schema and JSON data
- Built-in support for multi-master replication and offline-first applications
- RESTful HTTP API for easy integration with web applications
Cons of CouchDB
- Less suitable for complex relational data structures and joins
- May require more storage space due to document-based storage model
- Limited support for complex queries compared to SQL databases
Code Comparison
MariaDB (SQL):
CREATE TABLE users (
id INT PRIMARY KEY,
name VARCHAR(50),
email VARCHAR(100)
);
INSERT INTO users VALUES (1, 'John Doe', 'john@example.com');
CouchDB (JSON):
{
"_id": "user:1",
"name": "John Doe",
"email": "john@example.com"
}
Summary
MariaDB is a relational database system, while CouchDB is a document-oriented NoSQL database. MariaDB excels in structured data and complex queries, whereas CouchDB offers flexibility and easy replication. The choice between them depends on the specific requirements of your project, such as data structure, scalability needs, and application architecture.
The MongoDB Database
Pros of MongoDB
- Flexible schema design allows for easier adaptation to changing data structures
- Better performance for large-scale, high-volume data operations
- Native support for JSON-like documents, simplifying data modeling for modern applications
Cons of MongoDB
- Less mature and battle-tested compared to MariaDB's long history
- Lacks built-in support for complex joins and transactions (prior to version 4.0)
- Higher memory usage due to document-based storage model
Code Comparison
MongoDB query:
db.users.find({ age: { $gt: 18 } }).sort({ name: 1 })
MariaDB query:
SELECT * FROM users WHERE age > 18 ORDER BY name ASC;
Key Differences
- MongoDB uses a document-based model, while MariaDB uses a relational model
- MongoDB queries are typically written in JavaScript, MariaDB uses SQL
- MongoDB scales horizontally more easily, MariaDB excels in vertical scaling
- MariaDB offers stronger ACID compliance out of the box
- MongoDB provides better support for unstructured and semi-structured data
Both databases have their strengths and are suited for different use cases. MongoDB shines in scenarios requiring flexibility and scalability, while MariaDB is ideal for applications with complex relationships and strict data integrity requirements.
Official Git mirror of the SQLite source tree
Pros of SQLite
- Serverless and self-contained, requiring no external dependencies
- Extremely lightweight and portable, ideal for embedded systems and mobile apps
- Zero-configuration setup, making it easy to use out of the box
Cons of SQLite
- Limited concurrency support, not suitable for high-volume multi-user applications
- Lacks advanced features like user management and fine-grained access control
- Limited scalability compared to full-fledged database management systems
Code Comparison
SQLite:
sqlite3 *db;
sqlite3_open("example.db", &db);
sqlite3_exec(db, "CREATE TABLE users (id INTEGER, name TEXT);", NULL, NULL, NULL);
sqlite3_close(db);
MariaDB:
MYSQL *conn;
conn = mysql_init(NULL);
mysql_real_connect(conn, "localhost", "user", "password", "database", 0, NULL, 0);
mysql_query(conn, "CREATE TABLE users (id INT, name VARCHAR(255));");
mysql_close(conn);
Both examples demonstrate basic database operations, but SQLite's simplicity is evident in its serverless nature and lack of connection parameters.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Code status:
MariaDB: The innovative open source database
MariaDB was designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.
MariaDB is brought to you by the MariaDB Foundation and the MariaDB Corporation. Please read the CREDITS file for details about the MariaDB Foundation, and who is developing MariaDB.
MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Corporation, the MariaDB Foundation and by many people in the community.
MySQL, which is the base of MariaDB, is a product and trademark of Oracle Corporation, Inc. For a list of developers and other contributors, see the Credits appendix. You can also run 'SHOW authors' to get a list of active contributors.
A description of the MariaDB project and a manual can be found at:
https://mariadb.com/kb/en/mariadb-vs-mysql-features/
https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/
https://mariadb.com/kb/en/new-and-old-releases/
Getting the code, building it and testing it
Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/ which outlines how to build the source code correctly and run the MariaDB testing framework, as well as which branch to target for your contributions.
Help
More help is available from the Maria Discuss mailing list https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/ and MariaDB's Zulip instance, https://mariadb.zulipchat.com/
Licensing
MariaDB is specifically available only under version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.) This is inherited from MySQL. Please see the README file in the MySQL distribution for more information.
License information can be found in the COPYING file. Third party license information can be found in the THIRDPARTY file.
Bug Reports
Bug and/or error reports regarding MariaDB should be submitted at: https://jira.mariadb.org
For reporting security vulnerabilities, see our security-policy.
The code for MariaDB, including all revision history, can be found at: https://github.com/MariaDB/server
Top Related Projects
MySQL Server, the world's most popular open source database, and MySQL Cluster, a real-time, open source transactional database.
Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch
CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
The MongoDB Database
Official Git mirror of the SQLite source tree
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot