跳至正文
Wener Notes

Database Awesome

约 7 分钟阅读
标签:资源精选
namestand for
Relational DBMS关系型数据库
Key-value storesKV 存储
Document stores文档存储
Time Series DBMS时序数据库
Graph DBMS图数据库
Object oriented DBMS面向对象数据库
Search engines搜索引擎
RDF storesRDF 存储
Wide column stores宽列存储
Column stores列存储
Multivalue DBMS多值数据库
Native XML DBMSXML 数据库
Spatial DBMS空间数据库
Event Stores事件存储
Content stores内容存储
Navigational DBMS导航数据库
dblang
MSSQLT-SQL/Transact-SQL
PostgreSQLPL/pgSQL
OraclePL/SQL
MySQLPL/SQL (有限支持) / Stored Procedures (SQL语法扩展)
DB2SQL PL

理论

  • Sargable - Search ARGument ABLE
    • wikipedia
    • 定义查询可利用索引的场景

关系型

  • SQLite
  • MS Access
    • .accdb, .mdb
  • MySQL
  • Oracle
    • MPL-1.1, C++
    • since 1981
    • ANSI SQL

MySQL

分布式

时序数据库

  1. 可观察性 - 日志、指标、追踪
  2. IoT

OLAP

  • Cube 计算
  • BI

OLTP

Column Store

  • 面向分析
  • Apache Druid
  • Apache Pinot
  • InfluxDB
  • PostgreSQL cstore_fdw, vops
    • ORC
  • format
    • orc
    • parquet

Wide-Column

  • 宽列 - 二维 KV
    • 并非标准列存储
  • Apache Accumulo
  • Apache HBase
  • Hypertable
  • 商业
    • Bigtable
    • DataStax Enterprise
    • DataStax Astra DB
    • Azure Tables

图

Stream

消息队列

Data versioning

有趣

bash
docker run --rm -p 8000:8000 surrealdb/surrealdb:latest start --log debug --user root --pass root

curl --request POST \
  --header "Accept: application/json" \
  --user "root:root" \
  --data "INFO FOR DB;" \
  http://localhost:8000/sql

SQLite Awesome

ID

Big Data

Vector

面向向量的多用于 搜索 和 机器学习。

Vector -> number[]

常见模型的向量维度

Geo

Tools

Interactive

Library

迁移/升级/Schema 变更/Migration

不需要重复部署的环境可以不用考虑

常见模式迁移

  1. DSL - XML, YAML, HCL
  • 支持 diff
  • 多一层学习成本
  • 支持多种数据库
  • 还支持除了 table 以外的对象
  • 必须先写 DSL - SSOT
  1. SQL
  • 概念简单
  • 能利用所有 SQL 能力
  • 支持很多场景
  • 版本管理为主
  1. ORM -> SQL
  • 类似 DSL
  • 减少额外定义 DSL
  • 生成 SQL 不透明
  • 功能局限
  • 一般 diff 不会做移除列操作
  • 局限于 table

版本目录模式

  • [version]-[title].sql
    • 通过 注释 分割 up/down
    • --- up
    • --- down
  • [version]-[title].<up|down>.sql
  • [version]-[title]/ - 目录区分版本
    • up.sql
    • down.sql

TBD

  • Database eLearning
  • DB-Engines Ranking
  • Aphyr jepsen
    • EventQL is a distributed, column-oriented database built for large-scale event collection and analytics. It runs super-fast SQL and MapReduce queries.
  • Carte
    • SQL FOR THINGS DATA
    • Real-time SQL. Simple scaling. Millions of inserts per second.
    • CrateDB offers Standard-SQL, real-time queries and document support (JSON) in a simple, horizontal way to scale.
    • IoT & Sensors
      • Stream millions of data points per second into CrateDB and query them in real time to visualize, track, and predict.
    • Log & Event Analytics
      • Analyze logs from IT infrastructure to monitor security, compliance, usage, billing, and more.
    • Time Series, Geospatial, Machine Learning
      • Versatile SQL engine enables complex queries, text searches, and aggregations – in real time or against volumes of historic data.
  • dbmstools.com

Read

关联信息

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

