Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Recon

Database vs File

This topic is 5277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I guess I would be considered a novice as I have never done any hardcore programming in the last few years. I have only been developing small applications that are helpful to myself so I don''t know much about specifics. Anyway, I will be saving information to several files which will occasionally have additional data appended to them - never anything removed. The number of files will gradually build up and the data within them could grow, but each one shouldn''t be extensively large in size. I was wondering whether it would be more efficient to use a database rather than individual files. I like to see it as saving each appended piece of data to the database. These entries would be identified as belonging to a certain file. I wanted to know if it would be faster or slower to save each appended piece of data to the database. Would it be faster to open each file to add information or add an entry into a database? If the application needs to sort through the information in each file, would it be more efficient to query a database or search a file? I could see the number of appended pieces of data to be in the 1000s. Thanks for your help and advise in advance.

Share this post


Link to post
Share on other sites
Advertisement
You''d have to give us more information about your program before we can say Database or Files. Generally, if you don''t need to add, subtract much information in your app, then stick with files. If you''ll be constantly adding and subtracting objects, then a DB would be better. Generally, most games (except for MMO games) don''t need a DB.

Be sure to check out MySQL if you plan on the DB route.

--------------------------------------------------------------------------------
Good Links: C++ Reference, Java API
SDL Home Page, Lua Scripting Language, Python Scripting Language
Chris Taylor''s Design Document (Downloadabe MS-Word Only), Blitz Basic Homepage

Share this post


Link to post
Share on other sites
depends on what you really need to do with these files. if all you need is to store lots of data and then read them all at once, go with files. if you need to store lots of complex data structures but you also need to search for specific data in the files then maybe an RDBMS is a better choice. or maybe the problem is not big enough to warrant the need for an RDBMS system, and you might be better off building a simple DB system of your own.

VRAM Strider.

Share this post


Link to post
Share on other sites
1000 entries should not be too large unless you have really long entries. The main advantage the database would give you over files is the ability to use SQL queries. On the other hand, as long as you keep or can export your data in some simple text format (tab-separated or comma-separated), you should be able to import it into any database.

Share this post


Link to post
Share on other sites
What are you programming in?

C# has the nice ability to write datasets to XML files.
It works quite well with medium numbers of records.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!