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

Site generator: make history scale #235

Open
fahad19 opened this issue Dec 22, 2023 · 4 comments
Open

Site generator: make history scale #235

fahad19 opened this issue Dec 22, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@fahad19
Copy link
Member

fahad19 commented Dec 22, 2023

Background

We have a status site generator here: https://featurevisor.com/docs/site/

It generates history data from Git in out/history-full.json file.

Challenge

As Git repo grows over time, this file will grow too. And it's worth coming up with a strategy for scaling it, while staying a statically generated site.

Ideas

  • Split the history-full.json file into paginated files like:
    • history-1.json
    • history-2.json
  • Generate history on a per entity basis as well, like:
    • history-feature-foo.json
    • history-segment-netherlands.json
  • If we have scaling concerns for history of individual entities, we can paginate them too:
    • history-feature-foo-1.json
    • history-feature-foo-2.json
@fahad19 fahad19 added the enhancement New feature or request label Dec 22, 2023
@jagadeeshgade008
Copy link
Contributor

jagadeeshgade008 commented Mar 5, 2024

@fahad19 It will be a good option if we use https://www.npmjs.com/package/better-sqlite3 with the filesystem as db.
I have implemented a sample example here https://github.com/jagadeeshgade008/fs-db

The good part is we can paginate easily once history is prepared

@fahad19
Copy link
Member Author

fahad19 commented Mar 5, 2024

@jagadeeshgade008: looks really cool!

but we have to understand that we have limitations to how we serve this site statically. there's no Node.js involved. so we cannot rely on DB-like solution that cannot run in the browser.

@jagadeeshgade008
Copy link
Contributor

jagadeeshgade008 commented Mar 13, 2024

@fahad19 How about implementing similar to this
image

will create jsons based on year or if we want we can create based on day as well and when on click of day will fetch respective json instead of getting entire history json on load

@fahad19
Copy link
Member Author

fahad19 commented Mar 13, 2024

too many clicks I would say.

most often, people would be only interested to see the latest changes. so current list view does well there.

if user wants to load even older results, those can be fetched on demand.

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

No branches or pull requests

2 participants