Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Reduce number of backend requests from the UI (SUGGESTION: Forecast-based, not empirically confirmed) #36

Open
wwerner opened this issue Sep 21, 2019 · 5 comments

Comments

@wwerner
Copy link
Contributor

wwerner commented Sep 21, 2019

Currently, most things the UI requires are queried from the backend each time they are required.

This includes:

  • Units
  • Contexts
  • Schemata and Schemata Versions
  • Valid Categories and Status

While this makes state management between client and server easier, it is more chatty then stricly required.

Since the payloads are rather small, this is not a big issue now, but we should probably discuss the trade-off between state management complexities and responsiveness of the UI and network load.

@VaughnVernon
Copy link
Contributor

VaughnVernon commented Sep 21, 2019

@wwerner Would this use expiration headers to prevent stale state? What would the appropriate timeout be? For the initial version we shouldn't worry about this but the issue should remain for later decision making. This will need to scale in the near term.

@wwerner
Copy link
Contributor Author

wwerner commented Oct 11, 2019

The simple option is to reload data from the client from time to time, either scheduled or tied to specific user actions.

A cool alternative would be to leverage SSEs (which seems to be supported in vlingo-http already) and push changes to connected clients that way, effectively extending reactivitiy to the client. This feels like the right thing to do, since we're already reactive on both server and client side (through the usage of Vue).
I'm not sure of how easy this is to build, but I'll give it some thought.
I'd love to discuss this further and see whether it's feasible.

@VaughnVernon
Copy link
Contributor

This will be handled by #147

@VaughnVernon
Copy link
Contributor

VaughnVernon commented Oct 16, 2020

Now in the new Svelte UI

This suggestion and forecast (not yet an issue) is now more accessible because of #147 being done. However, consider some tradeoffs.

  • Cache: Note my earlier comments about stale state is a real concern. Probably the state should be cached for less than 1 minute and at that duration it's probably too long.

  • Question: The question is, will users tend to need to bring the whole tree or subtree payload back in one request as in they will tend to navigate all over the tree? No, I don't think so, and probably only for a rare number of newcomers or curious people. It is more likely that the vast majority who have to get work done will tend to navigate to what they need to view and otherwise directly work on.

@VaughnVernon VaughnVernon changed the title [UI] Reduce number of backend requests from the UI [UI] Reduce number of backend requests from the UI (SUGGESTION: Forecast-based, not empirically confirmed) Oct 16, 2020
@Florian-Schoenherr
Copy link
Contributor

This can later be achieved by doing something like this: Tim Raderschad: Modern fetch in svelte using stores
on every tree/select-field click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants