Novellizator
Novellizator

Reputation: 14883

What do programs use to store data? (do they use a known database system?)

I was thinking - let's take a look at a computer game of any kind, or any program in general. (Chrome, Skype, Warcraft,...) They need to save some things that a user wanted them to save. How do they do it? Do they save it in a simple text file, or do they pack a database system (like MySQL,...) with themselves?

Upvotes: 1

Views: 6892

Answers (3)

nneonneo
nneonneo

Reputation: 179422

There is literally no end to the ways programs will store data. OTOH:

  • home-made archive formats: every game company seems to have a few of their own (Blizzard MoPaQ,
  • XML files: usually used for simple configuration (Apple's plist files, Windows application configurations, Skype's user preferences, ...)
  • SQLite databases: usually used for larger amounts of personal data (Firefox: bookmarks, history, etc.; iOS personal information databases, etc.)
  • "In the cloud" in someone else's database (basically all web apps)
  • Plain text or simple text formats (Windows .ini/.inf, Java MANIFEST.MF, YAML, etc.)
  • ...

A single program might use multiple methods depending on what they're storing. There is no unified solution, and there is no one solution that is right for every task since every system has tradeoffs (human-readability vs. packing efficiency, random access vs. sequential archive, etc.)

Upvotes: 2

Stacey Richards
Stacey Richards

Reputation: 6606

A lot of programs use Sqlite to store data (http://www.sqlite.org). Sqlite is a very compact cross platform SQL database. Many programs do use text files.

Upvotes: 0

Gilles Radrizzi
Gilles Radrizzi

Reputation: 1009

That really depends on your needs. If you only need to store some key value pairs, an application can use a simple text file (e.g. an *.ini file) That however is a plain text file readable by everybody.

An application can of course also use a database like MySql, MS SQL. However, these are not very handy if you want to distribute your application as they run as a seperate service on a server and need to be installed seperately. Then, there are databases like Sqlite which is also a SQL database, but which stores everything inside a single file. Your application just needs a way to interact with this file.

Yet another way would be to serialize/deserialize an object which holds your data you want to store.

There are other ways to store data, like NoSQL databases. I personally haven't used one of those yet, but here is a listing of some of them: http://nosql-database.org/

XML could also be used.

There are endless way an application can store its data

Upvotes: 3

Related Questions