Colophi
Colophi

Reputation: 153

What is a good way to store a large amount of data in an offline, single-client application?

All other applications I've written have been network/web apps where I've used an SQL database to store data and that has made sense to me.

If I'm creating an application that does not need to be networked ever, is there a standard way to store this data permanently? A text file is possible, but doesn't give me the benefits of querying an SQL server nor is it very secure. Is there something similar to an SQL server that I can initiate and save on starting up my program?

Perhaps there is some structure I've never come across?

From what I've read I might be able to do something as mentioned above like with SQLite. Does that make sense for large and distributed applications?

Thanks in advance for any clarifications on how to design these types of programs.

Edit: to clarify what @TomTom was saying, it is not a large amount of data like he is suggesting. I would be surprised if it ever got over several gigs of data. My point in saying large was that it seemed unreasonable to create some sort of a data structure that I could save into a text file, load up/search through to grab my data compared to using an SQL-like database.

Reading through the answers apparently SQLite or something similar is reasonable to use for desktop applications. I'll continue looking into it and probably use it to track data for my next project.

Upvotes: 3

Views: 1813

Answers (2)

Sergei B.
Sergei B.

Reputation: 3227

You could still use SQL database, but locally. Try SQLite.

Other option to use Windows built-in database engine which name is Esent. Fast, but not really convenient to use its Api.

Upvotes: 2

Oded
Oded

Reputation: 499002

You can use an embedded database - this can be a SQL database, but does not have to be.

For windows, look at SQLite, SQL Server Compact and RavenDB (for a non SQL, document database).

Upvotes: 5

Related Questions