This is probably a very basic question, but I’m in the process of making a Windows Forms based application, which will involve a hefty amount of data storage. It will essentially be a sports simulator where there’ll be hundreds of teams, with thousands of players.
So I need to figure out the best way to store this data. Windows Forms is relatively new to me as I’ve been mostly working with ASP.NET, but I’ve come up with the following ideas:
- Compact SQL database in the program directory
- Files containing the serializable objects.
Are there any other solutions out there that may be better? Or which of these should I pick?
Your requirements are extremely vague, but in general stay away from serialization for any kind of persistent data store.
If your data is relational (it has internal structure, such as “teams must contain players” or “a player can be a member of only one team”) then I suggest a relational DBMS such as SQL Server Compact Edition or SQLite.
If your data is not relational, I suggest a key/value store like RavenDB.
Also, do not put data in the program directory; it may not be writable by the user. Store data in the user directory.