Skip to Content
Bad Data 技術手冊
book

Bad Data 技術手冊

by Q. Ethan McCallum
September 2013
Intermediate to advanced
264 pages
5h
Chinese
GoTop Information, Inc.
Content preview from Bad Data 技術手冊
儲存圖形
|
171
我們不需要實體擁有不同的型態來表示頂點與邊。我們只需要在頂點上包含一個
type
的性質來表示該頂點代表什麼,舉例來說,可能是資產或是服務。我們能夠在邊上使用
標籤,來讓每個邊代表一個分配。我們能夠用邊上的性質來表示分配的百分比以及有效
的時間,也可以表示其他會有需要的性質。
現在我們只剩下頂點可以被分配給另一個頂點,而從在 ER 圖中的模型簡化的綱要則變
為如圖 13-3 所示。
Vertex
id:
name:
type:
Edge
label: allocated_to
id:
percentage:
eective_date:
13-3  ER 圖中的模型簡化
儲存圖形
當我們決定要使用圖形資料結構來為我們的領域建立模型時,我們必須決定要如何維持
資料。我們能夠繼續使用一個關聯式資料庫來表示圖形,也許是將分配的清單儲存成邊
的連接清單。然而,SQL 是一個集合導向的語言,用來表達圖形概念並不是它的強項。
不論綱要為何,使用 SQL 以及關聯式資料庫的技術來解決圖形問題,容易導致以關聯
式資料庫為後端的物件導向系統中,常見的阻抗不匹配(impedance mismatch)問題。
阻抗不匹配源自於電機領域,它是一個用來搭配來源與負載阻抗的程序,主要是用來將
功率最大化以及將在傳輸線中的訊號反射最小化。而物件—關聯的阻抗不匹配則是一個
譬喻,套用在當關聯式資料庫綱要(來源),跟如 Java 或是 Ruby(負載)等物件導向
程式語言中的目標物件模型不一致的狀況時。這時都會需要一個在兩者(訊號反射∕功 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

RxJava反应式编程

RxJava反应式编程

Tomasz Nurkiewicz, Ben Christensen
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald
Kubernetes编程

Kubernetes编程

Michael Hausenblas, Stefan Schimanski

Publisher Resources

ISBN: 9789862768952