Hi,
I'm looking to get a very simple node.js server that receives some information via POST (user id + data) and checks for Clients connected via Websockets to send that info to (Websockets with same user id).
IMPORTANT: Generic bids will be IGNORED. In your bid reference this description and say why you are the right partner. Especially reference knwoldge on scalable node.js / many parallel websockets.
System environment :
- AWS with Ubuntu as node server
- Cache & DB obviously separate
- HAProxy
[deployment not part of this project, but implementation needs to support such environmnet]
Function:
- node.js server with 2 main functions
- cache store with 15min default timeout
- persistent user DB (preferable SQL, optional MongoDB)
1) receive POST data with user id, version flag + JSON data
a) store POST data in cache, timeout 15min. New POST for same user id will overwrite old data. Ie there can be only one set of data.
-- on connection, check if POST uses current version, if not reply with "outdated" message (but still keep the data)
b) check if websocket with that user id is connected. if so send data to that websocket
c) check if user already in user db, if not create new user and save version flag. If user already in DB, only update version flag if requried
(performance consideration: the same user with do a POST every 20 min, so maybe changes to user DB can be cached or so/kept in memory? - as with 1000 users you already have quite some paralell POST and no need to overload user DB? )
2) Manage websocket connections (preferrable using primus - [login to view URL])
a) receive key paramters in new connection like user id, version flag and some other parameter
-- on connection, check if websocket uses current version flag, if not reply with "outdated" message (and close connection)
b) check in cache (see above) if daa for that user id exists. If so send data back via websocket immediately. Otherwise a new POST will trigger data send (see above)
c) check if user already in user db, if not create new user and add some key parameter from websocket (version flag, last connection, one or two more paramter received via websocket connection parameter. If user already in DB, only update those parameters
Overall the Cache is important for performance. User DB is more for admin reasons.
Project Ask:
1) create node server described above. Needs to be scalable (stateless)
2) create dummy HTML5 websocket client for testing - ie button to connect & disconnect + send version flag, some other example parameter
3) create simple dummy php page (or any other web technology) to send a POST request with user id, version flag and dummy json payload.