All Questions

Coding

Is it scalable to use Next.js with JSON files as Database?

I’m working on small project and I don’t really need real database like PostgreSQL or some kind of backend. I would like to just statically generate pages during build time with data from JSON files

author WBE Member

Reply
5 Answers

I don’t know if Vercel or Netlify are expected to keep their files between builds. If you save your JSONs there, and trigger a build without cache (example: after a NextJS update), you might lose your JSONs.

You can always save your JSON files to S3, DynamoDB or Firebase Firestore. The only issue is that you won’t have transactions at least for S3.

writen by WBE Member

You can definitely do that (if you’re sure that data will be saved). This should even be scalable for just building pages from the JSON files.

writen by WBE Member

Yes, files in /public folder are kept after build.

writen by WBE Member

WBE Member has some interesting opinions about using text as a DB

writen by WBE Member

yup, you don’t always need a db and this reduces complexity, I like it

writen by WBE Member

Do you want to ask a question?


Related Questions