Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 17 submissions in the queue.
posted by janrinok on Thursday July 25 2024, @11:19PM   Printer-friendly
from the when-you-see-a-fork-in-the-road-take-it dept.

Arthur T Knackerbracket has processed the following story:

For developers familiar with MySQL, you've probably heard that MariaDB is the next generation of the database engine. MySQL has long been the traditional database in Linux, Apache, MySQL, and PHP (LAMP) environments. However, MariaDB has gained popularity as an alternative. MariaDB is a fork of the original MySQL codebase, created to ensure continuity and avoid the potential pitfalls after MySQL was acquired by Oracle. Developers will find that the syntax is similar, but MariaDB introduces several notable differences.

Although MySQL remains embedded in several large technology businesses, MariaDB is often seen as a popular new-generation database for enterprises. MariaDB supports higher data transfer volumes and is supported by most cloud providers. Its similarity to MySQL, which was the dominant database in the early 2000s, has facilitated its adoption.

The key differences between MariaDB and MySQL form the foundation of MariaDB's performance. MariaDB offers several more storage engines and supports over 200,000 connections. MySQL's Enterprise edition includes proprietary code, while MariaDB is completely open-source. These differences contribute to MariaDB's superior speed. In recent benchmark testing, MariaDB performs somewhere between 13% to 36% faster than MySQL.

Since MariaDB is a fork from MySQL, the syntax is similar, but MariaDB has several additional features. Basic SQL syntax remains the same, but MariaDB handles data storage and functions differently. Each new version of MariaDB includes added features and extensions.

One example of a feature in MariaDB not available in MySQL is the SEQUENCE feature. In MySQL, you use the AUTO_INCREMENT feature to add a unique incremented integer to each row created in a table. With SEQUENCE, you can create a custom sequence that starts at a specific value and increments by a custom value.

The following is an example of the SEQUENCE function:

CREATE SEQUENCE s START WITH 10 INCREMENT BY 10;

MySQL was introduced in 1995 and became the dominant database engine in the early 2000s. It's used by some of the world's largest companies such as Facebook, GitHub, Airbnb, and YouTube. It handles billions of records and integrates easily into Linux environments, including affordable web hosting providers.

Because MySQL is so popular, there are plenty of videos and tutorials available to learn how to set up the database and use its SQL syntax to create queries. MySQL is also suitable for personal projects and is free for individual use. It runs on both Windows and Linux, making it accessible to almost any developer. Many developers begin learning database programming and storage design with MySQL.

MariaDB is slightly more challenging because it's designed as an enterprise solution. It has more engines to work with and is available in the cloud. Most enterprise applications have many more features than consumer alternatives, making them more difficult to learn.

No one can predict the future, but MySQL is likely here to stay. More application developers might choose MariaDB over MySQL for enterprise applications, but MySQL still maintains a strong market presence. WordPress works natively with MySQL and powers a significant percentage of websites – however, WordPress is also compatible with MariaDB – MariaDB can be used seamlessly with WordPress without requiring significant changes.

In the future, MariaDB could power a large portion of web applications, but for now, it maintains a strong presence in the enterprise realm, especially in Linux environments. It's possible that MariaDB will become a more popular database for enterprise applications in a LAMP environment.

If you need to learn about databases or have a small pet project, MySQL may be the best option. MySQL offers a convenient desktop application that simplifies database management and configuration. The MySQL Workbench software uses a graphical user interface to guide you through the table creation process, and you can build your queries and functions with better feedback from the database service if you make mistakes.

In a large organization, MariaDB is the better option. It's also beneficial for smaller businesses that expect a large increase in concurrent users (there are some GUI applications here, too, if you need them). MariaDB scales easily as an application becomes more popular and more users access it. If you want to get experience working with cloud databases, MariaDB is a good choice for learning replication and management of data in the cloud.

As a fork of MySQL, MariaDB shares many similarities with its predecessor, making the determination of "which is better" subjective. Some developers prefer MariaDB because it's open-source and free, but MySQL is a stable, popular alternative that's good for small projects.

At the risk of starting a flamewar, do you agree with the views expressed here? If not, which is your preferred database and why?


Original Submission

