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 8987051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:41:53+00:00 2026-06-15T21:41:53+00:00

I need to implement a messaging system on a web application. It’s powered by

  • 0

I need to implement a messaging system on a web application. It’s powered by PHP and MySQL and will allow registered users to message one another.

So here’s my worry: What will happen after i let the site run for two years and it gets thousands of users with dozens of friends who will each send each other millions of messages over the time?

How are the “big boys” of the IT industry handling those problems, for example Facebook? Surely their messages cannot all fit into one table (MySQL or otherwise)… But even transferring older messages in (one) archive table won’t work forever.

I will in no way build a website that will be even remotely comparable to Facebook, but i still want a solution that won’t bug out after a year or two.

  • 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-15T21:41:54+00:00Added an answer on June 15, 2026 at 9:41 pm

    Make a search for Max Value for SQL BIGINT. This script used to overflow when I wrote it a few years ago on a 32-bit machine. It’s much less of a problem now!

    http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html

    http://www.laprbass.com/RAY_integer_overflow.php

    <?php // RAY_integer_overflow.php
    error_reporting(E_ALL);
    echo "<pre>\n";
    
    // CONNECTION AND SELECTION VARIABLES FOR THE DATABASE
    $db_host = "localhost"; // PROBABLY THIS IS OK
    $db_name = "??";        // GET THESE FROM YOUR HOSTING COMPANY
    $db_user = "??";
    $db_word = "??";
    
    // OPEN A CONNECTION TO THE DATA BASE SERVER
    // MAN PAGE: http://us2.php.net/manual/en/function.mysql-connect.php
    if (!$dbcx = mysql_connect("$db_host", "$db_user", "$db_word"))
    {
       $errmsg = mysql_errno() . ' ' . mysql_error();
       echo "<br/>NO DB CONNECTION: ";
       echo "<br/> $errmsg <br/>";
    }
    
    // SELECT THE MYSQL DATA BASE
    // MAN PAGE: http://us2.php.net/manual/en/function.mysql-select-db.php
    if (!$db_sel = mysql_select_db($db_name, $dbcx))
    {
       $errmsg = mysql_errno() . ' ' . mysql_error();
       echo "<br/>NO DB SELECTION: ";
       echo "<br/> $errmsg <br/>";
       die('NO DATA BASE');
    }
    
    // CREATE A TABLE AND ALTER IT TO A HIGH INDEX NUMBER
    $sql = "CREATE TEMPORARY TABLE noise ( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY ) ENGINE=MEMORY";
    if (!$res = mysql_query($sql)) die(mysql_error());
    
    $sql = "ALTER TABLE noise AUTO_INCREMENT = 2147483646";
    if (!$res = mysql_query($sql)) die(mysql_error());
    
    
    // INSERT DATA TO ADD TO THE AUTO_INCREMENT INDEX
    $kount = 0;
    while ($kount < 15)
    {
       $sql = "INSERT INTO noise () VALUES ()";
       if (!$res = mysql_query($sql)) die(mysql_error());
       $nid = mysql_insert_id($dbcx);
       var_dump($nid);
       $kount++;
    }
    

    According to my rough calculations, if you’re aggregating messages at the rate of 1,000 per second and you’re using UNSIGNED BIGINT for your AUTO_INCREMENT key, you will experience an overflow in about 570,000,000 years. So it follows, more or less, that if you’re collecting the messages at the rate of 1,000,000,000 per second, you’ll have a problem in shorter order – perhaps around 570 years from now. But the good news is that if you’re collecting messages at the rate of even 100,000 per second, the VC community will be throwing money at you!

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

Sidebar

Related Questions

I'm trying to implement a simple messaging system in CakePHP 1.3. What I need
I am trying to implement a private messaging system in rails and I need
Assume we have a popular site. We need to implement mail-like messaging between users.
i need to implement a messaging scenario that consumes messages from throusands of destinations
I would like to implement an (open source) web application, where the user sends
Hi I need implement context help inside my .NET application. I have .chm file
I need to implement a chat system for a website, so that customers of
In order to satisfy customer requirements, we will need to let users exchange information
Need some help to implement 3rd party server for GCM (Google Cloud Messaging) for
I am working on a simple messaging system, and need to add the following

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.