web123456

Database selection guide for architects’ path to growth

Table of contents

1. Preface

2. Selection dimension

3. Related information:


1. Preface

ArchitectAt work, you often encounter the problem of database storage selection, and there are many database products on the market, so you often have no idea how to start. Sometimes, the underlying database will be replaced many times during business development to online operation and maintenance, bringing unnecessary extra work to the entire R&D center.

When selecting database storage in combination with business scenarios, you can consider the following dimensions:

2. Selection dimension

1. Does the business need to ensure ACID transactions?

         Transactions have four characteristics, namely atomicity, consistency, isolation and persistence.

YES: Mainstream relational database:MySQL, pg (PostgreSQL) etc.

NO: Mainstream NOSQL such as: MongoDB, hbase, cassandra, etc.

2. Require low latency?

The ultimate performance requirement and no need to worry about data loss: memcache

The data life cycle is short, the data volume is relatively small, the performance requirements are high, and the storage needs flexibleData structureRedis

General scyladb>canssdra>hbase

3. Is there a high concurrent write, and there are more random reads than range reads?

YES: hbase, cassandra, hbase has better reading range.

4. Massive data storage, support horizontal expansion, distributed fault tolerance?

YES: Distributed NOSQL such as: resis, hbase, Cassandra, mongodb

5. Need a full text search?

YES: Used in massive dataElasticsearch; The data volume can be controlled using pg GIST index.

6. Store complex data models?

YES: Document database mongodb

7. OLTP OR OLAP OR offline analysis?

OLTP (online transaction processing): row storage database mysql, pg

OLAP (online analysis processing): column database high compression gp, clickhouse

Offline analysis: hbase

8. Financial level requires high availability and data loss

oceanbase, Alibaba Cloud mysql financial version, mysql group replication

9. Need transactions and massive data storage

     Library and table:drds、sharding-jdbc+Relational database

     newsql:TiDB

10. CAP tradeoffs

     CAP: Consistency, Availability, Partition tolerance.

CA: Relational database

      CP :hbase、redis、mongodb

      AP :cassandra、riak 、couchdb

11. Special business scenarios

Geographic Information System GIS: PG>ES>Mongodb

Timing: TaosDB>influxdb>opentsdb

12. Development perspective, business iteration is fast, and schema free is needed

Development-friendly: Relational databases are OK. Another is MongoDB, but it also has two sides. It is not as strict as relational databases. Inserting any value of any type into any set can sometimes bring negative effects.

13. Operation and maintenance angle

Easy Operation and Maintenance cassandra>hbase

3. Related information:

Alibaba Cloud Developer Community—Database Selection:What should be considered for database selection? -Q&A-Ali Cloud Developer Community-Ali Cloud

What is ClickHouse:/likun557/article/details/109733541

The advantages and disadvantages and application scenarios of four popular databases, MongoDB, ElasticSearch, Redis, and HBase:The advantages and disadvantages and application scenarios of four popular databases, MongoDB, ElasticSearch, Redis, and HBase - Zhihu