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.

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

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误