January 26, 2018Going Serverless with AWS DynamoDB in Under Two Weeks
Here’s how we switched over to Serverless DynamoDB from MySQL in under two weeks with a tremendous boost in performance.
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 a 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 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 a 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.
Subscribe to my YouTube Channel if you’re interested in more informative write-ups like these in the future!