DEV Community

Dsysd Dev
Dsysd Dev

Posted on

Building a Golang Project from Scratch — Zero to Hero — Part 2

In this part of the series, we will be designing the whole system which we will be coding in go in the future videos
dsysd dev

Youtube Link

Brief Explanation

We will have users interact with out system.

They will be saving their data in the postgres database which is the database we will be using in the backend.

Table blogs     (id, name, content, created_at, updated_at, deleted_at)
Table user       (id, username, created_at, updated_at, deleted_at)
Table tag         (id, name)
Table blog_user   (user_id, blog_id)
Table blog_tag   (blog_id, tag_id)
Enter fullscreen mode Exit fullscreen mode

The tables blog_user and blog_tag will be for keeping the relationships.

One user can have many blogs and one blog can have many tags


The user will interact with the system. All data will be saved to postgres database.

The data will be synced to elasticsearch in the backend. This sync will take place at regular intervals.

The user will be able to search the data using keywords (which will be fetched from elasticsearch).

Elasticsearch is a highly available nosql database optimised for searching.

We cannot fire

select * from postgres_table where content like %VALUE%
Enter fullscreen mode Exit fullscreen mode

The query above is super costly especially if have 10s of 1000s of blogs.

Subscribe to my Youtube channel

Subscribe to my youtube channel if you are on the lookout for more such awesome content in video format.

Follow me on twitter 🐥

Join me on Twitter for a daily dose of knowledge, fascinating trivia, and valuable insights. Let’s embark on a journey of continuous learning and discovery together! Follow me to stay inspired and informed. 🚀

Subscribe to my Newsletter

If you like my content, then consider subscribing to my free newsletter, to get exclusive, educational, technical, interesting and career related content directly delivered to your inbox

Important Links

Thanks for reading the post, be sure to follow the links below for even more awesome content in the future.

Telegram 📚:

Top comments (0)