代码之家  ›  专栏  ›  技术社区  ›  Aakash Goel

我可以使用什么简单的数据库来存储和查询数据?

  •  1
  • Aakash Goel  · 技术社区  · 15 年前

    我遇到过各种情况,我希望以一种可以轻松查询的方式存储一些格式化数据。

    例如

    $ cat so.txt
    "question_id": 58640,
    "tags": ["polls", "fun", "quotes"],
    "title": "Great programming quotes"
    "question_id": 184618,
    "tags": ["polls", "fun", "comment"],
    "title": "What is the best comment in source code you have ever encountered?"
    "question_id": 3734102,
    "tags": ["c++", "linux", "exit-code"],
    "title": "Why cant' I return bigger values from main function ?"
    "question_id": 2349378,
    "tags": ["communication", "terminology", "vocabulary"],
    "title": "New programming jargon you coined?"
    "question_id": 3723817,
    "tags": ["open-source", "project-management", "failure", "fail"],
    "title": "How to make an open source project fail"
    "question_id": 3699150,
    "tags": ["testing", "interview-questions", "job-interview"],
    "title": "Interview question please help"
    $
    

    一个简单的查询可以用标签“C++”显示问题的标题。

    这些是要求

    • 数据库只能支持我。
    • 它必须能够支持所有常规的SQL类型查询。我熟悉SQL,所以它越像SQL,越好。
    • 它必须在运行Ubuntu10.04的Linux机器上本地运行。
    • 另外,由于我的需求是最小的,我希望它不会占用太多的内存。

    为此,您建议使用什么DBMS?

    1 回复  |  直到 15 年前
        1
  •  1
  •   Oren Mazor    15 年前

    您发布的代码看起来像JSON。如果这是您主要保存数据的格式,那么像CouchDB这样的格式可能是您理想的格式吗?我是它的忠实粉丝,所以我有偏见:)

    否则,对“仅支持我的Light数据库”的传统回答是sqlite。