-
Member
Database or File
So guys i just want to know what is better to store data database or files.
I also want to know the pro's and the con's in using either DB or file.
Thanks
-
-
-
Infraction Banned
Re: Database or File
He wants to know what's better to store Data
Depends what you want to store
Want to store records?
-Database
Store Codings, etc...
Files
-
Member
Re: Database or File
I want to store the cluster and it's channel's to a emulator.
-
Alpha Member
Re: Database or File
ini file would work fine for cluster info.
-
Member
Re: Database or File
Could you make me an example of one of those Organic.
I'm trying to do a flyff emulator in java and i'm using the source from JFlyff from gunner and Frost as a base.
They use the database to store the Cluster and channels. But one time i was reading a thread in here and they were saying that files are better then the DB i just wanted to know if that is true for everything or only with some cases.
-
Account Upgraded | Title Enabled!
Re: Database or File
My (limited) understanding is that the Database is more efficient than files in terms of performance. The basic configuration (Ip, database name, database password, those kinds of things) should be stored in a .txt or .ini file, but anything that the user doesn't need to change should be stored in the database, such as clusters (may want to move these to the config file later on), the accounts, characters, inventory, etc...
The argument I heard was that writing to/from files constantly demands more I/O, thus putting more stress on a system whereas with a database it does not demand as much I/O.
-
Alpha Member
Re: Database or File
It really depends on how much capacity you want and how you want it stored. Database may seem efficient, but file storage also has its possibilities.
Now, in theory, you can allocate a file for each player and store all the data there. However, if you have around 2000+ players it will be a pain to manage unless you can make a manager to help you.
Try it for yourself and see which one works for you.
Database
Pros
1. Fast and secure way to store the files.
2. Can hold near limitless users.
3. programmable stored procedures for quick and easy execution.
Cons
1. A bitch to set up if you don't know about xammp, or wammp, or apache.
2. Must be backed up frequently to prevent rollbacks, hacks, etc.
3. Need to know how to call it from language of choice.
File Storage
Pros
1. One file per character, central management.
2. Easy to interact with inside the server.
3. Near limitless space as needed on the hard drive.
Cons
1. May slow down the processes when a lot of users are needed.
2. Accidental deletion of the file may be a problem.
3. If hacked, the hackers know where to look for the character files.
Veteran programmers feel free to add to these. Its right off the top of my head.
-
Member
-
Apprentice