donglu8344812 2015-05-11 00:39
浏览 53
已采纳

如何确定数据库服务器或嵌入式数据库是否合适

Bolt is a pure Go key/value store inspired by Howard Chu's and the LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL.

Bolt readme

How does one determine if an application requires a full database server? I assume it has to do with number of concurrent writers?

I'm planning on writing a simple distributed social networking application as a fun project.

  • 写回答

1条回答 默认 最新

  • douzong5057 2015-05-11 01:27
    关注
    1. An embedded database resides within the application. It doesn't need to be relational.

      For instance, the media manager on your computer has a database embedded within it to store audio/video metadata and file location. This database could be relational, in which case, the database could be something like sqlite or mysql. (i don't think postgres can be deployed embedded in an application). Embedded databases are great if you want to cache local information, or you're sure that information within the application does not need to be communicated externally for the application's functionality. A core design goal for embedded databases is having a low footprint, so in many cases embedded databases omit features found in dedicated databases.

    2. A dedicated database server supports one or many clients' read and write operations, and usually provides more features than the embedded versions. Postgres and Mysql are both dedicated databases and are used widely in networked applications. They are also both relational databases, and not key-value stores, which Bolt seems to be.

    3. A key value store is a non-relational database. Think redis (or dicts in python), where

      • retrieval: the client gives the database the key, and the database responds with the value.
      • assigning: the client provides the database a key & value, and the database assigns a new key with given value, or updates the existing key's value.

      Note: postgres has hstore, which is a key value store.

    Just like relational databases, key-value databases can be embedded within or reside separately on dedicated hardware. Here are some example questions one must ask while making these architecture decisions.

    1. Does my application depend on data that need to be communicated, and do I want to communicate the data by writing to a central database, or does each chat client connect to the other client on a peer to peer model and stores its own data?

    2. Do I need a relational model in my application, or a key-value store, or some other exotic data model?

    Just my personal opinion, the relational model has been successful at satisfying a wide variety of persistent requirements over the last 30 odd years. Has very mature solutions for both embedded or dedicated deployment. It is a good place to start.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