0
点赞
收藏
分享

微信扫一扫

RabbitMQ--04--Spring Cloud Stream(消息驱动)

东言肆语 03-22 08:00 阅读 3

Relational V.S. NoSQL • Recap — Relational DBMS software has worked very well for many decades — Companies have invested lots of money in software built upon relational DBMS infrastructure — Companies have invested in staff/talent skilled in RDBMS technologies • But... — RDBMS systems struggle to scale to support Big Data’s volume, variety, and velocity demands — Big Data is exploding faster than RDBMS technologies can handle RDBMS 系统难以扩展以支持大数据的数量、种类和速度需求 - 大数据的爆炸式增长速度超过了 RDBMS 技术所能处理的速度

Relational V.S. NoSQL NoSQL (“Not Only SQL”) • Uses Clusters: — Distribute the Data via Replication & Sharding — Distribute the Processing Across Multiple Nodes in a Cluster • Uses Replication to provide — Redundancy — High Availability — Parallel Processing • VERY Horizontally scalable  NoSQL- 使用集群: - 通过复制和分片来分发数据 - 在集群中的多个节点上分发处理 - 使用复制来提供 - 冗余 - 高可用性 - 并行处理 - 极高的横向扩展性

NoSQL (“Not Only SQL”) • Requires Less Structure: — Does not store data in tables with rigid row/column structure — Uses an “Aggregate” model (very de-normalized) • Restricts join capabilities • Relaxes ACID transaction compliance • May use a non-SQL query language • Typically open-source, very low-cost software acquisition--要求较少的结构:--不在具有严格行/列结构的表中存储数据--使用 "聚合 "模型(非常去规范化)--限制连接功能--放宽 ACID 事务合规性--可使用非 SQL 查询语言--通常是开源的,获取软件的成本非常低

Relational V.S. NoSQL Relational • Schema defines rigid structure — Tables, Rows, Columns • Foreign Key relationships enable joins • Uses SQL language • Maintains ACID transaction compliance • Normalized: store a value only once • Clustering available (but challenging) • Leading DBMS solutions are quite expensive NoSQL • Stores related values in aggregates • Flexible structure: — Ranges from none to some • No joins • Uses alternate query language • Relaxed ACID compliance • Data is De-normalized • Designed to support clustering, replication, sharding • Almost all players are open source and low-cost  Relational - 模式定义了严格的结构 - 表、行、列 - 外键关系实现了连接 - 使用 SQL 语言 - 保持 ACID 事务合规性 - 标准化:一个值只存储一次 - 可用集群(但具有挑战性) - 领先的 DBMS 解决方案相当昂贵 NoSQL - 在聚合中存储相关值 - 结构灵活: - 范围从无到有 - 无连接 - 使用替代查询语言 - 放宽 ACID 合规性 - 数据去规范化 - 设计用于支持集群、复制、分片 - 几乎所有参与者都是开源和低成本的

NoSQL Database Models The “Aggregate” Data Model • RDBMS requires Tables, Rows, Columns as data stores — Columns have “domains” of values — Third normal form – no multi-values, “store it once” • NoSQL systems use AGGREGATES as data stores — Data values are grouped together as users need them — Think of an unnormalized document, or an “object” — Contains related values that are retrieved and manipulated together NoSQL 数据库模型 "聚合 "数据模型 - RDBMS 需要将表、行、列作为数据存储 - 列具有值的 "域"- 第三正则表达式 - 没有多值,"一次存储" - NoSQL 系统使用 AGGREGATES 作为数据存储 - 根据用户需要将数据值分组 - 想想未规范化的文档或 "对象"- 包含可一起检索和操作的相关值daee1394d6074149bdf178153fb95a58.png

