M-Welsch / backup-server

Backup Server (BaSe)
Apache License 2.0
3 stars 1 forks source link

Communication Backend (BCU) and Frontend (UI) #2

Closed M-Welsch closed 1 year ago

M-Welsch commented 1 year ago

Requirements

Ideas

  1. BCU sends all information on any update. Frontend decides what to do with the information
    • upside: easy
    • downside:
    • much data is sent around
    • hard to keep overview on who needs what
  2. ping/request model
    • BCU sends signal to indicate that something has changed
    • Fronend may ignore it or request new values
  3. Mixture
    • general data is loaded at page load
    • other data can be dynamically requested
  4. Polling
    • backend never sends on it's own
    • frontend has to request everything
    • no.
  5. Subscribing
    • frontend sends message: client has connected and has this list of info it needs to be up to date
    • backend sends info in list immediately and
    • backend subscribes the whole list on behalf of client
    • backend notifies frontend if state changes

Decision

we go with model 1: Backend/BCU sends message for each update (KISS). In other words. Every update is being sent directly to UI. Maybe some closely related messages will be sent in a single message.

Send all state information on page load and tab change

Messages are (nested) json strings.

M-Welsch commented 1 year ago

see #3