Data has always been present in our world, and the exploitation of it is only increasing. And yes, without data, companies have no insight into their business. To help them make the best decisions, the Data Engineer will extract all available data and then store it in a database. But how do you choose between all these databases? Here's an article on MariaDB to help you decide.
A reminder of relational databases and NoSQL
Today, there are 2 main database families: relational databases and non-relational databases (NoSQL).
Relational databases are organized into tables, each containing columns and rows with a predefined number of attributes (schema). You must also transmit the typing of each attribute (dimension).
The advantages of this database are
- data consistency: since your tables are linked by columns, for example the “music” table is linked to the “artist” table by the “artist_id” column present in both tables;
compliance with ACID properties; - fast execution of complex queries: as your data is linked, it’s very easy to make queries that require several to join several and aggregate them to create new tables based on KPIs.
Here’s an example of how a relational database is organized:
NoSQL databases are used to quickly and frequently manage insertions, modifications and deletions.
They are divided into 3 main sections:
- Document-oriented database: used to manage large volumes of data that need to be saved quickly;
- Column-oriented database: used for column-based analysis;
- Graph-oriented database: used for highly interconnected data.
Now that we know a little more about the main databases, I’m going to talk in more depth about MariaDB.
In order to insert, store, modify or delete data, or to manage user access to a database, you’ll need a DBMS or Database Management System. MariaDB is what’s known as an RDBMS, which stands for Relational Database Management System.
So it’s the MariaDB software that handles your data, the database engine that manipulates the data, and the schema that defines the logical structure of the database. MariaDB is very similar to MySQL in that it is a fork of MySQL, which is why most MariaDB commands are similar to those of MySQL.
Okay, so now we need to build a relational database. But which of Oracle, MySQL, PostgreSQL, MariaDB etc. is the most suitable?
What are the differences between MariaDB and MySQL?
Let’s start by listing the major differences between MariaDB and MySQL:
- MariaDB is open-source: it’s the community of developers and users that enhances MariaDB’s functionality. As a result, using MariaDB won’t cost you a thing. In contrast, MySQL is backed by Oracle Corporation, with regular updates and enterprise support available. On the other hand, MySQL with support will cost you $5,000 a year;
- MariaDB is better suited to large-scale data management: MariaDB supports more storage engines (a set of algorithms that store and access data). Each engine has a specific purpose, and “MariaDB ColumnStore” is used for big data;
- MariaDB is capable of supporting over 200,000 connections, whereas MySQL is limited to this figure. If your e-commerce site is very popular, MariaDB is better suited to keeping data available when many users “request” the database;
- Some of MariaDB’s own features, such as invisible columns, database views, etc. simplify your frequent queries. MySQL offers integrated data masking and dynamic columns.
Why use MariaDB?
MariaBD’s strengths include its numerous storage engines. The storage engine is the software that manipulates your data. Depending on your needs, you’ll choose the most appropriate storage engine. Here’s a list of MariaDB’s storage engines and their specific features:
- InnoDB: the most versatile storage engine. It’s also used by MySQL. It’s a high-performance, reliable engine, and is recommended for “large” databases in excess of 5GB, as well as for managing several connections simultaneously. What’s more, it ensures data integrity and consistency thanks to its exemplary compliance with ACID transactions;
- Aria: this storage engine guarantees the survival of your data in the event of a crash. What’s more, it’s ideal for environments with limited RAM availability;
- MyRocks: features efficient data compression without reducing performance;
- Memory: suitable for applications requiring higher performance, since this storage engine stores data directly in main memory. Please note that data is lost if the server is restarted.
MariaBD can handle frequent database queries (insertion, deletion and modification). It has a very fast response time for small quantities of data. That’s why it’s often used by businesses to manage their transactions.
What’s more, MariaDB’s high-performance multithreading model enables applications to handle traffic peaks.
In addition, it can handle large data sets, whereas MySQL doesn’t have an adequate search engine for this type of data.
MariaBD is therefore ideally suited to online data processing, and in particular transactions that need to be fast and secure, as well as to applications used by many users at the same time.
If you’d like to learn more about databases and data tools in general, come and see our Data Engineer course!