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 difficultso 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 数据库都是 很好的选择,且性能相当。
 

转载于:https://www.cnblogs.com/beyond-Acm/p/4832482.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值