Scaling New Heights? To Azure Cosmos DB. Another Migration.

Published on 1st November, 2023
Hero image for author with name: Luthando A. Vilakazi

Luthando A. Vilakazi

Author

On the 16th of May, a mere 6 months ago, we were announcing our migration to what we thought would be the “next-generation” database to scale the MyPetParlor App. Little did we know that would only last 6 months before we moved back to Azure Cosmos DB.

Hero image for article with title: Scaling New Heights? To Azure Cosmos DB. Another Migration.

On the 16th of May, a mere 6 months ago, we were ecstatically announcing our migration to what we thought would be the “next-generation” database to scale the

MyPetParlor App

and its valued customers to new heights. Little did we know that the next generation would only last 6 months. Today, on the 1st of November, we are announcing our latest migration to what we “calculate” will be the “next-generation” database to scale to new heights, on to

Azure Cosmos DB

for PostgreSQL.

This article is an honest review of the world we live in, where we learn from our mistakes. It's my own opinion and is based on my reflection on the role I have been working in for the last few months. It's important to self-reflect and continuously grow, both personally and professionally.

MyBusiness App embraces a philosophy of failing fast because we believe that only through our failures can we experience growth and success.

I say this because I believe that, as Chief Technology Officer of MyBusiness App, the responsibility of making the final decision on which technologies we use for our products lies with me. Of course, I am a part of a team of decision-makers where we have a great COO, Brendan Swart, and CFO, Edward Maboa, but I remain accountable for technology decisions. They depend on me to understand the trends of technology very well so that I can help the team make better decisions for the future of MyBusiness App and its growth. With that said, this is how we learn.

The mistake I have been inferring to in the last few sentences of you reading this is the decision I made, with the support of our team, to initially migrate the MyPetParlor App’s database workloads from Azure Cosmos DB to

Tigris Data

.

Throughout it all, we continued to increase our monthly active users growth rate each month, maintained excellent operational efficiency with a consistent reduction in crashes, and successfully moved all database workloads from Tigris Data to Azure Cosmos DB.

Reasons behind the 1st migration

Initially, we were facing an impending financial crisis. Our costs to run our database workloads were increasing at an exponential rate every month. After about 6 months of running our database workloads, our cost had increased from $2 per month to about $20 per month. This becomes clear as to why I describe it as a crisis when you realize that a 900% increase in database costs coincided with a less than 50% increase in actual data stored and processed each month. We could not let this happen.

Additionally, “the customer demand for a comprehensive full-text search feature prompted the quest for a more advanced data platform.” In our previous article,

Scaling New Heights: Empowering South African Pet Parlors with Next-Gen Data Platforms

, we explained the customer demand for full-text search as another reason for the move as our database, back then, could not support full-text search.

Ultimately, the financial crisis we were foreseeing and the growing needs of our customers prompted us to start the search for a database that could help us reduce our operational costs while providing additional features, such as

full-text search

and

vector embeddings

. Tigris Data was found to be the next-generation data platform to meet all our needs so we got in touch with the team at Tigris and got the migration kickstarted.

Reasons behind the 2nd migration

The second migration might be confusing, especially if you read our previous article,

Scaling New Heights: Empowering South African Pet Parlors with Next-Gen Data Platforms

. The first question you might ask is “why we moved from Azure Cosmos DB to Tigris Data only for us to move back to Azure Cosmos DB?”

I explained the reasons for the 1st migration above so here I will try to explain the valid reasons behind the 2nd migration and clear your confusion.

Firstly, Tigris Data shut down its database on the 1st of November 2023, so we just did not have a choice but to migrate to ensure business continuity.

