Scaling Databases: A Developer's Journey
Tags: database, sql, mariadb, architecture
Published: 2023-07-24 10:11:07

In the vast world of software development, navigating the world of databases is quite an adventure. There are so many options tailored to general and specific use cases that trying to explore the database ecosystem is a challenge in itself. That’s one of the reasons I find [MariaDB](https://mariadb.com/) so compelling to software developers—it’s an advanced battle-tested database that supports many kinds of workloads. Today, MariaDB has differentiated itself from its predecessor, MySQL. With more features, better (in my opinion) SQL syntax, and more storage engines.

Join me on a developer's journey as we explore how MariaDB supports application evolution from a modest beginning to handling massive workloads, supporting developers along the way.


![Sea lions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yhlqb56r44tr9tq32uk.png)

**Note:** Decorative AI-generated images of sea lions are included in this article (see the official MariaDB logo [here](https://mariadb.com/about-us/logos/)).


## Chapter 1: A Small Application's Discovery

Our journey begins with a small-scale application. And for it, we need a database that just works. Reliably. And fast! During our search, we stumble upon [MariaDB Community Server](https://mariadb.com/products/community-server/), an open-source database that has become the default database in most Linux distributions (there must be a good reason for this). This database management system, built upon the [ISO SQL/PSM](https://en.wikipedia.org/wiki/SQL/PSM) standard, offers high performance and reliability. With MariaDB Community Server, we confidently embark on our journey, knowing that our modest requirements will be met without the burden of database limitations. And we are not alone. A huge online community gathers around MariaDB on [social media](https://twitter.com/mariadb) and more recently, on [Slack](https://www.reddit.com/r/mariadb/comments/rlfxf9/join_no_pun_intended_mariadb_on_slack/).


![Sea lion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s9y8j9xh88756914u39f.png)

## Chapter 2: Scaling Up for Growing Demands

As our application gains traction, the demands placed on our system grow exponentially. It’s no longer an intranet or internal application that a few of our colleagues use. No. Now our application is mission-critical. It has much more than a handful of users. Some of them are external to our organization which increases the pressure on handling security risks. To address this challenge, we turn to [MariaDB Enterprise Server](https://mariadb.com/products/enterprise/). Built on the foundation of the Community Server, the Enterprise variant provides battle-tested features tailored to production environments. With improved defaults and configurations, and features such as [enterprise audit](https://mariadb.com/docs/server/security/audit/enterprise-audit/), [enterprise backup](https://mariadb.com/docs/server/data-operations/backups/enterprise-server/mariadb-enterprise-backup/), and [enterprise cluster](https://mariadb.com/docs/server/architecture/components/enterprise-server/enterprise-cluster/), MariaDB Enterprise Server equips us to handle larger workloads and ensures secure and optimal performance, instilling confidence in our ability to manage sensitive data and scale up in the future. Additional, we can rest assured that team of experts is available for technical support when needed.


![Sea lion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yltcdzn7xx10d1vpb0bh.png)

## Chapter 3: Navigating Traffic and High Availability

The popularity of our application skyrockets, bringing not only good money to the business but also high availability and scaling challenges to tackle. [MariaDB MaxScale](https://mariadb.com/products/maxscale) emerges as a solution—a reliable database proxy that handles [read/write splitting](https://www.youtube.com/watch?v=mPA5EU5EjeU) for scaling reads, [automatic failover and transaction reply](https://github.com/mariadb-developers/read-write-split-java-app), and many other [functionalities](https://www.youtube.com/watch?v=hAQNmZak4bA). MaxScale makes our database cluster look as if it was a single logical application and frees application developers from implementing things such as managing multiple data sources, load balancing, transparent data masking, and even offers the possibility to translate NoSQL (MongoDB) queries to SQL and store the data in one single ACID-compliant relational database.


![Sea lions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2o43pezz1enaqpvkxyz.png)

## Chapter 4: Reports and Analytical Ad-Hoc Queries

Our journey takes a turn into [real-time data analytics](https://mariadb.com/database-topics/analytics/). We now have tons of data available. Stakeholders know this and demand the implementation of reporting features to allow them to extract valuable insights from the data. Enter [MariaDB ColumnStore](https://mariadb.com/products/columnstore/), a specialized storage engine designed for lightning-fast analytical queries. In our application, we implemented a dynamic report generation module that lets users pick and join data from multiple tables in the database. We don’t really know which columns and tables are going to be used, so we don’t know exactly which columns should have indexes. By organizing data in a columnar fashion, ColumnStore frees us from dealing with database indexes as each column is persisted in the hard drive in a columnar fashion (as opposed to row-based storage). A great solution for ad-hoc queries like the ones generated by our report module or data engineers and data scientists.


![Sea lions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cf2jhbja26yat1vfye5j.png)

## Chapter 5: Scaling Horizontally for Unprecedented Workloads

As our application continues to flourish, once again we encounter unprecedented levels of database transactions. Scaling reads was possible with [read-write splitting](https://dzone.com/articles/learn-database-read-write-splitting-using-your-bro?ref=hackernoon.com) automatically handled by MaxScale. However, write operations start to suffer with the increase in load. Scaling writes and preserving the [ACID](https://mariadb.com/resources/blog/acid-compliance-what-it-means-and-why-you-should-care) properties may seem daunting (for example when using [manual data sharding](https://dzone.com/articles/distributed-sql-an-alternative-to-sharding)), but [MariaDB Xpand](https://mariadb.com/products/enterprise/xpand/) comes to our rescue. This [distributed SQL](https://go.mariadb.com/23Q1-WC-GLBL-DBaaS-Distributed-SQL-for-Dummies-DB1159_LP-Registration.html) database allows for horizontal scalability of reads and writes. With automated [data slicing](https://mariadb.com/docs/xpand/architecture/components/xpand/data-distribution/), replication, and [rebalancing](https://mariadb.com/docs/xpand/architecture/components/xpand/rebalancer/), MariaDB Xpand ensures high availability and empowers us to handle billions of transactions per day without compromising the responsiveness and robustness of our application. We are ready to scale linearly (just by adding more nodes) both reads and writes.


![Sea lions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8blelcnz4q1lx6hxvjea.png)

## Chapter 6: Embracing the Cloud for Infinite Possibilities

Our journey leads us to the boundless realm of the cloud, where [MariaDB SkySQL](https://mariadb.com/products/skysql/) awaits. SkySQL, a second-generation cloud database service, revolutionizes the way we deploy MariaDB products. It simplifies cloud-native deployments of MariaDB Enterprise Server, ColumnStore, and Xpand, unlocking serverless analytical capabilities, geospatial services, remote monitoring, and cloud backup. As a fully managed service, we no longer have to worry about software updates or manual scaling clusters. With [a few clicks](https://www.youtube.com/watch?v=qDJYn8xmIy8), we can have a database service that scales with no limits and is maintained by the experts developing MariaDB. And not only that, we get access to DBAs with tons of experience with MariaDB through the [SkyDBA](https://mariadb.com/services/skydba/) offer. Our applications are now [unstoppable](https://go.mariadb.com/23Q2-WBN-GLBL-DBaaS-Developing-Unstoppable-Applications-SkySQL-2023-03-28_Registration-LP.html).


![Sea lions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jf9d7s1e6zbi1sjuby4o.png)

## Conclusion

As software developers, our journey is a quest for scalable and reliable database solutions. MariaDB stands out, offering a diverse suite of tools tailored to every need. From the simplicity of MariaDB Community Server to the scalability of MariaDB Xpand and the cloud-native capabilities of MariaDB SkySQL, MariaDB empowers us to conquer the complexities of database management. I hope I have inspired you to learn more about databases and MariaDB. I’m happy to answer any questions or present this topic internally at your company, conference, developer group, meetup… anything. [Just let me know](https://www.programmingbrain.com/p/contact-me.html)!