DEV Community

codewitgabi
codewitgabi

Posted on

Database design for backend engineers

Often times, as backend engineers, we jump into writing our database schemas/models without properly planning what they will look like and this leads to more and more migration files been generated.

For some of us, we stick to using pen and paper which is quite cool but then we may have no reference to them in the future or how then do we share those designs with future backend engineers who will work on the project (...cause you may not be working on that project forever.)

Allow me to introduce DBML to you; DBML (Database Markup Language) is an open-source DSL language designed to define and document database schemas and structures. It is designed to be simple, consistent and highly-readable.

It also comes with command-line tool and open-source module to help you convert between DBML and SQL. - dbml

What does dbml look like?

Image description

On the left, we have the dbml syntax and be the right, we have the db diagram.

With this, you can share with your team members and also have reference for future developers to quickly know what's really going on in the database aspect of your application.

DBML is quite easy to learn. No need for long tutorials. All you need is the doc and you're set to write those beautiful database designs.

Why should I use dbml?

  • For collaboration with team members
  • Nice looking design to quickly comprehend relationship between tables, db columns, etc
  • Backend developers often find it difficult showcasing their skills to employers....this should serve as something to have in your portfolio
  • You could easily convert these into sql syntaxes

I hope you enjoyed this tutorial? If so, leave a reaction else leave a comment in the comment section. Thanks for reading.

Top comments (2)

Collapse
 
omusula profile image
Daniel

Does dbml cover both relational and non relational databases?

Collapse
 
codewitgabi profile image
codewitgabi

DBML is just there to give you what your database is going to look like, the relationship between tables/collections depending on the case. So I would say Yes it covers both relational and non-relational databases