Relational Databases and ORMs with Golang

This is the first story of a series “Golang: ORM or not ORM at Mercado Libre”. Enjoy it!

When I started at Mercado Libre, I was introduced to an incredible culture and also to new professional challenges.

In the first month in the new team (Code Ecosystem), every new person faces a ramp-up challenge. This activity consists of implementing a simple application that allows us to connect with most of the experiences we find in our day-to-day work. It allows:

  • interaction with our peers;
  • information exchange through different channels and across different teams and people;
  • knowledge of the development environment and tools, methodologies, and standards followed.

Implementing this challenge is pretty straightforward until we have to interact with a database from a GoLang project. I and those who came before me said: “Oh, I’ve joined a huge company. It’s all done,”; But it doesn’t work that way for us. As we keep moving and iterating our products, so happens our technology. That’s why we wanted to answer a big question:

How should we work with databases in our company using the language?

Before going deeper, I want all of you, my awesome readers, to be on the same page. Let’s take a look at some must-know concepts together. 👇

Language & Key concepts

About Golang

Golang is a procedural (and structured) programming language, like C, Fortran, and Pascal. Go is essentially an updated version of C designed to be more accessible to developers and to address some modern computing priorities, namely concurrency and network systems architecture. However, the solution to the latter is mostly addressed through the concurrency solution.

Some important characteristics are (which you can consult in this article or this documentation):

  • performance
  • ease of learning and use (it’s user-friendly with clearly identifiable advantages)
  • a C-like design for system-level programming
  • testing support
  • concurrency
  • a succinct syntax (like Python)
  • simplicity (readability and maintainability are the focus here)
  • standardization (its powerful standard library has all the essential stuff)
  • speed of compilation