Data flow in back-end from a bird’s eye view

Bektur Elebes
2 min readFeb 18, 2021

When just starting to learn the back-end web development, one might get lost in functionalities of all new web application frameworks and libraries, and especially it is easy to get confused in the order, by which they act.

Here I decided to give an overall description of how data flows in the back-end, when using Node, Express, and Sequelize, with PostgreSQL database. Let’s first remember definitions of above-mentioned tools:

  1. Node.js — JavaScript runtime environment for the server side (in other words, it lets developers write and run JavaScript code on the server).
  2. Express — A minimal and flexible Node.js web application framework (basically, it helps you manage routes, handling requests and views).
  3. Sequelize — A Node.js Object Relational Mapping for database (in other words, it provides easy access to database).
  4. PostgreSQL — Database management system (other popular databases: MySQL, MongoDB, SQLite etc.).

Now, let’s move on to the process of data flow. So, what happens when browser asks server for data?

  1. Express comes in. Express receives request -> Express finds matching route -> Express runs code in route -> Express makes database call utilizing Sequelize.
  2. Sequelize comes in. Sequelize talks to pg to make SQL call to database (PostgreSQL is our database) -> Postgres executes SQL and returns response -> Sequelize creates objects from response.
  3. Express again comes in. Express sends objects (created by Sequelize) in JSON format as a response back to browser.

Browser receives data and generates the DOM tree, but it’s a whole ‘nother story.

This is a cursory look on data flow in the back-end and there are many details at each step that need to be considered. However, sometimes bird’s eye perspective is all we need to wrap our heads around.

--

--