|
Databases |
Files |
| Advantages |
- You can easily add new fields, or modify existing fields.
- Updating player statistics (from outside the game) is much easier.
- You can instantly and efficiently retrieve various statistics, via SQL queries.
- There is no need to perform file I/O operations yourself, the database server will do that for you.
- Easy to update/restore.
|
- Very fast access (read/write).
- Easy to implement.
- No additional libraries needed.
- No dependence on a database server. Therefore, you don’t have to worry about getting database updates or security issues.
|
| Disadvantages |
- Easy to make mistakes. For example, doing an update query where you omit the ‘where’ clause. It can have disastrous effects, especially if you have old (or no) backups.
- Databases may be slower than actually opening/writing a player file. You might lose a few milliseconds when retrieving some data, especially if a lot of players log in/out at the same time.
- Additional code is required to convert your data to/from the database.
- Database and SQL experience is required. In addition, you will need a library to interface between your program and the database.
- If for some reason the database file becomes corrupt, you are out of luck; you can lose all the players (especially if no recent backups).
|
- It can be very difficult to add new fields, unless you carefully design the file format/structure from the beginning.
- Inability to do player-wide queries (this can be circumvented by having a program that adds every night the important fields in a database server).
- Needs special coding if you want to update/check player stats.
- A little bit harder to update/restore.
|
您可能会感兴趣的其他文章
发布于
2010年1月11日 ,目录 Database。
留言跟 pings 当前都已关闭。