Link to home
Start Free TrialLog in
Avatar of Brad Bansner
Brad Bansner

asked on

Creating realtime online auction and communication system for multiple users

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!
Avatar of Ahmed Merghani
Ahmed Merghani
Flag of Sudan image

Hi bbdesign,

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

regards,
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.
Avatar of Brad Bansner
Brad Bansner

ASKER

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.
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?
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.
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
That's correct.  Let us know how you go.
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.
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.
I did not, but thank you for pointing that out.
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.