Most of apps nowadays expect a real time update. But there's a disconnect between the tooling and expectation.
Old times:
- data is displayed as is
- to get new data, user has to refresh
- solution: rest api
Nowadays:
- real time data is displayed
- user doesn't have to do anything to get real time data, just keep the tab open
- current solution: still rest api with polling ? and probably a sse and a websocket ?
What if there's a better way to do it ?
- forget get / read request from rest api, and replace them all with
get and subscribe
? - a standardize schema of the api that can be created or implemented into any programming language, giving typesafety end to end
- lessen server burden, we just authenticate once (instead of every request on rest api)
- being able to see in real time how many clients are connected
- easier frontend integration, just connect UI into our realtime data
- no rethinking the same logic twice (ex: if user click a button, which data should get refreshed ?). New data get reflected automatically in UI.
Top comments (0)