Sync
Problem
For better collaboration, the frontend must be kept up to date with the latest changes in the frontend.
Constraints
- The changes must be sent immediate.
- Events must be sent to thousands of clients.
- It should be extensible to also include events of other use cases (changes in plant database or avoiding poll for Nextcloud chat)
Assumptions
- We don't need to acknowledge sent events.
- We don't need to know which events we missed (as frontend is read-only or database is locked when offline)
Solutions
Websockets
Websockets with a protocol like STOMP could be used.
Decision
We use server-sent events (SSE) with the observer pattern in the backend.
Rationale
- Example is available and already tested with a thousand of clients.
- This adds additional complexity on client and server side as we don't need a full-duplex communication.
Implications
N/A
Related Decisions
Notes
@Bushuo creates a tracer bullet to check how it works.