跳至正文
Wener Notes

FerretDB

约 1 分钟阅读
    • Apache-2.0, Go
    • Open Source MongoDB alternative
    • 后端存储: SQLite, MongoDB
  • 参考
    • Supported commands
    • Known differences
      • 不能处理 \0
      • 不支持嵌套数组
      • -0 -> 0
      • Key 不能包含 .
      • Key 不能以 $ 开头
      • Value 不支持 Infinity, -Infinity, NaN
      • insert 不能包含重复 Key
      • 保留前缀 _ferretdb_
  • MongoDB -> PostgreSQL
    • databases -> schemas
    • collections -> tables
    • documents -> rows JSONB
  • 客户端
    • authMechanism=PLAIN
bash
# PostgreSQL backend
# docker run -d --rm --name ferretdb -p 27017:27017 ghcr.io/ferretdb/all-in-one

# PostgreSQL
# FERRETDB_POSTGRESQL_URL 可以没有账号密码, mongo 链接时提供
docker run -it --rm \
  -p 27017:27017 \
  -e FERRETDB_TELEMETRY=disable \
  -e DO_NOT_TRACK=true \
  -e FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/ferretdb \
  --name ferretdb ghcr.io/ferretdb/ferretdb

# mongodb://username:[email protected]/ferretdb?authMechanism=PLAIN

# SQLite
docker run -it --rm \
  -p 27017:27017 \
  -v $PWD/data:/data/ \
  -e FERRETDB_TELEMETRY=disable \
  -e DO_NOT_TRACK=true \
  -e FERRETDB_HANDLER=sqlite \
  -e FERRETDB_SQLITE_URL=file:/data/ \
  --name ferretdb ghcr.io/ferretdb/all-in-one

Model

  • _ferretdb_database_metadata
  • collection -> COLLECTION_HASH
    • _json

关联信息

反向链接、本文链接的其他页面和外部资料。

反向链接

  • Database Awesome
    笔记 · FerretDB/FerretDB

    | name | stand for | · | Relational DBMS | 关系型数据库 | · | Key-value stores | KV 存储 | · | Document stores | 文档存储 | · | Time Series DBMS | 时序数据库 |

  • Database FAQ
    笔记 · FerretDB

    between - 左闭右闭 · -> · - · 对 x, y 排序,然后 · 90% 场景选择 PostgreSQL · 优先考虑 垂直 扩容 · delay 问题 · 场景 · OLTP 关系型 - PostgreSQL, MySQL

参考资料

GitHub1 条
其他外链2 条
最近更新commit 1866667编辑