Solved

Creating realtime online auction and communication system for multiple users

Posted on 2015-01-10
12
63 Views
Last Modified: 2015-04-16
My task is to create a realtime online auction and communication system for an auction house. They are running a floor auction, but also inviting bidders to participate online by logging into their website and "watching" the auction in realtime, with the option to place a bid, etc.

I've got the majority of this task covered. Users will login and be tracked with a session cookie. The administrator will have a special login that allows them to control the auction, specify which lot is current, enter floor bids, type communications to bidders, etc.

When the administrator (or any other user) does some action, it will send a jQuery/AJAX request to the server and update a database. So the database will always contain the current "state" of what is going on with the auction. The administrator can also send and receive private messages to/from bidders (or the whole group), those would also go to a database.

My question is: how do I best setup this app so that users can receive information in the smoothest, most "realtime" fashion possible, from a conceptual standpoint? Sending data seems like the easy part, but updating the user's screen is what I need to figure out. It seems that I am basically building a chat room, with some specific add-on capabilities related to displaying lot information and pictures, ability to place a bid, etc.

My first thought is to use timers of some kind. Have the user's computer poll the server every X number of seconds, grab the latest set of chat messages (for example), figure out if anything has changed, and if so update the user's screen. But I obviously need to account for network lag, so I can't guarantee this will happen every X number of seconds.

Is there a smoother, more modern way to accomplish this?

Also, the administrator will control a countdown, so that a lot will close in (for example) 12 seconds. Somehow the current "count" needs to be distributed to everyone who is logged in. And if a floor bid is placed, the count is reset to 12 seconds again. Should the server contain the "master" countdown? Or the administrator's computer? How best to distribute this countdown to all users?

I'm obviously not looking for code here. I think I have the skills to create this system, just looking for some advice on how best to approach this.

Thank you!
0
Comment
Question by:bbdesign
  • 6
  • 5
12 Comments
 
LVL 8

Expert Comment

by:Ahmed Merghani
Comment Utility
Hi bbdesign,

Maybe "XMPP" protocol is what you are searching for. See this link:
http://en.wikipedia.org/wiki/XMPP

regards,
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
Along the lines on what Ahmed has said, I would look at Websockets.  This would allow your server to push out data at realtime to your clients

http://caniuse.com/#feat=websockets Shows compatibility with all the major browsers, including mobile if you're thinking responsive
http://www.html5rocks.com/en/tutorials/websockets/basics/ Explains basically what they're about.
0
 

Author Comment

by:bbdesign
Comment Utility
It sounds to me that, since I have no experience with these different protocols, and I have to build a real project for a client in the next few months, I should look to an API or software library. Looking at the URLs you provided, so far I have found these:

http://socket.io/
https://pusher.com/

This sounds like the way to go? Any others I should be looking at? I only need this to work on a browser for now, not a mobile app or anything like that.

Thank you.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
I haven't built anything using websockets yet so I can't recommend one over the other, however I suspect it will be the server side code that will do most of the grunt work.

As you can see, there are even websocket plugins that work natively with jQuery (https://code.google.com/p/jquery-websocket/) to just send and receive JSON data so I don't think the browser is the issue here.  I had a quick browse at the links you found but I'll ask you the question, do they fit the bill server side for you?
0
 

Author Comment

by:bbdesign
Comment Utility
Good question. The site I am building this on runs MIcrosoft IIS and MIcrosoft SQL Server. I will have to look into how the server side would function. My thinking is that the admin would send messages, those would get stored in a database, and then "something" would send messages to the client computers (auction bidders who are logged in) based on whatever activity is going on.
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
Comment Utility
Certainly the easiest approach is the polling scenario, where the browsers hit your servers with requests but this could generate an enormous load, as you could imagine.

EE uses websockets to push notifications so we know it can be done :)

I would approach this in a way to keep it as simple as possible. You've seen how simple the client can be (from my previous post), the server socket program should be the same. Registers "listeners" when they connect, and sends data to those connections when instructed. A middle man if you will. It means that the server side can be polling for changes (if it can't be notified directly), which is a lot less overhead than having every client do it.
With the websocket method you would need to have some kind of authentication relating to a valid session, going back and forth to ensure bids are kept private etc.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:bbdesign
Comment Utility
The somewhat pre-built tools such as:
http://socket.io/
https://pusher.com/
... I think those use WebSockets, with fallback mechanisms. I need to research them more thoroughly to see which (or if any others) would be the best fit.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
That's correct.  Let us know how you go.
0
 

Author Comment

by:bbdesign
Comment Utility
I was talking to a colleague today, he recently used this, and was strongly recommending it:
https://www.firebase.com

He claims its the coolest thing out there of its type.
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
It does look pretty cool.  How does your budget look regarding its pricing? https://www.firebase.com/pricing.html

This is the issue sometimes being a developer because you have to weigh up the cost of buying something off the shelf versus cost of developing (and maintaining) it in-house.
0
 

Author Comment

by:bbdesign
Comment Utility
I did not, but thank you for pointing that out.
0
 

Author Comment

by:bbdesign
Comment Utility
For this particular project, we are going with Firebase. The client doesn't have a problem paying the fee, and their software really took a huge chunk out of the programming time I would have to put in. Thanks for all the advice.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now