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.

您可能会感兴趣的其他文章

转载请标注编辑来源:使用数据库服务或者使用文件的优缺点

查看本文来源   我想网 板凳 编辑

Tags:

分享
QQ书签
百度搜藏
Del.icio.us
Google书签
和讯网摘
天极网摘

回复已关闭.