<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          FerretDBMongoDB 的開源替代品

          聯(lián)合創(chuàng)作 · 2023-10-01 01:43

          FerretDB(以前稱為 MangoDB)的成立是為了成為 MongoDB 的開源替代品。FerretDB 是一個開源代理,將 MongoDB wire protocol 查詢轉(zhuǎn)換為 SQL —— 使用 PostgreSQL 作為數(shù)據(jù)庫引擎。

          為什么我們需要 FerretDB?

          MongoDB 放棄了它的開源根源;將許可證更改為 SSPL - 使其無法用于許多開源和早期商業(yè)項目。大多數(shù) MongoDB 用戶不需要 MongoDB 提供的許多高級功能;然而,他們需要一個易于使用的開源數(shù)據(jù)庫解決方案。認(rèn)識到這一點,F(xiàn)erretDB 將填補這一空白。

          范圍

          FerretDB 將與 MongoDB 驅(qū)動程序兼容,并將努力作為 MongoDB 的替代品。

          示例

          1. 先在docker-compose.yml文件保存以下內(nèi)容:

          version: "3"
          
          services:
            postgres:
              image: postgres:14
              container_name: postgres
              ports:
                - 5432:5432
              environment:
                - POSTGRES_USER=user
                - POSTGRES_DB=mangodb
                - POSTGRES_HOST_AUTH_METHOD=trust
          
            postgres_setup:
              image: postgres:14
              restart: on-failure
              entrypoint: ["sh", "-c", "psql -h postgres -U user -d mangodb -c 'CREATE SCHEMA IF NOT EXISTS test'"]
          
            mangodb:
              image: ghcr.io/mangodb-io/mangodb:latest
              container_name: mangodb
              ports:
                - 27017:27017
              command: ["--listen-addr=:27017", "--postgresql-url=postgres://user@postgres:5432/mangodb"]

          2. 通過postgres 容器運行存儲數(shù)據(jù)的 PostgreSQL 14 數(shù)據(jù)庫

          3. 使用postgres_setup容器創(chuàng)建一個 PostgreSQL schematest,其作用類似于同名的 MangoDB 數(shù)據(jù)庫

          4. 使用mangodb 運行 MangoDB

          5. 使用docker-compose up -d啟動服務(wù)

          6. 如果已經(jīng)安裝mongosh,只需運行它即可連接到 MangoDB 數(shù)據(jù)庫test。如果沒有,在臨時 MongoDB 容器內(nèi)運行運行以下命令mongosh,并將其附加到同一個 Docker 網(wǎng)絡(luò):

          docker run --rm -it --network=mangodb_default --entrypoint=mongosh mongo:5 mongodb://mangodb/
          
          瀏覽 22
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲一级黄色视频在线观看 | 国产人妻精品 | 免费黄色成人网站视频 | 小骚逼自拍 | 欧美18禁成人 |