Foreword - Learning MySQL and MariaDB (2015)

Learning MySQL and MariaDB (2015)


Before you begin to read the main chapters of this book to learn about MySQL and MariaDB, it might be useful to understand what we were trying to accomplish when we first created MySQL about 20 years ago and MariaDB about 5 years ago, as well as the current state of these database systems and my expectations of them going forward. And I’d like to encourage you in your decision to learn these database systems and to assure you that they will be in use for a long time and that you will benefit from the time and energy you put into reading this book and learning what it has to teach you.

Origins of MySQL

When my business partner David Axmark and I started MySQL, there weren’t any good, free, open source database systems. There was mSQL, which wasn’t open source, but it inspired us to create a new database system for our clients, which would later become MySQL. We had no plans to do anything more with this embryo of MySQL other than satisfy the needs of our clients. We were learning, discovering, and creating out of practical concerns and needs, much as you might and perhaps should be doing as a reader of this book and a newcomer to MySQL and MariaDB.

Although we had accomplished our task in creating a straightforward database to meet our requirements, it wasn’t long before we noticed that there were many other organizations that were looking for a solution similar to what we had already developed. So we decided to make the software available to the public and we named it MySQL.

Part of our motivation for doing this was that we felt that it was a way in which we could give something back to the open source community that would be very useful. Most open source projects at that time weren’t as useful. We wanted to make the world a little better — we had no idea at that time how much of an impact MySQL would have on the world. At the same time, we were hoping that by going public with the software, it might finance further development of MySQL for as long as we might want. We had expectations of getting rich from MySQL. We hoped only to be able to work full-time on this project because we believed in it. The result, though, was that we contributed much to the world — much more than we thought possible.

Given the fact that over 80% of the websites in the world are now running on MySQL, one could easily argue that we accelerated the growth of the internet and almost everything that has grown out of it. The impact it’s had is immeasurable. Many of the sites and businesses that have been successful, including the ones that are now huge, probably would never have started if it were not for MySQL being free and dependable. At that time, those founders and startup companies just didn’t have the financial resources to start their sites. The cost of commercial database software was a barrier to some of the most creative web-based organizations being launched, including organizations like Google, Wikipedia, and Facebook. Plus, the commercial database systems posed other problems for startups of that time. First, they were too slow — they weren’t optimized for the Web and that was critical for organizations like these. The commecial alternatives were also too difficult to use and manage, requiring higher paid developers.

Because of these factors, we were able to give fledgling organizations what they needed to become the significant components of the Internet and a major part of the lives of most people in the world today. We were a critical component of the development of the Internet and we still are. There’s nothing to indicate that we won’t continue to be so. The growth of MySQL and especially of MariaDB is increasing. It’s not decreasing as some people expected with the introduction of new databases systems and methods such as NoSQL.

MySQL became a dominant database system long ago. Once something becomes dominant, it’s difficult to replace it. Even if something better comes along, people prefer what’s already familiar to them and what they already know and are using. For something to replace MySQL as the dominant open source database, it would have to be not only critically better, but also offer a way for people to migrate without much effort, and without wasting all of the knowledge they accumulated from their current system. This is why MariaDB can replace MySQL: it’s basically the same thing, but with more features and more potential for the future.

State of MySQL and MariaDB

MySQL and MariaDB aren’t perfect — no database is that, nor will ever be that — but MySQL and MariaDB are good enough for most people and they’re excellent in many ways. The balance we strive for is to develop a database system that works easily on the Web and has one of the fastest connectors. Thanks to the fact that we’re using threads, we can handle much higher loads than other database systems. We used some of the most advanced technologies available when we started MySQL and we have always striven to adapt to new hardware and to optimize the software for all commonly used systems and methods of deployment. Because we’re continuously improving the software, we can have a new release each month for the community edition and we can have a new version every year. That’s an indication that things are happening and improving regularly.

