DEV Community

codewitgabi
codewitgabi

Posted on

7 1

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.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

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

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay