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

  • Home
  • SEARCH
  • 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 8597957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:02:35+00:00 2026-06-12T01:02:35+00:00

I want to understand how to build a large site database architecture for chat

  • 0

I want to understand how to build a large site database architecture for chat messages.(example facebook.com or gmail.com)

I think that messages is redistributed in different tables because having all the messages in one table is impossible, the reason is they have huge quantity right? (and here partitioning can’t I think)

So, what logic is used to redistribute messages in different tables? I have several variants but I think none of them is an optimal variant.
So generally, I’m interested in what you may think about this? and also, If you know some good articles about this, please post the link.

  • 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-06-12T01:02:37+00:00Added an answer on June 12, 2026 at 1:02 am

    OK, well the problem is how to partition the dataset. The easiest (and often the best) way to think about this is to consider the access pattern. what messages are needed quickly, which ones can be slow, and how to manage each of them.

    Generally older messages can be held on low network speed/low memory/very large storage nodes (multi-terabyte).

    New messages should be on high bandwidth network/high memory/low storage nodes (gigabytes are enough).

    As traffic grows, so you’ll need to add storage to the slow nodes, and add nodes to the fast nodes (scale horizontally).

    Each night (or more often) you can copy old messages to the historical database, and remove the messages from the current database. Queries may need to address two databases, but this is not too much trouble.

    As you scale out, the data will probably need to be sharded i.e. split by some data value. User-id splits makes sense. To make life easy, all sides of a conversation can be stored with each user. I would recommend using time bucketed text for this (disk access is usually on 4k boundaries) though this may be too complicated for you initially.

    Queries now need to be user-aware so they query against the correct database. A simple lookup table will help there.

    The other thing to do is to compress the messages on the way in, and decompress on the way out. Text is easily compressed and may double your throughput for a small cpu increase.

    Many NoSQL databases do a lot of this hard work for you, but until you’ve run out of capacity on your current system, you may wish to stick to the technologies you know.

    Good luck!

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

Sidebar

Related Questions

I want to understand how a C++ program that was given to me works,
I want to understand why the following is happening. My guess is that a
I want to understand more about the system and DB architecture of MongoDB. I
I want to use jQTouch to build iPhone app for large website. When searched
I want to build a very simple servlet that will read the http posted
Let's say that I want to build 2 different sets of tablet-only layouts. One
I want to build an application that will allow the user to upload a
I understand that Microsoft uses this template when versioning their products: Major.Minor.Build.Revision. Major is
I want to understand the role interface plays in inheritance between two classes. My
I want to understand the actual theory behind types rather than just learning about

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.