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 技術手冊
158
|
第十二章:當資料庫攻擊時:何時要堅持使用檔案的守則
檔案一定不是適合所有的狀況。它們適合使用在需要大量讀取、少數的修改以及僅需要
極少將資料轉換為代表型態的成本的狀況中。這些狀況包含了儲存記錄(如網站伺服器
記錄)、記錄事件、抓取的網頁、大型二進位資料以及感測器資料。
感測器資料並不會隨著時間改變。歷史記錄是固定的。因此,如同步多重寫入功能的需
求性則非常低。類似的狀況則包含了服務靜態網頁。動態網站,藉由一個靜態網站產生
器將其轉換為檔案,則能夠大大的增加服務的擴充性。
檔案的概念
使用檔案來當作資料儲存不全然是好的。在你完全使用檔案之前,必須要好好地考慮不
同的檔案型態、格式以及可能的問題。
編碼
編碼
是將 0 1 轉換為字元的標準。傳統的編碼,如 ASCII,會擁有一張翻譯表格,將
111100(以十進位表示則是 60)的位元序列轉換為大寫字母
A
。不幸的是,在一個
位元組之內只有 256 種位元序列。Unicode 增加了一些複雜度,但提供許多更彈性的東
西。其中一個 Unicode 的編碼,也就是 UTF-8,它的長度是變動的,並且能夠從補充的
位元組中,使用特定符號等資訊來支援註解。
文字檔案
文字檔案單純的就是遵守某個編碼的檔案。它們通常是可被列印的,人眼能夠讀取它們
的內容。
二進位資料
可以將它視為並沒有遵守某個已知的編碼表示文字的檔案。因此,二進位檔案的位元組
可能會包含可被印出的字元,但印出的文字通常會是亂碼。有些二進位格式需要特別的
工具,來將原始的位元組翻譯為有意義的表示。
記憶體對應的檔案 ...
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