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 技術手冊
將檔案視為你的資料儲存
|
157
與其相比,檔案能夠儲存任何型態的資料,不論是否有結構存在。
然而,這個彈性也導致在儲存或抓取資料時額外的成本。舉例來說,儘管人類看見
3.14159
時會認為它是個數字,但在檔案中的資料就只是一串字元。你必須要告訴你的
程式它是個數字,而這可能會造成額外的翻譯成本。類似的,你能夠藉由定義序列化程
序來將物件儲存在檔案中,但你便需要撰寫程式來將該資料反序列化。不論是對開發者
的時間來說還是對處理時間來說,這都是個負擔。除了這點之外,對一開始而言,檔案
能夠是出乎意料的有用。
資料損毀是本地的
若電腦突然關機,任何對資料庫的檔案的損毀都可能造成嚴重的混亂。對檔案的傷害通
常都只會在該檔案之中。此外,檔案系統很努力的防止電源損毀所可能造成的傷害(磁
碟控制器有時候會對檔案系統說謊,告訴它資料已經寫入磁碟,但其實還沒有完成。這
可能會造成問題,但這種狀況非常少見)。
檔案系統是非常聰明的。它們為你看顧許多事情。檔案系統比資料庫要能夠處理大小不
一的資料。資料庫並不喜歡大小變動非常大的 binary blob。通常來說,資料庫的關係
(也就是表格)會對類似大小的列作最佳化。這讓它們能夠最佳化搜尋策略以及其他的
功能。
舉例來說,日誌(journaling)是一個非常有用的功能,能夠確保發生事情的穩定性。它
們不太在乎資料型態,所有的東西就單純是位元組。
它們擁有很好的工具
當你使用一個資料庫系統時,你會想念內建在 OS 中,用來切割內容的強大工具。許多
這類的工具都經過嚴格的測試(經過數十年可能已經被執行過數十億次) ...
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