When should I use combined stream instread of single stream?

Hi, I want to know the advanage of combined stream over single stream, and when should I use combined stream instread of single stream?

Thanks!

Combined streams allows you to subscribe to multiple streams under one websocket connection, so it’s easier to manage:

  • Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker

Although if that one connection has issues, you don’t have a back up and because there’s multiple streams, the performance might be worse.

This being said, it’s up to the user to select which one to use according to their project design/use cases.

When I subscribe combined stream like the url below, I will recieve the event of bookTicker of btcusdt and bnbbtc at the same time.

  • Example: wss://stream.binance.com:9443/stream?streams=btcusdt@bookTicker/bnbbtc@bookTicker

If I only subscribe one stream each time, I need subsribe twice and recieve event of btcusdt@bookTicker and bnbbtc@bookTicker at different time.

So combined stream is more convenient.

Am I right?

Not necessary related to pushed event timing, the main difference is the WebSocket connection management.

Could you provide more details about websocket connection managet in combined stream?

When using combined stream as your example, there will be 2 websocket connection with the server (one for btcusdt@bookTicker and the other for bnbbtc@bookTicker).

If one connection has issues, the other connection will not be affected.

Am I right ?

Thanks!