Designing Unique Keys(Primary Keys) for a heavily denormalized NoSQL database?

Then you could use a simple synchronized counter and initialize it on startup with the next available id On the other hand a database should be able to handle the UUID hashes as created by java. This is a standard for creating things like sessionIds, that need to be unique. Your problem is somewhat similar since a session in your context would represent a set of user input.

Then you could use a simple synchronized counter and initialize it on startup with the next available id. On the other hand a database should be able to handle the UUID hashes as created by java. This is a standard for creating things like sessionIds, that need to be unique.

Your problem is somewhat similar since a session in your context would represent a set of user input.

Thanks Oliver! Yes this is a distributed application with a distributed database Cassandra. Since this database is eventually consistent, the synchronization may not be very fast and this may lead to problems as the data for that id may be overridden.

But it is also possible to tune the consistency level in Cassandra, I'll look into that if that leads to a feasible solution. Is there any other alternative besides this? – Marcos Feb 3 at 8:24 For the Ids of the posts should I generate them using combination of 'userId' & 'Posts count of that user' like this userId:PostCountOfUser – Marcos Feb 3 at 8:24 using the userId as part of your sounds like a good idea in your scenario.

Depending on your data representation it could also enable you to search faster for all posts of a user. (I guess you can assume a user is only logged on once, and entering posts in one session at a time) – Oliver Feb 3 at 14:58.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions