App/
- UID1
analytics:
visits: 87687
productPageVisits : 13070
gender: M
timeStamp : 1490293800000
- UID2
analytics:
visits: 20020
productPageVisits : 130120
timeStamp : 1490293800000
UID1 is unique id of user 1 and can only access nodes below after authentication, same is UID2
Node Js code:
ref.child('app').on('child_added', function(root) {
// dynamically get UID from root and map listeners
var UID = root.key();
ref.child('app').child(UID).on('child_added', function() {
// bind child nodes with event listeners
ref.child('app').child(UID).child('analytics').on('child_added', function(snap) {
// and so on bind other child nodes with all UIDs
// get previous visit count using once, increment with 1 and update
// Currently :add task in analytics queue
})
))
and how many workers should I provide to handle around 200K concurrent users(each user has their own users like UID1 website users)? and should create 1 big queue and inside it starting other small queues? or else