# DBS
# Flag
DBS(Data Base System,数据库系统)包括:DB(数据库)和DBMS(database management system,数据库管理系统)
- https://github.com/pingcap/awesome-database-learning (opens new window)
- https://github.com/dunwu/db-tutorial (opens new window)
- https://docs.aws.amazon.com/zh_cn/redshift/latest/dg/cm_chap_SQLCommandRef.html (opens new window)
- https://www.alibabacloud.com/help/zh/analyticdb-for-mysql/latest/sql-manual (opens new window)
- 自学SQL网 http://xuesql.cn (opens new window)
- 数据库压测 https://github.com/akopytov/sysbench (opens new window)
- https://github.com/stcarrez/sql-benchmark (opens new window)
- 优化和改写 https://github.com/XiaoMi/soar (opens new window)
- https://www.1keydata.com/cn/sql (opens new window)
- https://www.twle.cn/l/yufei/sql/sql-basic-index.html (opens new window)
- https://www.begtut.com/sql/sql-ref-keywords.html (opens new window)
- https://wizardforcel.gitbooks.io/w3school-sql (opens new window)
- HiveSQL教程 https://www.gairuo.com/p/hive-sql-tutorial (opens new window)
- 加密 https://github.com/hashicorp/vault (opens new window)
- 通用SQL解析 https://www.sqlparser.com (opens new window)
- https://github.com/search?p=9&q=data+to+sql (opens new window)
- https://github.com/search?q=generate+sql (opens new window)
- https://github.com/search?q=sqlparser (opens new window)
- https://github.com/search?q=sql+visitor (opens new window)
- https://github.com/topics/sql-statement (opens new window)
备份/迁移/同步/导入导出
- https://github.com/topics/binlog (opens new window)
- https://github.com/topics/flashback (opens new window)
- 迁移 https://github.com/topics/migrations (opens new window)
- https://github.com/topics/migration (opens new window)
- 同步 https://github.com/alibaba/DataX (opens new window)
- 日志解析订阅和消费 https://github.com/alibaba/canal (opens new window)
- https://github.com/ucarGroup/DataLink (opens new window)
- 数据库迁移 https://github.com/flyway/flyway (opens new window)
- https://github.com/liquibase (opens new window)
- https://github.com/golang-migrate/migrate (opens new window)
- https://github.com/planetscale (opens new window)
- PostgreSQL迁移 https://github.com/jackc/tern (opens new window)
- https://github.com/DTStack/flinkx (opens new window)
- https://gitee.com/ghi/dbsyncer (opens new window)
- https://github.com/jeessy2/backup-x (opens new window)
- https://github.com/jeessy2/backup-db (opens new window)
- https://github.com/database-mesh (opens new window)
数据库分类
- 关系型数据库(SQL)
- 非关系型数据库(NoSQL):键值、列存储、图形、文档、搜索引擎
- 网状数据库
- 层次数据库
- 新型数据库(NewSQL):关系型数据库与NoSQL的结合 The bridge between SQL and NoSQL (opens new window)
- 分布式数据库
NoSQL
- 1970: NoSQL = We have no SQL
- 1980: NoSQL = Know SQL
- 2000: NoSQL = No SQL!
- 2005: NoSQL = Not only SQL
- 2013: NoSQL = No, SQL!
# 其他数据库
- https://github.com/cmu-db/dbdb.io (opens new window)
- https://github.com/polardb (opens new window)
- https://db-engines.com/en/ranking (opens new window)
- https://github.com/wbtlb (opens new window)
- https://github.com/SQream (opens new window)
- https://github.com/dremio (opens new window)
- https://github.com/exasol (opens new window)
- https://github.com/Teradata (opens new window)
- https://github.com/machbase (opens new window)
- https://github.com/cloudera (opens new window)
- https://github.com/ActianCorp (opens new window)
- https://github.com/Xeograph (opens new window)
- https://github.com/forcedotcom (opens new window)
- 分布式 https://github.com/cockroachdb (opens new window)
- https://github.com/apache/ignite (opens new window)
- https://github.com/rethinkdb (opens new window)
- https://github.com/cubrid (opens new window)
- https://github.com/pingcap/tidb (opens new window)
- https://github.com/tidb-incubator (opens new window)
- https://github.com/tikv/tikv (opens new window)
- https://github.com/yugabyte/yugabyte-db (opens new window)
- https://github.com/apache/cassandra (opens new window)
- https://github.com/apache/kudu (opens new window)
- https://github.com/KvrocksLabs/kvrocks (opens new window)
- CrateDB https://github.com/crate/crate (opens new window)
- https://github.com/influxdata/influxdb (opens new window)
- https://github.com/VictoriaMetrics/VictoriaMetrics (opens new window)
- 使用Raft算法 https://github.com/etcd-io/etcd (opens new window)
- https://github.com/etcd-io/bbolt (opens new window)
- https://github.com/jnwatson/py-lmdb (opens new window)
- https://github.com/basho/riak (opens new window)
- K/V数据库 https://github.com/google/leveldb (opens new window)
- https://github.com/couchbase/moss (opens new window)
- https://github.com/memcached/memcached (opens new window)
- https://github.com/sirixdb (opens new window)
- https://github.com/scylladb/scylla (opens new window)
- https://github.com/erthink/libmdbx (opens new window)
- https://github.com/EQ-Alpha/KeyDB (opens new window)
- https://github.com/apache/incubator-pegasus (opens new window)
- https://github.com/FoundationDB/fdb-record-layer (opens new window)
- https://github.com/flower-corp/rosedb (opens new window)
- https://github.com/hivedb/hive (opens new window)
- https://github.com/facebook/rocksdb (opens new window)
- https://github.com/pmqs/BerkeleyDB (opens new window)
- https://github.com/apache/incubator-kvrocks (opens new window)
- https://github.com/datenlord/Xline (opens new window)
- https://github.com/seladb/pickledb-rs (opens new window)
- https://github.com/freenet/locutus (opens new window)
- https://github.com/cberner/redb (opens new window)
- https://gitlab.com/tglman/persy (opens new window)
- https://nest.pijul.com/pijul/sanakirja (opens new window)
- https://github.com/rustbase/dustdata (opens new window)
- https://github.com/photondb/photondb (opens new window)
- https://github.com/komora-io/marble (opens new window)
- https://github.com/tikv/agatedb (opens new window)
- https://github.com/engula/engula (opens new window)
- 面向列的数据库 https://github.com/ClickHouse/ClickHouse (opens new window)
- Go嵌入式(S)QL数据库 https://gitlab.com/cznic/ql (opens new window)
- https://github.com/oceanbase/oceanbase (opens new window)
- https://github.com/roseduan/rosedb (opens new window)
- 时间序列数据库 https://github.com/OpenTSDB/opentsdb (opens new window)
- https://github.com/apache/hbase (opens new window)
- https://github.com/baidu/BaikalDB (opens new window)
- https://gitee.com/mirrors/EdgeFS (opens new window)
- https://github.com/Tencent/paxosstore (opens new window)
- https://github.com/taosdata/TDengine (opens new window)
- https://github.com/infinispan/infinispan (opens new window)
- https://github.com/griddb/griddb (opens new window)
- https://github.com/RocksCloud/rocksredis (opens new window)
- https://github.com/MonetDB/MonetDB (opens new window)
- https://github.com/CeresDB/ceresdb (opens new window)
- 物联网 https://github.com/apache/iotdb (opens new window)
- 内存关系数据库 https://github.com/VoltDB/voltdb (opens new window)
- https://github.com/memsql (opens new window)
- https://github.com/cmu-db/noisepage (opens new window)
- 不可变数据库 https://github.com/codenotary/immudb (opens new window)
- https://github.com/stoneatom/stonedb (opens new window)
- https://github.com/dragonflydb (opens new window)
- https://github.com/surrealdb/surrealdb (opens new window)
- https://github.com/bridgedb/BridgeDb (opens new window)
- 去中心化 https://github.com/dolthub/dolt (opens new window)
- 移动数据库 https://github.com/realm/realm-core (opens new window)
- 数据流 https://github.com/mit-pdos/noria (opens new window)
- https://github.com/risingwavelabs/risingwave (opens new window)
- OLAP https://github.com/risinglightdb/risinglight (opens new window)
- 向量化数据库 https://github.com/facebookincubator/velox (opens new window)
- 矢量数据库 https://github.com/milvus-io/milvus (opens new window)
- https://github.com/topics/spark (opens new window)
- https://github.com/snowflakedb (opens new window)
- https://www.microsoft.com/zh-cn/sql-server (opens new window)
- https://github.com/typesense/typesense (opens new window)
- https://github.com/weaviate/weaviate (opens new window)
- https://github.com/qdrant/qdrant (opens new window)
- https://github.com/chroma-core/chroma (opens new window)
- 图数据库 https://github.com/neo4j/neo4j (opens new window)
- https://github.com/distributedio/titan (opens new window)
- 分布式图形数据库 https://github.com/JanusGraph (opens new window)
- https://github.com/JanusGraph/janusgraph (opens new window)
- https://github.com/sones/sones (opens new window)
- https://github.com/CodyKochmann/graphdb (opens new window)
- 图形数据库 https://github.com/vesoft-inc/nebula (opens new window)
- https://github.com/orientechnologies/orientdb (opens new window)
- https://github.com/arangodb/arangodb (opens new window)
- 多模型数据库 https://github.com/arangodb/arangodb (opens new window)
- https://github.com/apache/couchdb (opens new window)
- https://github.com/apache/incubator-hugegraph (opens new window)
- https://github.com/TrinityCore/TrinityCore (opens new window)
- https://github.com/cayleygraph/cayley (opens new window)
- https://objectivity.com/infinitegraph (opens new window)
- https://allegrograph.com (opens new window)
# Redis
- https://github.com/huangz1990 (opens new window)
- https://github.com/antirez/redis-doc (opens new window)
- https://github.com/guodongxiaren/redis-wiki (opens new window)
- https://github.com/yu-linfeng/redis5.x_tutorial (opens new window)
- redis常用特性 https://github.com/LxyTe/redis (opens new window)
- https://github.com/Ctzzhang/Ctzzhang.github.io (opens new window)
- 基于Redis和S3分布式POSIX文件系统 https://github.com/juicedata/juicefs (opens new window)
- Java https://github.com/redisson (opens new window)
- https://github.com/RedisJSON (opens new window)
- https://github.com/lettuce-io/lettuce-core (opens new window)
- Go https://github.com/gomodule/redigo (opens new window) *C# https://github.com/imperugo/StackExchange.Redis.Extensions (opens new window)
存储方式
- 适合用 String 存储的情况:
- 每次需要访问大量的字段
- 存储的结构具有多层嵌套的时候
- 适合用 Hash 存储的情况:
- 在大多数情况中只需要访问少量字段
- 自己始终知道哪些字段可用,防止使用 mget 时获取不到想要的数据
安装
wget https://download.redis.io/redis-stable.tar.gz
tar -zvf redis-stable.tar.gz
cd redis-stable
make
make install
cp redis.conf /etc/redis.conf
vi /etc/redis.conf
输入
/daemon
按A 或i 把daemonize no
改成daemonize yes
允许任意IP访问:输入/NETWORK
搜索,替换bind 127.0.0.1
为bind 0.0.0.0
设置访问密码:输入/SECURITY
搜索,取消注释requirepass foobared
修改protected-mode yes
(保护模式,需配置设置访问密码) 为protected-mode no
# 启动
redis-server /etc/redis.conf
ps -ef | grep redis
# 连接redis
redis-cli -p 端口 -a 密码
# 配置设置密码,不会修改配置文件
config set requirepass 密码
# 单实例关闭redis
redis-cli shutdown
# 多实例关闭,指定端口关闭redis
redis-cli -p 6379 shutdown
# MongoDB
MySQL →