Should you use an ORM?

Valéry Raulet
4 min readMay 30, 2024
Photos by Museums Victoria and by Simon Kadula on Unsplash

Introduction

I previously worked for a company that was lacking in terms of modern technologies. As usual, when working on a project, I like to introduce more modern technical solutions and I decided to help by developing an API framework that was based on an Object Relational Mapper (ORM).

Surprisingly, the first reaction was unexpected as the idea of using an ORM was immediately rejected. Through this article, I want to shed some light to demonstrate that an ORM may not be the perfect solution but is certainly a better solution than hand-coding (or crafting should I say) every single database request.

What is an ORM?

An ORM is a technical solution that allows abstracting the database from the code. Relational databases are queried using the SQL language which is different from the programming language. The ORM provides 2 main features:

  • Mapping: database tables are translated into an equivalent class in the target programming language (also called Plain Old Java Object “POJO” for Java or Plain Old CLR Object “POCO” for .NET);
Database tables and their corresponding POCO classes
  • Query generation: instead of writing the SQL query yourself, you use the ORM…

--

--

Valéry Raulet

I have been interested in business and technology since I was about 10. My interest spans across so many fields but I hope you’ll find my writing useful!