Self Managed Database with node-json-db

Self Managed Database with node-json-db

The Use Case

This is not a tutorial it is merely an Opinion

I'm creating a small cms for a game I am building so that the game can be easily customized by collaborators.

Technologies

  • Next.js - tailwindcss (headless front-end)
  • Nodejs - Express - typescript - JWT (back-end)

Foreword

For the last year, I have been chopping down trees with a hammer... and I have grown in ways I never expected.

I can't tell you how many times I have watched tutorials and articles to use the coupling of technologies someone else recommends. I think there is a lot of value of trying things and finding out for yourself.

Meat and Potatoes

What is node-json-db?

It's an npm package that provides a creative and robust way to CRUD data within JSON files. I just cut out the need for MongoDB in my express app...

Let that sink in.

Why does node-json-db work as a traditional database alternative?

Since my project is small and limited to the number of people to support. I can make due with a fairly small data storage footprint. I'm not going to have thousands of users anytime soon and being able to easily manipulate the data whether from the app or file is very convenient.

Each file works as a separate db so I could theoretically create a new file for each collection of data I have and thus reduce the type and amount of data a JSON file stores.

This has some security implications

Yep, not ideal if you are working on an enterprise app or with incredibly sensitive data that requires added roles and permissions for your employees to access. However, for small projects with fewer writes than reads, I honestly think this is a great way for getting started fast with a data storage solution locally.

Lets Look At Authentication

This is fairly early on but it is indeed a quick way to get started effectively.

image.png

Conclusion

There are endless ways to be innovative and creative especially leveraging programming. I hope to create more content related to this npm package and the stack I chose for my project.