Here’s how we switched over to Serverless DynamoDB from MySQL in under two weeks.
About three years back, we created a SaaS product or a Software-as-a-Service product, where we had a requirement to process 50 GB of data with over 2 million read/write operations on a daily basis.
In the hindsight, we knew that relational database wasn’t the right choice for this project. Still, we were really reluctant to use NoSQL as we didn’t have NoSQL experts on board. We didn’t really give NoSQL a serious thought (big mistake).
We went ahead with MySQL as our choice of database. The project went live and within days of launch, we started seeing issues like frequent database locks. So as a logical next step, we upgraded our database server to a more powerful hardware on Amazon RDS. That helped a bit. But again, as our user base increased, we started seeing the same issues all over again.
The next option was Replication. So, we upgraded our database to a Multi-AZ environment and also added a couple of Read-replicas. And that kind of helped us to run this project for another couple of weeks before we started seeing the same issues all over again.
We were in serious trouble. Our application was stalling frequently. Page loads often took several many seconds, and our customers were frustrated. And as a natural consequence, we started losing our customers. And now, we were seriously thinking of using NoSQL database (Better late than never, huh?).
We compared different NoSQL databases like MongoDB, Cassandra, and DynamoDB. Both MongoDB and Cassandra required us to provision server infrastructure as well as the software, and also had a steep learning curve. We really had very less time at hand as we were losing customers on a daily basis. So, a serverless NoSQL database like DynamoDB was our best bet.
"(on MySQL) Our application was stalling frequently…customers were frustrated…we were losing customers on a daily basis. So, a serverless database like DynamoDB was our best bet… it has been three years now and we haven’t had a single database issue." https://t.co/eWmLYgnnnn
— Jim Scharf (@jim_scharf) January 26, 2018
It hardly took us two weeks to migrate over from MySQL on RDS to serverless DynamoDB. And this included learning DynamoDB from scratch. DynamoDB worked like a charm and it has been three years now and we haven’t had a single database issue.
From then on, for every project of ours, we prefer using DynamoDB over any other database. There is little to no learning curve involved and being a serverless database, there is no infrastructure overhead either. So, if you were to choose a NoSQL database, I would highly recommend using a serverless NoSQL database. And, you will never go, wrong by choosing DynamoDB as your choice for serverless NoSQL database.
If you’re new to DynamoDB, I talk more about this and take you through hand-on labs in my new online course AWS Serverless Microservices Overview with Hands-on (2018). This is a short and concise course as I know you are short on time. In addition to DynamoDB, you will learn how to create completely serverless microservices using AWS Lambda and API Gateway. We’ll use the new Lambda Console with AWS Cloud9-based Code Editor so you dont have to install any software. All you need is your favorite web browser.
[udemy id=”1477294″ coupon=”8XACADEMY” couponprice=”$9.99″]
But you know, I’m not that selfish and there is a free way of doing this: If you don’t have the money, then head over to my YouTube channel and subscribe. You’ll find free preview of this course there. I truly believe there is enough information out there for you to do this for free and learn these skills as a developer if you have enough determination.
Subscribe to my YouTube Channel if you’re interested in more informative write-ups like these in the future!