NoSQL Database Models • Aggregates are conceptually the opposite of 3rd Normal Form • Why aggregates? — It is difficult to spread a relational model across nodes in a cluster ◦ Replication and sharding introduce big challenges in consistency — Each query should minimize the number of nodes being accessed across the cluster — Data values that are accessed together should live on the same node NoSQL 数据库模型 - 在概念上,聚合与第三正则表达式相反 - 为什么是聚合? - 复制和分片会给一致性带来巨大挑战 - 每个查询都应尽量减少整个集群中被访问的节点数量 - 一起被访问的数据值应位于同一节点上 - 每个查询都应尽量减少整个集群中被访问的节点数量 - 每个查询都应尽量减少整个集群中被访问的节点数量 - 每个查询都应尽量减少整个集群中被访问的节点数量 - 一起被访问的数据值应位于同一节点上

NoSQL Database Models • Document Database — Organized around a “document” containing text — Can handle very large data volumes — Provides Speed and Scalability — Document format is easily understood by humans — No “schema”, but JSON/XML provides internal structure within a document — Documents are indexed and stored within “collections” — Supports full text search • Popular Implementations (Open-source) — MongoDB — CouchDBNoSQL 数据库模型 - 文档数据库 Document Database- 围绕包含文本的 "文档 "组织 - 可处理超大数据量 - 提供速度和可扩展性 - 文档格式易于人类理解 - 无 "模式",但 JSON/XML 提供文档内部结构 - 文档被索引并存储在 "集合 "中 - 支持全文搜索 - 流行实现(开源) - MongoDB - CouchDB

Sample Document • JSON (Java Script Object Notation) • Key:Value pairs provide some structure • One primary key per document • Not all documents must have the same key:value pairs  JSON(Java 脚本对象符号) - 键:值对提供了一些结构 - 每个文档只有一个主键 - 并非所有文档都必须有相同的键:值对

9c5a1a1a007745f78d56e35559c172da.png

Sample Document • XML (Extended Markup Language) • Tag:Value pairs provide some structure XML(扩展标记语言) - 标记:值对提供了一些结构a35033ad95f94456a7c54bc30035f4b9.pngDocument Database • Keeps related information together (not normalized into tables) • Access to a document is fast (index/key/URL) • ACID compliance is maintained only within a document • Cannot “join” across documents • Documents are kept in “collections” 将相关信息保存在一起(不规范化为表) - 快速访问文档(索引/键/URL) - 仅在文档内保持 ACID 合规性 - 不能跨文档 "连接" - 文档保存在 "集合 "中

• Graph Database — Uses a graph structure consisting of ◦ Nodes – Represents an entity (like a person) ◦ Edges – Represents a relationship between entities ◦ Properties – Attributes associated with Nodes and Edges ◦ 节点 - 代表实体(如人) ◦ 边 - 代表实体之间的关系 ◦ 属性 - 与节点和边相关联的属性 — Supports navigation along edges from a starting point node 支持从起点节点沿边导航 — Designed for applications tracking the inter-connections among entities设计用于跟踪实体之间相互联系的应用 ◦ Who is friends with whom? (In a social network application) ◦ Who is following me, who am I following? — Uses a pattern matching query language to navigate nodes & edges • Popular Implementations (open source)- 使用模式匹配查询语言导航节点和边 - 流行的实现(开源) — Neo4j

Sample Graph: • Nodes (with Properties) • Edges (with Properties) • Key:Value Pairs provide some structure 节点(带属性) - 边(带属性) - 键:值对提供一些结构5d545c0f8f544ca08ca24aa077686cea.png

• Key:Value Pairs Database — “Schemaless” – no structure — Maps a key to an opaque value (That is, the database doesn’t understand anything within the value) — Simple query operations (put, get, remove, modify) — Keys are unique in a collection — May be a building block for other data models (such as key:value pairs within a document or a graph) 键:值对数据库--"无模式"--无结构--将键映射到不透明值(即数据库不理解值中的任何内容)--简单的查询操作(放入、获取、移除、修改)--键在集合中是唯一的--可作为其他数据模型(如文档或图中的键:值对)的构建模块• Popular Implementations — Amazon Dynamo (available via AWS in the cloud) — Redis (Open-source)流行实现--Amazon Dynamo(可通过 AWS 在云中使用)--Redis(开源)