反向链接

  • Database
    笔记 · Awesome

    Awesome

  • Observability Awesome
    笔记 · 通用时间序列数据库/time-series · time series

    logs - 日志 · metrics - 指标 · session replays - 会话重放 · traces - 跟踪 · errors - 错误 · 目前业内共识 OTEL · 大多场景直接选择 OpenTelemetry 即可 · If you can't measure it, you can't manage it.

站内链接

  • Apache Cassandra
    笔记 · Apache Cassandra

    apache/cassandra · 配置文件 http://cassandra.apache.org/doc/latest/configuration/cassandraconfigfile.html · http://projects.spring.io/spring-data-cassandra/

  • Citus
    笔记 · citusdata/citus

    Citus is not PostgreSQL · citusdata/citus · AGPL-3.0, C · 被 微软 收购 · 目前 PG 唯一的水平扩容方案 · 参考 · When to use · When · Multi-Tenant Database

  • ClickHouse
    笔记 · ClickHouse

    insert > select𐄂10000 > delete𐄂100 > update𐄂10 · 数据不变 · 数据有时间属性 · 归档数据 · 事件、日志、监控、指标 · 需要聚合非常多的数据源 - OLAP · 独立运作后重心转向 ClickHouse Cloud

  • CockroachDB
    笔记 · cdb

    cockroachdb/cockroach · BSL, Go · 参考 · Migrate to CockroachDB · BSL 协议 · Can host CockroachDB as a service for internal use at organization

  • DuckDB
    笔记 · duckdb/duckdb

    duckdb/duckdb · MIT, C++ · 嵌入式 OLAP 数据库 · 类似 SQLite - 但列存储,面向分析 · 支持查询 Parquet, CSV · 向量引擎,并行查询 · 官方支持 SDK: Python, Java, C++, NodeJS, R

  • FerretDB
    笔记 · FerretDB/FerretDB

    FerretDB/FerretDB · Apache-2.0, Go · Open Source MongoDB alternative · 后端存储: SQLite, MongoDB · 参考 · Supported commands · Known differences

  • litefs
    笔记 · superfly/litefs

    superfly/litefs · 基于 fuse 的 litestream - 批量同步 · 可作为临时节点的持久化存储 - 例如 为 Kubernetes 的 Pod 提供 DB 持久化能力 · 异步复制 - 主节点 crash 可能丢失 亚秒 级事务

  • litestream
    笔记 · benbjohnson/litestream

    benbjohnson/litestream · SQLite 增量备份 · 作为 disaster recovery · 支持存储 s3, sftp, file · HOW TO · litestream 维持一个 读 链接 · 避免发生 walautocheckpoint - 高写入时推荐设置

  • migrate
    笔记 · golang-migrate/migrate

    golang-migrate/migrate · DB 迁移工具 · 可当做库来使用 · 支持较多的 Source 和 数据库 · 不支持 ENV 和 配置文件 配置 DB - 只能 flag

  • PostgreSQL Awesome
    笔记 · PostgreSQL Awesome

    扩展插件功能 · 数据功能 - 数据类型、操作类型、索引类型 · 服务功能 - 集群、cron、存储引擎 · 查询能力 - 图、流、GIS · 集成功能 - Redis、ES · 语言功能 - JS、Lua、Java · neondatabase/neon

  • ScyllaDB
    笔记 · Scylla

    大多为 KV 访问方式 · 单行、cell 数据量不是特别大 - 默认 10MB 行、 1MB cell 会发出警告 · 兼容 cassandra,提供 dynamodb 适配接口 · 替代 Redis 作为需要持久化的 Meta 和 缓存 存储

  • TimeScale
    笔记 · timescale

    适用于 · 需要时序数据存储 · 不适用于 · 监控 · Metrics · promscale 停止开发 promscale#1836 · timescale/timescaledb · Apache-2.0 · An open-source time-series database optimized for fast ingest and com...

  • yugabyte-db
    笔记 · yugabyte/yugabyte-db

    yugabyte/yugabyte-db · Apache-2.0, GO · YQL - 兼容 PgSQL

参考资料

GitHub98 条
Wikipedia3 条
Hacker News4 条
HuggingFace1 条
标准文档1 条
其他外链28 条
最近更新commit 4b6e1d9编辑