What options do I have when I want to store data from an application locally and without external dependencies?

StackOverflow https://stackoverflow.com/questions/17458283

  •  02-06-2022
  •  | 
  •  

Question

I am designing an application which ofcourse needs data storage (e.g. user accounts, logs, etc). I don't want performance to be a problem so the retrieval/update/removal of data will be in a separate thread from the main application thread (creator-consumer model).

I cannot use NoSQL databases or any other database-system because they need an external application to be running to make the data available (e.g. with a network pipe to a host).

Yet I need my data to available withouth the need of running another application, so I want to integrate a system into my own application.

I have looked around for databases which can be integrated but I cannot find any.

  • Are there any available for simple insert, update, remove operations project only?
  • Or do I need to stick with flat files because there is no independable data storage library which I can integrate? (eg make a class and define file writing functions there for my data storage)
  • What are my other options?

Side Note: I know it would be kind of stupid, but actually one of my options: is there a SQL (PostgreSQL preferably) database which I can compile along with my project and then issue queries locally?

Was it helpful?

Solution

databases [...] need an external application

Wrong. There are plenty in-process database systems (for example SQLite which, with a little care, can be made fully ACID compliant).

is there a SQL (PostgreSQL preferably) database which I can compile along with my project and then issue queries locally?

Well I started answering before you added that remark, but again SQLite comes to mind. If this particular DB doesn't fit you, you may want to search for either "embedded database" or "in-process database", there are tons of similar products -- either SQL or even NoSQL ones.

One good NoSQL, key-value DB would be Berkeley DB but I'm afraid the license has tightened since Oracle bought it so I'm not sure if it's still relevant nowadays (unless your app is fully open-source or you can buy a commercial license).

OTHER TIPS

Sounds like a good job for SQLite

What about SQLite? It does not need any special and complex dependencies. It's fairly easy to setup and use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top