Secondly, as to why Azure Cosmos DB again, one has to understand that Azure Cosmos DB is a database offering from Microsoft Azure that allows multiple database types to reside in it. In other words, we initially used Azure Cosmos DB for MongoDB and we now use Azure Cosmos DB for PostgreSQL. Under the hood, they are the same but the pricing models and features and capabilities can vastly differ. Azure Cosmos DB for MongoDB has a serverless pay-as-you-go pricing model that does not scale with our use-case and does not support full-text search and vector embeddings. On the other hand, Azure Cosmos DB for PostgreSQL has a fixed pricing model that provides predictable costs and supports what we need.

Additionally, I made the decision that we would move away from NoSQL to SQL for our critical workloads. SQL has been used in database technologies for

over 40 years

and comes with a large community and support base that provides our company the stability it needs to run critical workloads.

Lessons learned

While the 2 migrations provided me personal growth and the company great exposure to cutting-edge technologies. We must first ensure a balance with a stable roadmap that enables

operational excellence and business growth, the ultimate balancing act

.

Do your homework

The first lesson was learned due to a lack of comprehensive research and planning.

I briefly mentioned above that one of my responsibilities is to ensure that I understand technology trends. This is because when it's time to make a change that will impact business operations in the long-term, of which a database migration is such a change, you need to make the right decision. Had I done more research, I would have known that, just like Tigris Data, Azure Cosmos DB supports PostgreSQL and, by extension, full-text search and vector embeddings.

“Do your homework to improve your ability to make a well-informed decision in the end.”

Understand the database technologies

The second lesson was learned due to a lack of understanding the databases.

Generally, when we think of how to build out any software application, one of the first decisions we make is which type of database we will use, “

SQL or NoSQL?

” NoSQL is newer than SQL in the fast-paced world of technology. So naturally,

MongoDB

’s NoSQL database was selected to build out MyPetParlor App initially. Here, hindsight is 20/20, I don’t think I could have foreseen the need for us to move to a SQL database in the end,

PostgreSQL

. The best thing we did here was build a system that's modular in nature so that we can make building blocks that are easily interchangeable increasing our ability to make big changes with minimal impact. Nonetheless, had I had a better understanding of PostgreSQL, we could have made the decision to build with it initially.

“Understand your databases to prevent database migrations as they can be timely and expensive to conduct later.”

Use industry-standards for critical workloads

The third lesson was learned due to a lack of recognizing the critical nature of the workloads.

MyPetParlor App was always built to provide the ultimate value to all its stakeholders, our customers, investors, founders, employees, and the communities it operates in. As a critical system, operational excellence must always be balanced with business growth. While we should push the boundaries to scale to even newer heights, a famous person once said, “slow and steady wins the race.” Tigris Data was a new tech startup, less than a year old, going up against long-standing, industry veterans like PostgreSQL, MySQL, Cassandra and MongoDB. We should have definitely marked Tigris Data as experimental and not accepted it as a viable option to support a critical workload. And this actually became the ultimate Achilles heel, within 3 months of the first migration, we received a call from Tigris that the company would be closing and we had 3 months to migrate to a new database. Additionally, in the 3 months leading up to the database shutdown, we experienced certain stability issues with the database that was no longer being maintained.

“Use industry-standards for critical workloads as they have been battle-tested and had time to become stable.”

Looking forward

Firstly, Tigris Data has been a great database and served us well. The team has been one of the best in support. If the company gained enough traction and did not close, we would have considered ourselves lucky as we had made a gamble that paid off. With Tigris Data serving our data needs for the last 6 months, we have more than tripled our monthly active users and grown from 3 to more than 10 tenants.

After doing more homework, we moved back to Azure Cosmos DB. This time we will manage our costs more transparently and efficiently by using PostgreSQL and moving away from a pay-as-you-go pricing model for our database.

In the end, we maintain our position to unlock immense potential for growth and innovation. Our ability to maintain a sustained growth and innovation in the South African pet care industry for the foreseeable future remains intact.

MyBusiness App Icon

Making the world a better place by fast-forwarding to the future through digital technologies.

© 2024 MyBusiness App (Pty) Ltd. All rights reserved.