2018-10-06 THUDM team Eunbi Choi
SQL vs NoSQL
-
High-level differences
SQL NoSQL Relational database Non-relational database Table baesd Document based, key-value pairs, graph databases or wide-column stores Scale vertically - Increase the load on a single server. Scale horizontally - Scale across multiple hardwares. Pre-defined schema Dynamic schema Structured and unchanging data Unstructured and chainging data Language : SQL Language : UnQL (syntax varies from database to database) Examples : MySql, Oracle, Sqlite, Postgres, MS-SQL Examples : MongoDB, BigTable, Redis, Cassandra, CouchDB, Hbase ACID properties (Atomicity, Consistency, Isolation, Durability) Brewer's CAP theorem (Consistency, Availability and Partition tolerance) Mature Young Compelx queries Simple low level queries -
Advantage
SQL NoSQL Reliable data protection Fast and high performance Privilege and password security system Scalability Atomic transactions support Larege volume data Execellent support with developed community Fit for hierarchical data storage -
When to use
SQL NoSQL Need to ensure ACID compliancy - For high transactional based applications. Rapid development - Fit for agile development. Don't need to prepare data ahead of time.
MongoDB vs CouchDB

Redis
Redis is simple key-value in memory database with some data structures, therefore it can look up keys and return values very quickly.
According to the below article, Redis only needs 16MB to store one million key-value pairs. Expanding to 300 million keys, the total is just under 5GB.
Redis at Instagram (now switched to Cassandra from Redis): https://instagram-engineering.com/storing-hundreds-of-millions-of-simple-key-value-pairs-in-redis-1091ae80f74c
Data to store
-
room manager's data : id & password
-
room info : room id, manager id, creation date-> memory -
blacklist : user id-> memory -
...
The project's situation
-
There is only one data (room manager's data) to store yet.
-
Simple / small amount / changing data
-
Inexpensive hardware
-
Adopting agile methodology / Rapid development
-
Famililar with SQL and Redis, unfamiliar with NoSQL
Decision: undecided
Deciding between MongoDB and Redis.
本文对比了SQL与NoSQL数据库的主要区别,包括数据结构、扩展方式、预定义模式、数据类型、查询语言、ACID属性及CAP定理等。探讨了SQL数据库如MySQL、Oracle与NoSQL数据库如MongoDB、Cassandra的特性,并分析了Redis的高性能内存存储能力。
850

被折叠的 条评论
为什么被折叠?



