Skip to content

Pagination/Streaming/Virtualisation #416

Description

@oscartbeaumont

tldr: need to invesigate but fine without it for now.

Right now our dashboard will fetch all data for devices, blueprints, etc which could slow down the dashboard if a tenant has a lot of resources.

Problems around pagation:

  • Cursor in the URL for sharable links
  • Start from anywhere (due to cursor being anywhere)
  • Can/should we allow browser search for fetched items outside the visible area? Maybe we just say no, use the built-in search

Questions:

  • Cursor or page-based paganation.
    • Cursor is better for DB performance and not missing data
    • Cursor doesn't allow starting in the middle cause we can't determine the scrollbar position.

Implementing virtualisation into our Table component at the same time as this would make sense.

We could also look into streaming data from the DB to client. Right now this ends up being way slower due to the inefficent design of the Planetscale HTTP adapter spec. The extra round trips kills the tail latency while only slighting slowing down the initial response. Integrating streaming with Tanstack Query's automatic refetching is hard so that doesn't help either.

I did a quick test and the dashboard can load 1000 blueprints in 2 seconds (without CF smart placement) which is acceptable for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions