As title states I'm planning to use events (that's requirement) of user actions made on items (add/delete/update). Now here is some questions I'm trying to answer and I have feeling someone already have stumbled on same problem set:
1) Objects ID generation Server vs Client ? In case mobile client is offline - he needs to generate some ID for newly created object - so that subsequent actions on this object can have some reference on it. What would be the best approach? Generate some local ID and then assign global id generated on server (once object is pushed to server). Our architectural team thinks this is the right approach, but personally I don't see benefits of it. Especially in case user will logon on other mobile device and download all events - what Id's should he receive - Global or global + local. How this approach is better than just generating something similar to UUID (time + hardwareid + userid + incrementingId/randomId) on the client side?
2) What is the propper way of dealing with several mobile / web clients (user can be logged on single or several clients). First question here is conflicts resolution - here we have versions on our objects - to support optimistic locking - so the first who managed to do a commit is the winner. This seems to be clear. Other question is synchronization. Ideally it would be nice to download to client only updated information. So that we will need to send to client events that are not known to him. For this obviously we need to have information - which event come from which device. This is one more point for having sourceId for each event sent to server. But how can we deal with 2 or more web sessions? I'm noob in regards to WEB programming, but we would like to be stateless, does it means that some scripts on browser should generate some sort of sessionID which will be used as sourceID for all events generated on web client and instantly sent to server?
Does anybody had similar tasks? What solutions did you used / problems encountered?