BattlefyBlogHistoryOpen menu
Close menuHistory

Ask @Battlefy: why did you choose MongoDB as your primary data store?

Jaime Bueza October 9th 2017

This is a great question that a lot of engineering candidates ask me. For a bit of background, Battlefy was rewritten 4 years ago during a time when the MEAN stack was incredibly popular with the JavaScript community. MEAN stands for Mongo, Express, AngularJS, NodeJS.

While this is a huge topic, I’d like to zone in on the story where the Battlefy Engineering team came together to ensure that we had more insights into our business. Part of the problem with being on a NoSQL database is the challenge of getting business-focused reports, like monthly active players, trending games, top performing organizers, most active organizers using feature X, sales performance data, most popular Hearthstone class decks in a given period or given a select few tournaments or given a particular country, etc. Sure, you can get an engineer to write all the Mongo queries and the application logic to stitch it all together but we decided to take a better route.

We built an ETL pipeline that is able to transform our Mongo database and upload to AWS Redshift on a daily basis. Ever since we’ve implemented this pipeline, we’ve been able to use an amazing business intelligence tool, PeriscopeData to get valuable insights on our users and platform.

We’ve created dozens of reporting dashboards for different teams: product management, design, engineering, sales & business development. The return on investment with our pipeline has been huge in terms of productivity for our engineers (people can create reports without needing an engineer, engineers can focus on platform, product features, and experiments) and the whole company is able to see how our platform is performing on several different KPIs.

Like every other startup, we’re always learning and trying to improve. A lot of our engineers follow Joel Spolsky and he mentions to never write commercial applications: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/. I do think that every case is different and maybe your company needs to rewrite but for our case, we needed a solution that could

  1. be implemented quickly — as a lean engineering team, we needed to prioritize our effort and time based on business objectives
  2. provide insights to our product management, sales, business development, and design team without requiring an engineer to spend hours on building reports
  3. be flexible when the models change
  4. be deployed easily without needing to change production systems and not impact our growth initiatives by using background processes

To circle back on the question, we chose it because at the time, it was “the trusted” stack to use based on the JavaScript community and we were able to iterate quickly on product because we were all great JavaScript engineers. Could we have used anything else? for sure! But technology changes a lot in 4 years, so it’s important to take it for what it is, learn, and continue to move forward by serving our customers — and how did we do this? we built an ETL process which is very common in the enterprise software world.

For a detail explanation on our ETL pipeline, Feng Wu has done a great job of writing it up here! https://blog.battlefy.com/our-mongodb-to-redshift-etl-explained-6560642513

Cheers,
Jaime Bueza
Engineering at Battlefy

Have a question about Battlefy’s culture, product development, or engineering discipline? Ask me anything!

Jaime Bueza is a Canadian entrepreneur and Y Combinator alum. He has delivered software globally for over a decade to clients including Nintendo, Starbucks, Bacardi, T-Mobile, Verizon, Samsung, ADIDAS, Nike, Electronic Arts, Ritchie Brothers, Kiwi Collections, Cox Communications, Microsoft, and Dell Technologies. When he’s not engaging with customers and clients, he’s playing his favourite esports game, League of Legends.

Battlefy is hiring! We value passion and drive but we also believe that diversity is the key to success for every high growth technology startup. We welcome people from all walks of life.

We take care of the people, the products, the profits — in that order.

2024

  • MLBB Custom Lobby Feature
    Stefan Wilson - April 16th 2024

2023

2022

Powered by
BATTLEFY