3

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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Colophi
  • 143
  • 1
  • 1
  • 9
  • Sorry, this does not compute. I mean, "large amount of data" is more than a normal small disc subsystem can handle - so around 10k gigabyte - I would not call anything smaller "large amount of data". This requires even without network decent hardware. You are the guy who has to move a "a REALLY BIG amount of stuff" and then name a couple of small cars as technology choices instead of container ships. – TomTom Jun 30 '12 at 21:30
  • Your post is somewhat contradictory - you are saying the application is never networked, but then ask if SQLite makes sense in large and distributed applications - distributed implied network. Which is it? – Oded Jun 30 '12 at 21:33
  • The LocalDB version of SqlServer 2012 Express seems a good candidate. You can [install it](http://stackoverflow.com/questions/9655362/localdb-deployment-on-client-pc) on the client PC easily and you get the full power of SqlServer Express. (And if the need to expand arises then you could pass everything to a full fledged/networked SqlServer database) – Steve Jun 30 '12 at 21:34
  • 2012 Express tops at 10gb - that is by todays stnadards SMALL. THe user talks ot LARGE amounts of data, that is a MINIMUM 10 times that much - more 100 times. – TomTom Jun 30 '12 at 21:35
  • 3
    @TomTom - That's **your** assumption. How do you know the OP doesn't define 1gb as large? – Oded Jun 30 '12 at 21:37
  • 1
    I do not care. There are accepted definitions by profesionals. As I said - some dude not knowing what he talks about is HIS problem, not mine. Mabybe it is yours - but by all means there are accepted standards. 1gb is SMALL. ANYTHING yo ucan load into memory on a decent low end server is small, and 10gb is lower than my workstation memory. – TomTom Jun 30 '12 at 21:38
  • 1
    @thecoon ok thanks, however we are debating about something that is not precisely defined. We need to wait more input from the OP. – Steve Jun 30 '12 at 21:43
  • @Oded Sorry. I actually thought about not using the word distributed because people would get that mixed up. What I mean is other random people using it. And TomTom You're right, it's not a superbly large amount of data like you're talking about. Just not a small enough amount of data to warrant storing it in a text file, loading it into memory and playing with it from there. I'll edit my post. – Colophi Jun 30 '12 at 21:49
  • 2
    @TomTom "some dude not knowing what he talks about is HIS problem, not mine" - being an ass about it instead of asking for clarification is your problem though. You know what word has an accepted definition? "gigabyte", seeing as it's *defined* as a precise amount. Not "large". Being unaware of whatever accepted standards you're on about is not a crime. – millimoose Jun 30 '12 at 21:59

2 Answers2

5

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).

Oded
  • 489,969
  • 99
  • 883
  • 1,009
  • 1
    Sadly all not suitable for large amounts of data. OI wonder how SqlLite handles a 100gb database, and that is not a large amount. – TomTom Jun 30 '12 at 21:33
  • 1
    @TomTom - Your definition of large and that of the OP may very well be different. Do you know what size of data the OP is dealing with? – Oded Jun 30 '12 at 21:35
  • 1
    maybe, but it is not MY definition. As k for sizes for large data, big data, very large database and you vcome to standards. Some dude not knowing what the world considers large is not my problem. – TomTom Jun 30 '12 at 21:36
2

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.

Sergei B.
  • 3,227
  • 19
  • 18
  • There's a managed wrapper for Esent on CodePlex (http://managedesent.codeplex.com/). Also, RavenDb uses Esent as a backstore (for indexes storage, afaik). – Marcel N. Jun 30 '12 at 21:39
  • Actually, the link to managed esent was alreay there if you didn't see. Thx. – Sergei B. Jun 30 '12 at 22:03