Databases versus plain text

后端 未结 14 1681
我在风中等你
我在风中等你 2020-12-04 22:01

When dealing with small projects, what do you feel is the break even point for storing data in simple text files, hash tables, etc., versus using a real database? For small

14条回答
  •  悲&欢浪女
    2020-12-04 22:46

    I would only write my own on-disk format under very special circumstances. Reusing someone else's code is nearly always faster.

    For relational data, I would use SQLite. For key/value pairs, I would use BerkeleyDB (perhaps via KiokuDB). For simple objects, I would use JSON or YAML, but only if I only had a few.

    With SQLite and BDB, "a real database" is literally two lines of code away. It is hard to beat that.

提交回复
热议问题