Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:47:01+00:00 2026-05-28T03:47:01+00:00

Important note: I’ve asked this question already on ServerFault: https://serverfault.com/questions/349065/clustering-tcp-servers-so-can-send-data-to-all-clients , but I’d also

  • 0

Important note:

I’ve asked this question already on ServerFault: https://serverfault.com/questions/349065/clustering-tcp-servers-so-can-send-data-to-all-clients, but I’d also like a programmers perspective on the problem.

I’m developing a real-time mobile app by setting up a TCP connection between the app and server backend. Each user can send messages to all other users.

(I’m making the TCP server in Python with Twisted, am creating my own ‘protocol’ for communication between the app/backend and hosting it on Amazon Web Services.)

Currently I’m trying to make the backend scalable (and reliable). As far as I can tell, the system could cope with more users by upgrading to a bigger server (which could become rather limiting), or by adding new servers in a cluster configuration – i.e. having several servers sitting behind a load balancer, probably with 1 database they all access.

I have sketched out the rough architecture of this:
TCP server cluster problem

However what if the Red user sends a message to all other connected users? Red’s server has a TCP connection with Red, but not with Green.

I can think of a one way to deal with this problem:

  • Each server could have an open TCP (or SSL) connection with each other server. When one server wants to send a message to all users it simply passes this along it’s connection to the other servers. A record could be kept in the database of which servers are online (and their IP address), and one of the servers could be a boss – i.e. decides if others are up and running, if not it could remove them from the database (if a server was up and lost it’s connection to the boss it could check the database and see if it had been removed, and restart if it had – else it could assume the boss was down.)

Clearly this needs refinement but shows the general principle.

Alternatively I’m not sure if this is possible (- definitely seems like wishful thinking on my part):

  • Perhaps users could just connect to a box or router, and all servers could message all users through it?

If you know how to cluster TCP servers effectively, or a design pattern that provides a solution, or have any comments at all, then I would be very grateful. Thank you 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:47:02+00:00Added an answer on May 28, 2026 at 3:47 am

    You need to decide (or if you already did this – to share these decisions with us) reliability requirements for your system: should all messages be sent to all users in any case (e.g. one or more servers crashed), can you tolerate sending the same message twice to the same user on server crash? Your system complexity depends directly on these decisions.

    The simplest version is when a message is not delivered to all users on server crash. All your servers keep TCP connection to each other. One of them receives a message from a user and sends it to all other connected users (to this server) and to all other connected servers. Other servers send this message to all their users. To scale the system you just run additional server which connects to all existing servers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Important note : this question is not about the superiority of a bracing style
Important: This question isn't actually really an ASP.NET question. Anyone who knows anything about
Important : Please see this very much related question: Return multiple values in C++
I asked this question before the weekend and am still stuck despite following the
I have read on MSDN( see Important note ) that RSACryptoServiceProvider must be disposed.
We all know that having a good note taking tool is important as a
Important Update Since the release of MVC 2.0 Preview 1 this feature has been
IMPORTANT NOTE: I recieved many answers and I thank you all. But all the
This is not a how to question. I want to discuss two possible ways
Let's first get to an important note about my situation: I have 1 table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.