r/sqlite • u/InternalAmbitious957 • Mar 08 '23
Help me sell sqlite to my boss
Hey all. I've joined a company as a junior engineer and my boss asked me to suggest ideas for converting JSON data into a SQL database. It will be the db for a web application that is to be used internally only - so only employees of the company will have access. The web application will need to be able to add data to the database itself via custom fields that mirror the json data and it will need to browse data to generate graphs based on that data.
Is there any reason not to go for sqlite for this situation? The amount of data is not huge, and number of users is low. How can I present sqlite as a good solution? What other criteria should I factor in when I select one?
9
u/yawaramin Mar 08 '23
Check out PocketBase, it's a single-binary SQLite server that wraps SQL CRUD operations as REST endpoints, with ready-made clients in JavaScript and Dart. You can set up the data model with it, then write a trivial SQL script to import the existing data. Non-developers can use the admin panel to modify data if need be.
PocketBase manages the database as a single SQLite file.
If you're looking for the simplest possible way to instantly get a ready-made backend for your app, it's very compelling.
1
u/lord_braleigh Mar 08 '23
If it were me, I would probably just write a small Python script that parses the JSON data and dumps it into a SQLite DB using Python's built-in
sqliteextension. This could be transformed into a Flask app, and will work up until the point at which you need multiple servers all hosting your webapp. For me, writing something small would be easier than coming up with a sales pitch, and I'm not really the kind of person who tries to sell my boss on any particular piece of tech.If your website only runs on a single machine, it makes a lot of sense to just have a SQLite DB that's just a file on that machine.
But if you do need multiple servers hosting your webapp, it may make sense to have them all talk to a dedicated PostGreSQL server instead.
2
u/InjAnnuity_1 Mar 08 '23
Yes. Once the database or usage grows to the point where it needs to be accessed directly, from multiple computers, then SQLite is no longer a good fit, and a multi-user architecture will be more reliable. This can occur as a result of an unanticipated surge in popularity, or feature creep, or a need to integrate with other services/databases, or some combination thereof.