As someone learning and intending to use MySQL and MariaDB, you can take comfort in that we are always improving and adjusting for a changing environment. You can count on us for the future. I think that’s the main thing: people like that they can depend on us. Although it may be fun and exciting to learn something new, after a while it can become tiresome to have to learn a totally new system every couple of years. You won’t have to do that with MySQL and MariaDB.

I mentioned before about how difficult it is to supplant a dominant software. In the case of MariaDB, it’s not much of a change in practice for those who have been using MySQL. As a result, most people can migrate to MariaDB without the usual obstacles, but they can take advantage of the new features included in MariaDB and the ones that are planned when they’re added. MariaDB is relevant because we continue to make improvements and we care about giving developers what they need to get the most out of their databases.

Beyond the Server

In addition to web usage, MySQL and MariaDB can be used for stand-alone applications, embedded with other software. Embedded MySQL and MariaDB are growing more than ever. Many applications are moving to cloud environments, but database systems that many businesses used in the past are typically too expensive to use in a cloud environment. As a result, they need an inexpensive database system that is easily deployed in a cloud environment. For this situation, MySQL and MariaDB are the obvious choices.

The use of mobile devices and websites and applications through mobile devices has increased dramatically; for some sites, it now exceeds access and usage through desktop computers. For sites and applications that run on mobile devices and use a database located in the cloud or in house, we’re the best choice among all the open source and commercial database systems. We have the best scale-out technologies for when your site or application experiences major spikes in traffic or rapid growth in business. With the encryption that we’re adding in version 10.1 of MariaDB, you can be assured that your databases will be very secure by default. Most other database systems don’t have encryption by default.

MariaDB: The Differences and Expectations

Regarding my hopes and expectations for the MariaDB database system, I’m working at the foundation to ensure that we get more companies actively involved in the development of MariaDB. That’s something we lacked during the history of MySQL. We want to develop something that will satisfy everyone — not only now, but for the future. To do that, we need more organizations involved. We’re happy to see Google involved in the MariaDB Foundation. I’d like to see 10 or 15 companies as significant as Google involved. That’s something they’ve managed to do at FOSS, the Free and Open Source Software Foundation. They have several companies that assist in development. That’s their strength. Their weakness is that they don’t have one company coordinating the development of software. My hope is that the MariaDB Foundation will act as a coordinator for the effort, but with many companies helping. That would benefit everyone. It is this collaborative effort that I don’t expect from Oracle regarding MySQL. That’s the difference and advantage of MariaDB. With Oracle, there’s no certainty in the future of the open source code of MySQL. With MariaDB, by design it will always be open source and everything they do will be open source. The foundation is motivated and truly want to be more closely aligned with open source standards.

The MariaDB Foundation was created to be a sanctuary. If something goes wrong in the MariaDB Corporation, the Foundation can guarantee that the MariaDB software will remain open — always. That’s its main role. The other role is to ensure that companies that want to participate in developing MariaDB software can do so on equal terms as anyone else because the foundation is there. So if someone creates and presents a patch for MariaDB software, they can submit it to be included in the next release of MariaDB. With many other open source projects, it’s difficult to get a patch included in the software. You have to struggle and learn how to conform to their coding style. And it’s even harder to get the patch accepted. In the case of MySQL with Oracle, it could be blocked by Oracle. The situation is inherently different with MariaDB.

For example, if Percona, a competitor of MariaDB Corporation, wants to add a patch to MariaDB software that will help their background program XtraBackup to run better, but the management of MariaDB Corporation doesn’t like that it would be helping their competitor, it doesn’t matter. MariaDB Corporation has no say in which patches are adopted. If the Foundation accepts the patch, it’s added to the software. The Foundation review patches on their technical merits only, not based on any commercial agenda.

