Subject Indexing and Ordering Internals #4170
-
I would have following questions that I can't answer after reading the docs and discussions. How does Nats/JetStream index subjects for filtered consumers? The unique AggregateRoot-Id count can reach view millions of entries per year. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
How does Nats/JetStream index subjects for filtered consumers? We have meta state that allows us to index efficiently by sequence number and by subject. We will continue to improve upon this but walking a filtered set of messages with the modern server should be efficient today. How does Nats/JetStream perform with a lot of unique subjects names over a long period? Currently the subject addressing layer to a stream takes more memory the more unique subjects that you have. We are working to make this more memory friendly in future releases and plan to have some improvements in 2.10. For now it will work just needs memory to hold the state. Does Nats provide the same ordering guaranty for messages For JetStream yes, all consumption through consumers will be globally ordered. For NATS core the only ordering guarantee is per publishing connection. |
Beta Was this translation helpful? Give feedback.
-
Is there more explanation around this? It seems very important to clarify. How much memory overhead per stream? If millions of streams are too expensive / hard to manage: How exactly are they indexed? (subject -> (startSeq, endSeq) will suck on sparse subjects with messages over a large interval ) |
Beta Was this translation helpful? Give feedback.
How does Nats/JetStream index subjects for filtered consumers?
We have meta state that allows us to index efficiently by sequence number and by subject. We will continue to improve upon this but walking a filtered set of messages with the modern server should be efficient today.
How does Nats/JetStream perform with a lot of unique subjects names over a long period?
Currently the subject addressing layer to a stream takes more memory the more unique subjects that you have. We are working to make this more memory friendly in future releases and plan to have some improvements in 2.10. For now it will work just needs memory to hold the state.
Does Nats provide the same ordering guaranty for m…