We are building a large platform where we want to expose events to many subscribers.
We have decided we want to expose the events through a REST-API to be able to support all our use cases. We are not able to use event hub or Kafka since we need millions of topics. We also need to authorize access to the different events based on type of event and which person/business is related to.
One option is to use Cosmos DB as storage, but I am not able to see how we could get the order of the elements correctly. I understand that _ts property contains the epoch time since last changed, but that is only in seconds and would cause us to have hundreds of events at the same time.
Is there a way? I guess we could use the change feed to trigger something but does the change feed have some index we could set back on the document?