project 12

Real-Time Backend Services

A microservice-based backend infrastructure built on bidirectional socket communication and event-driven data flow, managing many concurrent clients.

Category
Web
Role
Backend and systems architecture
Year
2026

technologies used

  • Python
  • FastAPI
  • Flask-SocketIO
  • Node.js
  • Express
  • WebSockets
  • PostgreSQL

problem

Problem

In a classic REST architecture the client has to keep asking the server for data. This consumes server resources for nothing and, in systems that need live data, causes both high latency and inconsistency between clients.

solution

Solution

I built bidirectional, event-driven socket architectures using Flask-SocketIO and FastAPI on the Python side and Express with WebSockets on the Node.js side. When data changes, the server notifies the client itself — the client doesn't have to ask. Behind that I set up PostgreSQL and MySQL connections and session management centrally.

outcome

Outcome

The result is a set of scalable services that cut data delivery between clients down to milliseconds, reduced server load and handled concurrent connections without errors.

key features

  • 01Event-driven, bidirectional socket architectures on both Python and Node.js.
  • 02Low-latency live data delivery through WebSockets and Flask-SocketIO.
  • 03Type-safe, automatically documented REST endpoints built with FastAPI and Pydantic.
  • 04Centralised setup of PostgreSQL and MySQL connections and session management.

why these choices

Why WebSockets rather than HTTP long polling?

Long polling carries the HTTP headers again on every request and constantly opens and closes the connection. A persistent socket removes that overhead entirely, minimising both bandwidth and response time.

Why both Python and Node.js?

Different services had different needs. FastAPI and Pydantic worked better where data processing and type safety mattered; Node.js and Express handled heavy concurrent connection management better. Rather than forcing a single language, I wrote each service in the tool that suited its job.

Thinking about a similar project?