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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:37:29+00:00 2026-05-13T17:37:29+00:00

I am building a simple ajax chat client for a school project and have

  • 0

I am building a simple ajax chat client for a school project and have thought of a way to implement this, but it seems IMO to be very cumbersome approach:

1) User A sends message which is accepted by a server-side PHP script and saved to database
2) The browser of User B periodically launches a server side PHP script to check if there are any messages in the database for User B. PHP script finds messages from User A and returns them.

Is this the right approach? Can communication between these two users be achieved without a database?

(This is my first web-application…if I was making this without browsers + HTTP, I would just make a Java program with persistent class that listened on TCP sockets, and forwarded messages to the appropriate address)

  • 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-13T17:37:30+00:00Added an answer on May 13, 2026 at 5:37 pm

    Yes your solution is good enough for starting. What you are doing is polling the server if there are any chat messages for a particular user. Good enough.

    But if you wanna goto the next level, (probably could be tough), you can have a server which can push new messages onto client browsers. This is called “Comet”. But it will need extensive server resources (if your userbase is going to exceed to thousands).

    Try your method first and go for this next.

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

Sidebar

Related Questions

I am building a site that uses a simple AJAX Servlet to talk JMS
I'm building a simple web-based RSS reader in Python, but I'm having trouble parsing
I'm building a simple image gallery with jquery but running into an annoying problem.
I'm building a simple Todo List application where I want to be able to
I am building a simple Django app that will use scribd to display documents.
I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005
I'm building a simple ice sliding puzzle to test uses of allegro. So far
I'm building a simple accounting app to be used for personal finance. A user
I'm looking at building a simple web app that will expose an API that
I am building a relatively simple Django application and apart from the main page

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.