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

[Discussion] What's the scenario of using lowdb and next.js together? #2

Open
LikeDreamwalker opened this issue Dec 6, 2024 · 0 comments

Comments

@LikeDreamwalker
Copy link

This is not an issue about this repo but I do haven't found too much info about this usage.

I was thinking building the database with Next.js Edge Service, so it should be very convenient to build API and save data by frontend.

But then I realize one thing, since the db.json is inside the project, which means when I try to build my app with the db.json, this database file will always be overwrite by the new one after I send the new docker image to the server. Which means, in this scenario, the lowdb is not a really persistent database. It should always be brand new after I update my app.

I also think maybe we should use it on the client side, not the server side, but since we already have IndexedDB, I really can't say necessity of using lowdb instead of using IndexedDB.

So for now I can draw a conclusion that lowdb with Next.js should not be designed to save the data which needs to be saved secure. One scenario I can think about is to use lowdb to cache data on Edge Service for user and real server.

Any other ideas? I think I just find a powerful weapon, but I just don't know how to use it 🤷‍♂️

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