This discussion was created by janrinok (52) for logged-in users only, but now has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
  • (Score: 4, Troll) by looorg on Friday July 26 2024, @12:47AM (2 children)

    by looorg (578) on Friday July 26 2024, @12:47AM (#1365723)

    If you need to learn about databases or have a small pet project, MySQL may be the best option.

    If it is a small pet project I would use SQLite, if a db was needed at all but lets assume so for arguments sake. Is there a MariaDB alternative or equivalent to that?

    • (Score: 5, Interesting) by canopic jug on Friday July 26 2024, @04:01AM

      by canopic jug (3949) Subscriber Badge on Friday July 26 2024, @04:01AM (#1365755) Journal

      If you need to learn about databases or have a small pet project, MySQL may be the best option.

      I too would recommend SQLite for that instead of MariaDB or MySQL, or even PostgreSQL. There's just too much overhead in getting MariaDB/MySQL set up before you can even begin making SQL queries, what with the access control and client-server model. Better to save that for the second or third semester on SQL databases, or for large projects which require multiple levels of access to tables.

      An introductory SQL course ought to focus on queries right ought of the gate so that the students learn actual SQL instead getting distracted with system- and database-administration. That's what SQLite can offer over what MariaDB/MySQL or Postgresql have. With SQLite, the file system is used for access control and thus the students can instead jump right in to creating tables and adding and retrieving data. There is of course a very limited set of data types, but hey that's what you actually need in an introductory course. Once they master creating basic tables and various kinds of queries, then the second or third term can cover all the intricacies of the more powerful, open source, client-server SQL databases such as creating users and remote access. But by then they know some SQL and they're closer to understanding what is going on with the access control setup and not just cargo culting written instructions handed out in the class or 'found' on the net.

      The summary mentions MySQL Workbench. That tool may have its uses but should be kept far, far away from students as it adds yet another layer between the student and the data they are supposed to be working with. Furthermore, that extra layer is an extra layer of complexity and setting it up is neither an easy task nor related to actual database use. Sure, if you want students not to learn SQL and to burn up all the classroom and lab time doing system administration, set up MySQL work bench. Do it on Windows and you'll ensure that they'll never get to the actual SQL in any meaningful amount.

      Again, for emphasis, SQLite is the way to get directly into practical SQL queries during the very first hour of the first day of class.

      --
      Money is not free speech. Elections should not be auctions.
    • (Score: 2) by c0lo on Friday July 26 2024, @05:10AM

      by c0lo (156) Subscriber Badge on Friday July 26 2024, @05:10AM (#1365765) Journal

      If it is a small pet project I would use SQLite,

      Depends what you understand by pet project. I had such that included a small enough codebase to be called pets (put together in a couple of days) but the data they collected and crunched were beyond what would normally fit in computer's RAM (and SQL Lite degrades badly as the indexes size increase).

      --
      https://www.youtube.com/@ProfSteveKeen https://soylentnews.org/~MichaelDavidCrawford
  • (Score: 5, Interesting) by stormreaver on Friday July 26 2024, @01:06AM (3 children)

    by stormreaver (5101) on Friday July 26 2024, @01:06AM (#1365726)

    If your data matters to you, stay far away from MySQL/MariaDB. They will happily, and silently, alter your data to fit constraints. If you need a trustworthy, feature-rich database, PostgreSQL is the way to go.

    MariaDB is just now getting sequences, while PostgreSQL has had them (and much, much more) for decades. I first used PostgreSQL in the mid-1990's, and it had them back then.

    The only good thing I can say about MySQL/MariaDB is that they had in-place database upgrades long before PostgreSQL got them. They may still do them better than PostgreSQL (I don't know), but it's not even remotely close enough to make me want to try MySQL/MariaDB again.

    • (Score: 3, Interesting) by bart9h on Friday July 26 2024, @05:39PM (2 children)

      by bart9h (767) on Friday July 26 2024, @05:39PM (#1365821)

      This!

      My LAMP is actually OHPP (openbsd, httpd[1], postresql, php).

      [1]: the default http server provided by openbsd.

      • (Score: 1, Touché) by Anonymous Coward on Saturday July 27 2024, @10:50AM (1 child)

        by Anonymous Coward on Saturday July 27 2024, @10:50AM (#1365886)

        Sounds kind of awkward to me because of the php in there. I think using mariadb over postgres is less of an offense than using php.

        • (Score: 2) by bart9h on Monday July 29 2024, @06:35PM

          by bart9h (767) on Monday July 29 2024, @06:35PM (#1366210)

          I have the impression that most of the hate PHP gets is from people that used it a long time ago. Modern PHP is not that bad. It gets the job done, and I have found no reason yet to use anything else. (For the record, I am already proficient in C, Perl, and C++, and have already worked with Java, and am now coding with Javascript too.)

  • (Score: 3, Informative) by KritonK on Friday July 26 2024, @06:22AM

    by KritonK (465) on Friday July 26 2024, @06:22AM (#1365771)

    Given that most Linux distributions come with MariaDB instead of MySQL, I would have thought that MariaDB has been the dominant MySQL variant for a long time. As for it being more complex, so what? You don't have to use the new features, unless you need them, and chances are that you don't. Even before the split, MySQL had a few different engines, but the default was fine for simple uses, and it still is with MariaDB.

    The article mentions Wordpress, and that it works with MySQL, but is also compatible with MariaDB. As far as I can tell, this is because it uses the MySQL module of PHP, which is compatible with both, simply because it doesn't use or need any of the additional MariaDB features. None of the new "developers" (i.e., Wordpress site builders) in our company has ever complained that I've created MariaDB databases for their projects, instead of MariaDB ones. As long as someone has populated wp-config.php for them with the appropriate data, they are happy.

  • (Score: 5, Insightful) by janrinok on Friday July 26 2024, @07:13AM

    by janrinok (52) Subscriber Badge on Friday July 26 2024, @07:13AM (#1365774) Journal

    I use several databases privately. I began many years ago (25+ years) with MySQL which, as TFA recommended because it is easy to configure and set-up. It performed as expected - I never experienced any problems but there again I wasn't pushing any boundaries either. I decided to change to MariaDB when Oracle became involved, simply as a matter of preferring to use OSS and not being tied to any particular company.

    The switch to MariaDB was simple and required only one change to my existing data. I had initially selected an option in MySQL (probably on the recommendation of something I had read on the internet but not fully understood) which was not available in MariaDB. But as this was a common complaint from former MySQL users it just involved running a script of a few lines of SQL and the unneeded option was removed. (I also learned a lesson from this - don't accept 'good advice' from the internet unless it is good advice for your particular usercase).

    MariaDB accepts everything in SQL that MySQL was using in terms of standard database management and queries. It is, however, much faster. It is used by lots of big name companies (including RedHat, Nokia, Samsung, Virgin Media, and over a dozen others). It just works and I have no intention of changing to anything else. It also has the benefit that both MySQL and MariaDB can now access my data without compatibility problems. I do not have to go back to change any legacy software in order to use any of my current data.

    Stormreaver recommended [soylentnews.org] using Postgresql but for me that required quite a few changes to my software (different data types), data, and a lot of work subsequently testing that the changes had not affected the data or my existing programs. There is a comparison here [integrate.io] but I do not need any of the suggested 'advantages' that Postgresql offers and I could not justify the extra work and time needed to use it. I'm sure it is a fine piece of software but it makes as much sense as using a spaceship as a local town runaround in my usercase. I have never experienced the problems of "alter[ing] your data to fit constraints". I am not saying that such things don't exist but they don't appear to affect me.

    I also support the comment made by a few others - use SQLite early on. It is possible that is some cases it will actually be adequate for the software you are writing and in my case (using SqlAlchemy in Python predominantly) the change to something else is only 1 line.

    Ultimately, I suppose that it boils down to 'use what you know and are comfortable with'. They all work and, in 99.99% of cases the 'advantages' of one over the others are irrelevant. If I get time to spare then I might give Postgresql another try but there is no nothing that I cannot currently do with MariaDB that would force a change to something else. Remember, "If it ain't broke, ....".

    --
    I am not interested in knowing who people are or where they live. My interest starts and stops at our servers.
  • (Score: 0, Touché) by Anonymous Coward on Friday July 26 2024, @07:42AM

    by Anonymous Coward on Friday July 26 2024, @07:42AM (#1365777)

    One stinks of Oracle, the other smells like Holy Virgin.

  • (Score: 5, Insightful) by ledow on Friday July 26 2024, @10:34AM (1 child)

    by ledow (5567) on Friday July 26 2024, @10:34AM (#1365782) Homepage

    MySQL - owned by Oracle.
    MariaDB - the real MySQL

    There. That's all you need to know.

    Also:

    StarOffice - dead
    OpenOffice - dead
    Apache OpenOffice -dead
    LibreOffice - the real OpenOffice.

    • (Score: 5, Insightful) by sjames on Friday July 26 2024, @06:23PM

      by sjames (2882) on Friday July 26 2024, @06:23PM (#1365834) Journal

      Absolutely this. MySQL is just a sucker offering for people who for some reason would rather pay for something free in return for nothing.

      The appropriate argument is between MariaDB or PostgreSQL.

  • (Score: 2) by deimios on Saturday July 27 2024, @03:40AM

    by deimios (201) on Saturday July 27 2024, @03:40AM (#1365869) Journal

    I use MariaDB because it's more compatible with MySQL than MySQL8.
    With version 8 MySQL introduced breaking changes that pretty much wrecked all my mission critical applications (Drupal, JavaEE, .NET). Then I promptly switched to MariaDB and had no problems for a few years. Then MariaDB started introducing breaking changes and broke the .NET connector. Now I am forced to run an older version of MariaDB on a dedicated isolated VM that will never be updated.

    Details on my Soylent Blog.

(1)