SQL && NoSQL
2015-09-23 15:44
330 查看
数据库 按照 一定规则保存 数据, 程序再发起 查询 取回所需的数据。
Web 程序 最常用基于 关系模型的数据库,这种 数据库 也称为 SQL 数据库, 因为使用结构化查询语言。
But in recent years document-oriented and key-value databases, informally known together
as NoSQL database, have become popular alternative.
SQL Databases && NoSQL Databases
Databases that do not follow the relational model described in the previous section are
collectively referred to as NoSQL databases.
One common organization for NoSQL databases uses collections instead of tables and
documents instead of records.
NoSQL databases are designed in a way that makes joins difficult, so most of them do not support
this operation at all.
ex :
For a NoSQL database structured as below, listing the users with their roles requires the application itself
to perform the join operation by reading the role_id field of each user and then searching the roles table for it
A more appropriate design for a NoSQL database is shown as below.
This is the result of applying an operation called denormalization, which reduces the number of tables
at the expense of data duplication.
A database with this structure has the role name explicitly stored each user.
Renaming a role can then turn out to be an expensive operation that may require updating a large number of number of documents
But it isnt all bad news with NoSQL databases.
Having the data duplicated allows for faster querying.
Listing users and their roles is traightforward because no joins are needed.
SQL or NoSQL
SQL 数据库 擅长于高效且紧凑的 形式存储结构化数据。 这种 SQL 数据库需要花费大量精力 保证数据的一致性。
NoSQL 数据库放宽了 对这种数据一致性的要求,从而 获得性能上的 优势。
对 中小型程序来说, SQL 和 NoSQL 数据库都是 很好的选择,且性能相当。
Web 程序 最常用基于 关系模型的数据库,这种 数据库 也称为 SQL 数据库, 因为使用结构化查询语言。
But in recent years document-oriented and key-value databases, informally known together
as NoSQL database, have become popular alternative.
SQL Databases && NoSQL Databases
Databases that do not follow the relational model described in the previous section are
collectively referred to as NoSQL databases.
One common organization for NoSQL databases uses collections instead of tables and
documents instead of records.
NoSQL databases are designed in a way that makes joins difficult, so most of them do not support
this operation at all.
ex :
For a NoSQL database structured as below, listing the users with their roles requires the application itself
to perform the join operation by reading the role_id field of each user and then searching the roles table for it
A more appropriate design for a NoSQL database is shown as below.
This is the result of applying an operation called denormalization, which reduces the number of tables
at the expense of data duplication.
A database with this structure has the role name explicitly stored each user.
Renaming a role can then turn out to be an expensive operation that may require updating a large number of number of documents
But it isnt all bad news with NoSQL databases.
Having the data duplicated allows for faster querying.
Listing users and their roles is traightforward because no joins are needed.
SQL or NoSQL
SQL 数据库 擅长于高效且紧凑的 形式存储结构化数据。 这种 SQL 数据库需要花费大量精力 保证数据的一致性。
NoSQL 数据库放宽了 对这种数据一致性的要求,从而 获得性能上的 优势。
对 中小型程序来说, SQL 和 NoSQL 数据库都是 很好的选择,且性能相当。
相关文章推荐
- redis
- sql sever 2008修改数据类型
- oracle数据库,mybatise批量插入数据
- 【MongoDB初识】-安装篇
- SQLSERVER 备份还原1
- SQL语句创建数据库及表
- SQL server 2008
- Oracle 定时执行计划任务
- 提高sql语句执行效率及索引
- 数据库锁机制
- sql hql 查询
- keepalive 配合mysql主主复制
- mysql 的REPLAYCE语句
- 解决mysql中文乱码(总)
- 开发人员常用的mysql图形管理工具
- django models进行数据库增删查改
- keepalive 配合mysql主主复制
- plsql执行计划介绍
- 学习Oracle数据库入门到精通教程资料合集
- DB2数据库备份恢复