• 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 数据库都是 很好的选择,且性能相当。
     
  • 相关阅读:
    Flask-1-05-Cookie&Session
    Flask-1-05-Response
    Flask-1-04-Request
    Python3 装饰器无参有参 Egon老师视频
    python魔法方法、构造函数、序列与映射、迭代器、生成器---python基础教程
    Python3(廖雪峰教程) 链接
    Python面向对象之私有属性和方法(转载)
    python3 isinstance
    生成器 讲得不错的帖子
    Python3 pickle模块
  • 原文地址:https://www.cnblogs.com/beyond-Acm/p/4832482.html
Copyright © 2020-2023  润新知