GithubHelp home page GithubHelp logo

backend-design-patterns's Introduction

Backend Design Pattern

Backend communication design patterns sample code with nodejs. to start, first install the requiremnts:

npm i 

Push

The push design pattern is a software design pattern commonly used in the backend to enable efficient and real-time communication between components or systems. It allows for the automatic delivery of data or events from a sender to one or more receivers without the receivers explicitly requesting the data.

nodemon push/server.js

Polling

checking for new data over a fixed interval of time by making API calls at regular intervals to the server. It is used to get real-time updates in applications. There are many applications that need real-time data and polling is a life savior for those applications.

nodemon polling/server.js

Publisher/consumer

The publisher-subscriber pattern is a messaging pattern where publishers send messages to subscribers through a message broker or middleware. The broker acts as an intermediary between the publishers and subscribers, allowing them to communicate without being aware of each other’s existence. This decoupling enables publishers to send messages without knowing who will receive them, and subscribers to receive messages without knowing who sent them.

nodemon publisher-consumer/server.js

Server sent events

Server sent events(SSE) is a pushing technology that enables pushing notification/message/events from the server to the client(s) via HTTP connection.

nodemon server-sent-events/server.js

backend-design-patterns's People

Contributors

hsnkh12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.