Max unique subjects in a single jetstream #5202
-
Hi, team! Suppose I create a jetstream in following way:
And there may be different ids to be published to this stream, like Or any advice to split large number of subjects into multiple jetstreams? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yes you can create a stream that way and place messages into it which have unique subjects. Currently the recent versions of the the server, >= 2.10.9, use a modified Adaptive Radix Trie to store in memory index data per subject that identifies metadata about the subject. Currently that is number of messages and first and last blocks. Assuming you are talking about a filestore backed stream. The stree (ART impl) uses path compression and lazy expansion so is efficient at the types of subjects you have mentioned, since only the suffix needs to be stored at the leafs. We do have plans to implement a version that can be stored to disk as well, but currently this is all kept in memory. 50k subjects should be fine. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your help!!! |
Beta Was this translation helpful? Give feedback.
-
As a test I stored 1 million small JSON files in a single JetStream Key Value store, and it only took 2min30s on a 2 year old MacBook Pro. |
Beta Was this translation helpful? Give feedback.
Yes you can create a stream that way and place messages into it which have unique subjects.
Currently the recent versions of the the server, >= 2.10.9, use a modified Adaptive Radix Trie to store in memory index data per subject that identifies metadata about the subject. Currently that is number of messages and first and last blocks. Assuming you are talking about a filestore backed stream.
The stree (ART impl) uses path compression and lazy expansion so is efficient at the types of subjects you have mentioned, since only the suffix needs to be stored at the leafs.
We do have plans to implement a version that can be stored to disk as well, but currently this is all kept in memory. 50k su…