Sample Key:Value aggregate • One primary key • Each attribute has a key and a value • May store multiple values in an array • Key:Value Pairs provice some structure • Not all documents will have the same key:value pairs键:值集合示例 - 一个主键 - 每个属性都有一个键和一个值 - 可以在数组中存储多个值 - 键:值对提供了一些结构 - 并非所有文档都有相同的键:值对2149b9aa53e74cae85a35e223a7674a1.png

Key-Value Pairs Database Example (Amazon DynamoDB) • The primary key value (Id) is 207 • Most of the attributes have simple data types, such as String, Number, Boolean and Null • One attribute (Color) is a String Set in an array  - 主键值(Id)为 207 - 大多数属性的数据类型都很简单,如字符串、数字、布尔和空 - 一个属性(颜色)是数组中的字符串集• The following attributes are document data types: — A List of Related Items. Each element is an Id for a related product — A Map of Pictures. Each element is a short description of a picture, along with a URL for the corresponding image file 以下属性是文档数据类型: - 相关项目列表。每个元素都是相关产品的 ID - 图片地图。每个元素都是图片的简短描述,以及相应图片文件的 URL

• Wide-Column (Column Family) Store Database — A TWO-LEVEL aggregate — Data is stored within “collections” of dynamic related columns — Similar to key:value with the pairs having columnar structure- 宽列(列族)存储数据库 - 双层聚合 - 数据存储在动态相关列的 "集合 "中 - 类似于 key:value,数据对具有列式结构 • Based on Google’s “Big Table” • Popular Implementations (Open-source) — Cassandra — HBase 基于 Google 的 "大表" - 流行的实现(开源) - Cassandra - HBase

Wide-Column (Column Family) Store Database宽列(列族)存储数据库  • The first key is the row-key — The entire row is an aggregate of related data — The row consists of many key-value pairs (“columns”) 第一个键是行键 - 整个行是相关数据的集合 - 行由许多键值对("列")组成 • The second key is the column family — Each column family consists of sparse key:value pairs ◦ “Sparse” means the column value isn’t stored if it isn’t needed第二个键是列族 - 每个列族由稀疏的键:值对组成 ◦ "Sparse "意味着如果不需要列值,就不存储它f85917a7e67b4e839fa787cafd18bbd7.pngBenefits of a Wide Column Store • Lookup of a row by the row key will be very fast • In a distributed cluster system, the complete row is stored on a single node • A row may be stored redundantly across the cluster • A row can be retrieved with one access • Massively scalable – can scale to very large capacity with high availability • The columns are ”sparse” — That is, a column with no value is not stored宽列存储的优势 - 通过行键查找行的速度非常快 - 在分布式集群系统中,完整的行存储在单个节点上 - 行可能在整个集群中冗余存储 - 只需一次访问即可检索行 - 大规模可扩展性 - 可以扩展到非常大的容量,同时具有高可用性 - 列是 "sparse "的 - 即不存储无值列

Issues with a Wide Column Store • The data model is complex, and not very intuitive • Generally, you create your data model based on your users’ queries — The aggregation matches your users’ query needs — Possibly taking into account how data is distributed across the cluster — A new query type might require a new data store数据模型很复杂,而且不太直观 - 一般来说,您需要根据用户的查询创建数据模型 - 聚合符合用户的查询需求 - 可能要考虑数据在集群中的分布情况 - 新的查询类型可能需要新的数据存储空间

In Summary: • NoSQL Database Software can be adopted to allow organizations to better handle Big Data • Four types of NoSQL databases: — Document — Graph — Key:Values Pairs — Wide Columnar 采用 NoSQL 数据库软件可使企业更好地处理大数据 - NoSQL 数据库的四种类型: - 文档 - 图表 - 键:值对 - 宽列式数据库

 

举报

相关推荐

0 条评论