The open source projects that survived are those that were created for practical reasons. MySQL wasn’t in the beginning the best database solution. People complained that it didn’t have many features at that time. However, it was always practical. It solved problems and met the needs of developers and others. And it did so better than other solutions that were supposedly better choices. We did that by actively listening to people and with a willingness to make changes to solve problems. Our goal with MariaDB is to get back to those roots and be more interactive with customers and users. By this method, we can create something that might not be perfect for everyone, but pretty good.

The Future of MySQL and MariaDB

As for the future, if you want MariaDB to be part of your professional life, I can assure you that we will do everything possible to support and develop the software. We have many brilliant people who will help to ensure MariaDB has a long future.

In the near term, I think that MariaDB version 10.1 will play a large role in securing the future of MariaDB. It offers full integration with Galera cluster — an add-on for MariaDB for running multiple database servers for better performance — because of the new encryption features. That’s important. In recent months, all other technologies have been overshadowed with security concerns because the systems of some governments and major companies have been hacked. Having good encryption could have stopped most of those attacks from achieving anything. These improvements will change the perception that open source databases are not secure enough. Many commercial database makers have said that MySQL and MariaDB are not secure, and they have been able to convince some businesses to choose a commercial solution instead as a result. With MariaDB 10.1, though, we can prove easily that their argument is not true. So that’s good. If you’ve chosen to use MariaDB, you can make this point when you’re asked about the difference between MySQL and MariaDB, and you can feel good about your choice over the long term for this same reason.

Looking at the future, many companies are leery about using commercial database software because they don’t know for sure if the compiled code contains backdoors for accessing the data or if there is some special way in which the software is using encryption that could allow hackers to get at their databases. On the other hand, countries like Russia and China question whether open source databases are secure. The only way we can assure them of that is to provide access to the source code, and that means they must use open source software. So I do hope and expect that in the future we will see MySQL and MariaDB growing rapidly in these countries and similar organizations, because we can address their concerns when commercial solutions cannot. Ironically, a more transparent software system is preferred by a less transparent government. It’s better not only for less transparent organizations, but also for those that want to keep their databases more secure. This applies to an organization that wants to keep their data private and doesn’t want someone else such as a hacker, or a competitor, a government to have access to their data.

Your Future in Learning MySQL and MariaDB

Both MySQL and MariaDB follow the SQL convention for database languages, which was created about 30 years ago. The nice thing about SQL is that it hasn’t changed much in the last 30 years. Mostly, one can do more with it. So if you learn one SQL system well, you can easily make a transition to another. The basic concepts that you’ll acquire in learning an SQL system like MySQL or MariaDB, will be useful for your entire career as a database developer or administrator. There’s nothing to indicate that MySQL or MariaDB will go away for the next 50 years. All of the concepts for the past 20 years of MySQL are the same as they are today and will probably be the same for the next several decades. There are just some new features and tools to be able to do extra tasks. But the skills you always need are basic ones and they’re contained in this book. These skills are ones that will always be of benefit to you.

Advice on Learning MySQL and MariaDB

You shouldn’t just read this book. You should install MySQL or MariaDB, try executing the examples given, and complete the exercises at the end of each chapter. You should also try to do something useful with the software and the SQL statements and functions described in each chapter. You should use the tools or utilities presented. If you don’t get practical experience, any book like this one will be useless to you. If you’re not sure what you can do to get practical experience, perhaps you could try to build a website using MySQL or MariaDB. Try to solve some data-related problem with one of these database systems. Begin to make it part of your life. Then what you’re learning may help you immediately in some way. By this method, you will become more excited by what you’re learning. You will better learn the basics by using the software from almost the beginning.

Another way to learn more, as well as make yourself known in the community and to develop a business network that could lead to more work and better jobs, is by participating in the forums and mailing lists and IRC channels for MySQL and MariaDB. By using what you’re learning to help others, you’ll not only become popular, but you’ll learn more in the process of having to explain the concepts you’ll learn in this book.

— Monty Widenius

Málaga, Spain, January 2015