数据库历史导读和笔记

原文:What goes around comes around pdf slides

TLDR

This is a history of data models, where the following eras are represented. There's an evolution of data models from complex hierarchical ones to simpler relational ones. CODASYL was a complex hierarchical model, which morphed into SQL, and then into XML (another hierarchical model). Evolutions in database models seem to be driven mostly by performance.

Hierarchical (IMS): late 1960’s and 1970’s
Network (CODASYL): 1970’s
Relational: 1970’s and early 1980’s
Entity-Relationship: 1970’s
Extended Relational: 1980’s
Semantic: late 1970’s and 1980’s
Object-oriented: late 1980’s and early 1990’s
Object-relational: late 1980’s and early 1990’s
Semi-structured (XML): late 1990’s to the present

Quotes

The debate between the XML advocates and the relational crowd bears a suspicious resemblance to the first “Great Debate” from a quarter of a century ago. A simple data model is being compared to a complex one.

The only ideas that got market traction were user-defined functions and user-defined access methods, and these were performance constructs not data model constructs.

Key Concepts

  • Logical data independence
  • Physical data independence
  • Semantic heterogeneity
  • Schema last
  • Schema first
  • Record at a time language

Guiding Questions

Why do people keep re-inventing a new "hierarchical" database (CODASYL, XML, JSON)?
How would we view the NoSQL movement and document stores in light of history?

Slightly more conceptual questions

What types of database use cases are B trees suited for and unsuited for, why?

  • Business transactions.
  • Geographic data. Better treated with quad trees or R trees.

What happened to the persistent programming language movement? How does this relate to the user-defined functions and access methods?

What does it mean that XML can "go through a firewall"? Do the same principles apply to JSON and REST? (I could also be overthinking this... as it might literally just mean that this stuff is easier to transmit between different computers).

Why did SQL become the de facto database standard?

Why is a "general purpose hierarchical data format" a bad idea?

Notes and Quotes

IMS

Takeaways

Lesson 1: Physical and logical data independence are highly desirable
Lesson 2: Tree structured data models are very restrictive
Lesson 3: It is a challenge to provide sophisticated logical reorganizations of tree
structured data
Lesson 4: A record-at-a-time user interface forces the programmer to do manual query optimization, and this is often hard.

Notes

  • Hierarchical data model (tree)
  • Record type: collection of named fields with associated datatypes.
  • Instance of record type obeys definition.
  • Each record type has a key (some subset of named fields).
  • Each record type has unique parent record key.
  • Each record has a hierarchical sequence key (concatenate keys of ancestors and key of current record).
  • Data manipulation language.

IMS supported four different storage formats for hierarchical data. Basically root records can either be:

  • Stored sequentially
  • Indexed in a B-tree using the key of the record
  • Hashed using the key of the record

Dependent records are found from the root using either

  • Physical sequentially
  • Various forms of pointers.

The ability of a data base application to continue to run, regardless of what tuning is
performed at the physical level will be called physical data independence.

IMS supports a certain level of logical data independence, because DL/1 is actually defined on a logical data base, not on the actual physical data base that is stored.

CODASYL

Takeaways

Lesson 5: Networks are more flexible than hierarchies but more complex
Lesson 6: Loading and recovering networks is more complex than hierarchies

Notes

  • Network data model. Not tree. Graph.
  • Record-at-a-time data manipulation language. Enters database at entry point, navigates via sets.
  • No physical data independence or logical data independence.
  • Trades increased complexity for the possibility of easily representing non-hierarchical data. CODASYL offers poorer logical and physical data independence than IMS.

Relational

Takeaways

Lesson 7: Set-a-time languages are good, regardless of the data model, since they offer much improved physical data independence.
Lesson 8: Logical data independence is easier with a simple data model than with a
complex one.
Lesson 9: Technical debates are usually settled by the elephants of the marketplace, and often for reasons that have little to do with the technology.
Lesson 10: Query optimizers can beat all but the best record-at-a-time DBMS application programmers.

Notes

  • Relational algebra
  • SQL Won due to:
    a) the success of the VAX
    b) the non-portability of CODASYL engines
    c) the complexity of IMS logical data bases

Entity-Relationship Model

Takeaways

Lesson 11: Functional dependencies are too difficult for mere mortals to understand.

Notes

  • Databases are collections of instances of entities.
  • Entities have attributes.
  • Entities have relationships with each other.
  • Do database design by constructing an initial collection of tables and then normalizing them.

First, real DBAs immediately asked “How do I get an initial set of tables?” Normalization theory had no answer to this important question. Second, and perhaps more serious, normalization theory was based on the concept of functional dependencies, and real world DBAs could not understand this construct.

R++

Takeaways

Lesson 12: Unless there is a big performance or functionality advantage, new constructs will go nowhere

