GoMechanic JSLovers Meetup — Exploring migration of API & DB

Setu Saurabh
GoMechanic
Published in
3 min readSep 19, 2019

GoMechanic hosted JSLovers and what a fun gathering it turned out to be. In spite of the lazy Saturday, more than 50 Javascript developers came to attend and hear the amazing things tech team at GoMechanic is building.

Over the last year, our team has completely re-written our backend from PHP to NodeJS & Python and migrated from SQL database to a no-SQL database. We chose MongoDB because of its advantages in catering to location-based businesses.

It’s quite rare for a tech company to migrate its database and backend at the same time.

Prasenjit and Chandra who lead all things JS at GoMechanic explained how this wasn’t just migrating the data and copying the APIs to achieve the same functionality.

Prasenjit, explaining how we migrated our backend APIs and database

We went ahead and wrote scheduling methods for all our data-tables so that all new pieces of data in real-time get copied in MongoDB, to ensure 99.999% SLA levels on the existing orders.

What helped us do it on such a large scale and without any downtime or breakages was a sweet little tool called Firebase Queue. We pushed all MySQL changes as tasks to the Queue and set up NodeJS listeners to listen in on the queue. Those listeners then fired MongoDB updates and kept the two databases in sync with a time difference of less than one minute.

While Firebase Queue works wonderfully for us, that’s not all we use it for. We’re using Firebase Queue for our real-time support chat that we plan on rolling out over the next month. We’re also using Firebase Queue to reduce our API response times for our apps. It’s a very compact but very, very robust piece of technology that we plan on building on ourselves, as well, in the near future.

The talk was followed by a session on Docker and event log by Ashok, Dinushanka and Priyanka from JSLovers.

What’s next?

We are going to assemble again based on all our learnings from migrating the frontend to ReactJS.

Oh and BTW! if what we are building excites you, we are looking for amazing ReactJS & NodeJS developers! Feel free to drop a comment or reach out to me.

More pictures from the GoMechanic JSLovers meetup.

--

--

Setu Saurabh
GoMechanic

Bitcoin & Cryptoeconomics, Products, Podcasts, Storytelling, VR, Luck, Being less wrong . Twitter/Medium/21