devicehive-admin-console icon indicating copy to clipboard operation
devicehive-admin-console copied to clipboard

Mixed up order of notifications having the same timestamp

Open emchay opened this issue 10 years ago • 5 comments

An order of notifications is mixed up when they have exactly the same timestamp inside the database. Notification id should also be considered as a secondary sort order.

emchay avatar Jun 24 '15 12:06 emchay

Can you specify what server do you use (net/java)? The admin console preserve the order returned by the server.

vyrostkov avatar Jun 24 '15 12:06 vyrostkov

we use .net server

emchay avatar Jun 24 '15 12:06 emchay

We are trying to avoid incremental I'd counter because of scalability constraints it introduces. Did those notifications with same timestamp came from same device or not? We may increase precision on timestamp to resolve this as they supposed to be sequential from same device. Order of notifications from different devicesdoes not have to be ordered in any special way if they have exact same timestamp. Wdyt?

demon-xxi avatar Jun 24 '15 13:06 demon-xxi

Do you use MongoDB or MS SQL database on the backend? That's correct, we can not generally rely on IDs because in MongoDB they are not sequential. However, MongoDB only supports 3-digit precision for timestamps, so there's no way to increase it.

I suppose the problem applies to notifications from the same device, as there's no screen in admin console that combines notification from multiple devices..

vyrostkov avatar Jun 24 '15 13:06 vyrostkov

Yes you are right, the notifications were from a single device. And...we use MongoDB unfortunately.

emchay avatar Jun 25 '15 11:06 emchay