Building Real-time Software Systems Made Easy By Pushpin

Before talking about pushpin, let us understand what is Reverse Proxy Server

A reverse proxy server is a server that sits between a client and a web server, forwarding client requests to the web server and returning the web server's responses to the client. In simpler terms, it acts as an intermediary between clients and web servers, hiding the details of the web server from the clients.

For example, imagine you are trying to access a website that is hosted on a web server. Instead of directly connecting to the web server, your request first goes to a reverse proxy server, which then forwards your request to the web server. The web server processes the request and sends a response back to the reverse proxy server, which then forwards the response back to you. This process happens transparently, and you do not need to know about the web server's details.

Reverse proxy servers have several benefits, including:

  1. Load balancing: Reverse proxy servers can distribute client requests across multiple web servers, improving performance and reducing the risk of downtime.

  2. Caching: Reverse proxy servers can cache frequently requested content, improving performance and reducing the load on web servers.

  3. Security: Reverse proxy servers can act as a barrier between clients and web servers, protecting web servers from attacks and vulnerabilities.

  4. SSL termination: Reverse proxy servers can terminate SSL connections, decrypting encrypted traffic and reducing the load on web servers.

Now that we understood what is Reverse proxy servers and their benefits, let us understand pushpin.

Pushpin - https://pushpin.org/

  1. What is pushpin?

    Pushpin is a reverse proxy server and event stream processor developed by Fanout

  2. Usecases of pushpin:

    • Real-time messaging: Pushpin can be used to build real-time messaging applications where users can send and receive messages in real-time. Pushpin manages client connections and delivers messages to subscribed clients in real-time, making it ideal for building messaging applications.

    • Live updates: Pushpin can be used to deliver live updates to clients, such as live scores, news updates, or stock prices. Pushpin delivers data to clients as soon as it becomes available, ensuring that users receive the latest updates in real-time.

    • Real-time collaboration: Pushpin can be used to build real-time collaboration applications such as whiteboard applications or video conferencing applications. Pushpin manages client connections and delivers data in real-time, ensuring that all participants are on the same page.

    • Real-time analytics: Pushpin can be used to deliver real-time analytics data to clients, such as website traffic data or user behavior data. Pushpin delivers data in real-time, allowing clients to react to changes as they happen.

    • Real-time gaming: Pushpin can be used to build real-time gaming applications where players can interact with each other in real-time. Pushpin manages client connections and delivers game data in real-time, ensuring a smooth gaming experience.

  3. Architecture of Pushpin:

    Pushpin architecture consists of two primary components: the Pushpin server and the backend web server. The Pushpin server is responsible for managing client connections and distributing messages to them in real time. The backend web server generates the data that is to be sent to the clients.

  4. How does it work?

    • Pushpin follows a publish-subscribe model, where the backend web server publishes messages to a channel, and Pushpin delivers those messages to subscribed clients in real time. The client subscribes to a channel, and Pushpin delivers any messages published on that channel to the client.

    • Pushpin uses HTTP long-polling, a technique that allows the server to keep an HTTP request open indefinitely until new data becomes available. This technique allows real-time data to be delivered to clients without the need for constant polling.

  5. Benefits of Pushpin:

    • Reduced server load: Pushpin reduces server load by delivering messages only when they are needed.

    • Scalability: Pushpin is designed to be scalable, and it can handle a large number of client connections.

    • Real-time communication: Pushpin allows real-time communication between clients and servers, making it ideal for building real-time web applications.

Now that we have a fundamental understanding of pushpin, their applications, and advantages, let's take a closer look at using them in upcoming blog series on pushpin.