Nodetrine a database abstraction layer for NodeJS

As web developers we all worked with javascript at some point, and maybe not just throwing pure JS code, but using a frameworks like JQuery, AngularJS, ReactJS, or one of the many great frameworks available. Javascript background was on all of us by default.

After Google release the javascript engine, behind the chromium project; named V8 on 2008, the team on Joyet release the first version of NodeJS on 2009. It creates a great point on history for the javascript community, for the first time it has a runtime that execute pure javascript on server side. Now those who only works on “frontend”, and has limited knowledge of other server languages like PHP, Python and Java; can really begin to create full javascript  handled software solutions.

The NodeJS community

The community of NodeJS increase every year at a tremendous rate. Many new projects and frameworks, to easy the developers life on how to build agile and great software solutions; where born.

Projects like express and are the base of many, many projects. Some others aims to be a more complex web frameworks, like sails, totaljs and mean among others; providing a MVC approach and integrating some other tools like Template generation, Form generation, and ORMs

ORMs, Why?

Database access its one of the first tasks  we require to do on most projects, any dynamic application need to persist some data at some point.

Even when BigData and NoSQL databases change the perspective of storing data and build apps; relational databases, like MySQL, Postgres, SQLite and Oracle; are still commonly used.

ORMs provide an OO approach on how we talk to this database engines, and certainly allow us to interact with them in an easy way.

There are already great tools like waterline and sequelizejs already out there.

So why do we need a new one?

Design patterns

There are two common design patterns to implement ORMs solutions

The main difference between those two, and the one i want to bring out from my personal perspective; is the way it couples your code into its own code.

Active Record been the most simplest and easiest of both, requires you to extends its models; so your business code will be coupled to the ORM you choose to its end. In the other hand Data Mapper allows you keep business rules and database code separated, and from and architectural point of view; this is important if you want to keep your code clean, and you should, even when its learning curve can be more complex


There are great implementations of the Data Mapper pattern, two examples are SQLArchemy from the Python community and Doctrine from the PHP community.

Since i do a lot of programming with Symfony and Doctrine is the default ORM, i have more understanding on how it works and was implemented.

So i decide to create a clone of that great project and juggle a little with the names, that its how Nodetrine was born.


As its father Doctrine, Nodetrine will be the organization behind several projects starting from DBAL and followed by ORM


Database Abstraction Layer aims to create a common entry point for all relational databases implemented through the Driver interface, so it can be database engine agnostic and perform the common tasks for interaction with those engines in a seamlessly way.


The project DBAL project has been released to it first version 1.0.0 and can be installed with npm. You can find more info about it on its github page and on readthedocs.

On this first release you can find the base tools to query and manipulate data on the database. There are other tools that will be implemented on the upcoming releases.


I really hope this project can help build amazing apps, but i even desire more that we can create a community around it and collaborate to make it amazing, so feel free to file bugs, write docs, tests it, use it, and write code.

So till next time

Nodetrine its here!!!

One Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s