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

[Question] How to handle large peristent stores? #380

Open
skoenfaelt opened this issue Feb 7, 2025 · 1 comment
Open

[Question] How to handle large peristent stores? #380

skoenfaelt opened this issue Feb 7, 2025 · 1 comment

Comments

@skoenfaelt
Copy link

Hello,
we are integrating a selfmade permission management system.
Basically we have a user which has groups and roles and via those we fetch all his permissions.
Lets say the app is grown and we have many permissions > 1000.

Perisisting all the permissions of a user (lets say 60), then we have the issue with the cookie size. A cookie with 60 guids is larger than 4kb (max cookie size)

One workaround might be putting this store into the localstorage. This is not best practice due its lack of security and its not SSR friendly.
Another workaround might be partition a cookie. This is not a web standard as far as I know.

How do you handle persisting larger stores? Do you have better Ideas?
This might lead into improvements of the pinia peristenstate docs.

@skoenfaelt
Copy link
Author

skoenfaelt commented Feb 7, 2025

I have made some thoughts.
Our approach is not that legal in terms of the eu gdpr.
So the correct way would be store data in the pinia store and only persist (if needed) those app data like theme settings...

So the userStore should not persisted. I do not like that approach, since you need to lead the needed data on f5 instead of consuming the store. That will lead to more traffic.
The permissions could stored in the session/ localstorage (maybe with node crypto "secured")

What are your ideas on that topic? Still, how do you handle large persisted stores?

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

1 participant