Sibongakonke is a creative mobile and web developer, start-up founder and technical trainer. When he is not coding or tinkering with the raspberry pi, he spends the rest of his time ice skating.
As a result people started building complete back ends using Node. One of the most important things a back end system should do is communicate with databases efficiently. This is where Object-Relational Mapping, or ORM, software comes in. Normally, developers need to be good in both the programming language they are using and SQL in order to communicate with databases. ORMs make life easier by allowing developers to interact with databases within the programming language of their choice using objects. This article introduces ORMs, and looks specifically at the Bookshelf.js ORM.
What is an ORM?
Wikipedia defines Object-Relational Mapping as:
a programming technique for converting data between incompatible type
systems in object-oriented programming languages. This creates, in
effect, a “virtual object database” that can be used from within the
Database interactions are typically centered around the four CRUD operations – create, read, update, and delete. Bookshelf.js provides an intuitive way of doing this, for example, this what a create operation would look like: