SUGGESTION: The websocket should have a "time buffer" so an application restart can be synchronized elegantly without REST

Right now Binance has two types of APIs (Spot as well as Futures):

  1. A REST API that has weights and limits but is quite featured
  2. A Websocket API that probably came later, it’s realtime and performant

My problem with the websocket API is that it is ONLY realtime.
If my application restarts is disconnected there is a data gap, this ruins the integrity of the orderbook and misses realtime trades.

The official (and only) solution is to synchronize the missing data through the REST API, which is complex to do and costs a lot more performance on Binance side.
The orderbook needs a full synchronization on each restart so the removals are all caught.

My suggestion:
Give the Websocket a time buffer on Binance side, for example 1 week, 1 day or just 1 hour.
Add optional parameter -> timeStart
When we use that parameter the websocket stream doesn’t start realtime, it instead starts at the timestamp given and catches up to realtime at a set rate.

If you disconnect, you can rely on rest api to catch up the data you missed

Yes, like I wrote that’s not a great solution.
It’s 3 times the development time, 5 times the code complexity and 100 times the performance required.
Given that the orderbook needs a full synchronization even after 1 second disconnect.

My suggestion would be an elegant solution to save all of that by connecting to the websocket stream exactly where you had stopped.