Notes

  • In the 1980's, database papers looked like this:
    • Consider an application, call it X
    • Try to implement X on a relational DBMS
    • Show why the queries are difficult or why poor performance is observed
    • Add a new “feature” to the relational model to correct the problem
  • Here are the significant features that came up:
    • set-valued attributes
    • aggregation (tuple-reference as a data type): pointers instead of foreign keys. weird.
    • generalization: i.e. inheritance hierarchies

Semantic Data Model

Notes

  • Focus on classes and inheritance.
  • They failed because "they were a lot of machinery that was easy to simulate on relational systems".
  • Also offered no performance improvement.

OO (Object Oriented)

Takeaways

Lesson 13: Packages will not sell to users unless they are in “major pain”
Lesson 14: Persistent languages will go nowhere without the support of the programming language community.

Notes

To address the engineering market, an implementation of persistent C++ had the following requirements:

  1. no need for a declarative query language. All one needed was a way to reference large disk-based engineering objects in C++.
  2. no need for fancy transaction management. This market is largely one user-at-a-time processing large engineering objects. Rather, some sort of versioning system would be nice.
  3. The run-time system had to be competitive with conventional C++ when operating on the object. In this market, the performance of an algorithm using persistent C++ had to be competitive with that available from a custom load program and conventional C++

In our opinion, there are a number of reasons for this market failure.

  1. absence of leverage. The OODB vendors presented the customer with the opportunity to avoid writing a load program and an unload program. This is not a major service, and customers were not willing to pay big money for this feature.
  2. No standards. All of the OODB vendor offerings were incompatible.
  3. Relink the world. In anything changed, for example a C++ method that operated on persistent data, then all programs which used this method had to be relinked. This was a noticeable management problem.
  4. No programming language Esperanto. If your enterprise had a single application not written in C++ that needed to access persistent data, then you could not use one of the OODB products

What is the idea of a persistent programming language?

  • "one where the variables in the language could represent disk-based data as well as main memory data and where data base search criteria were also language constructs"
  • it requires the compiler for the programming language to be extended with DBMS-oriented functionality
    What does this mean?

O2 supported an object-oriented data model, but it was not C++. Also, they embedded a high level declarative language called OQL into a programming language. Hence, they proposed what amounted to a semantic data model with a declarative query language, but marketed it as an OODB.

Object-Relational

Takeaways

Lesson 14: The major benefits of OR is two-fold: putting code in the data base (and thereby blurring the distinction between code and data) and user-defined access methods.
Lesson 15: Widespread adoption of new technology requires either standards and/or an elephant pushing hard.

Notes

  • Motivated by storing geographic data. Searching for all points within a rectangle is a 2-dimensional search.
  • GIS queries are difficult to say in SQL and perform badly on B-Trees.
  • Basically the outcome of the whole OR era was better support for UDFs.
  • the OR proposal added user defined things to SQL: data types, operators, functions, access methods.

Semi Structured Data

Schema Last

  • This means having a self-describing schema.
  • semantic heterogeneity: information on a common object does not conform to a common representation; difficult for query processing as there is no structure on which to base indexing decisions.
  • designed for semi-structured data

XML Data Model

  1. XML records can be hierarchical, as in IMS
  2. XML records can have “links” (references to) other records, as in CODASYL, Gem and SDM
  3. XML records can have set-based attributes, as in SDM
  4. XML records can inherit from other records in several ways, as in SDM

Vocabulary

  • union types: an attribute in a record can be of one of a set of possible types
  • set-at-a-time query language
  • Logical data independence: The ability to change the logical (conceptual) schema without changing the External schema (User View) is called logical data independence.
  • Physical data independence: The ability to change the physical schema without changing the logical schema

Other resources

PostGres was originally created as a research project for geolocation data.
A comparison of SOAP vs. REST slides article

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,332评论 6 493
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,508评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,812评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,607评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,728评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,919评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,071评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,802评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,256评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,576评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,712评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,389评论 4 332
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,032评论 3 316
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,798评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,026评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,473评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,606评论 2 350

推荐阅读更多精彩内容

  • 这篇心得是从《精益数据分析》这本书得来的。 如果想看各渠道整体运营指标体系建设,看这篇 1、数据分析前你需要了解自...
    徐薇薇阅读 1,899评论 0 6
  • 把我喜欢的龙猫画歪了 继续努力
    独小爱阅读 135评论 1 1
  • 每日打卡2017年5月7日第8天 又是一个周末,回忆2天陪伴孩子的点点滴滴,数学成绩81,语文74,小伙子一定承受...
    海狸hl阅读 167评论 0 0
  • 记忆中的洛凡尘 神农与圣女一生的无奈,拓拔野前生与今世的情缘。树下野狐的《搜神传》中情与理的纠葛,令人迷醉其中,至...
    洛玄想阅读 208评论 0 2