Skip to content

Question: Can JetStream support multiple partitions so that they can be distributed to multiple machines, such as partition in kafka? #3739

Answered by Jarema
Doslin asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Doslin.

You don't need partitions (or shards) to improve HA and be more disaster resilient.
Those are needed for performance scalability.

You can set up your JetStream stream to have 3 replicas (R3) distributed across the cluster.
If you find the performance limits on it, you can split that stream into two or more smaller ones (but still R3) based on subject tokens.
Usually, it's good to think about scalability when designing subjects architecture.

If the above is not enough, then you can use deterministic subject token partitioning described here:
https://docs.nats.io/nats-concepts/subject_mapping#deterministic-subject-token-partitioning to split data from one subject to many R3 stre…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Doslin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3738 on December 23, 2022 07:53.