PostgreSQL 9.2 出版...

PostgreSQL 9.2 放出來了:「PostgreSQL 9.2 released」。

其中一個重要的功能是直接支援 JSON 資料型態。之前看到「Building a MongoDB Clone in Postgres: Part 1」與「Building a MongoDB Clone in Postgres: Part 2」這兩篇,用 PostgreSQL 9.2 (當時還在 beta) 去堆 MongoDB 提供的功能。

另外一個對於效能會有幫助的新特性是 covering index,可以避免額外的 disk access。

推薦《An Introduction to Programming in Go》這本書...

書的資料:

An Introduction to Programming in Go.
Copyright © 2012 by Caleb Doxsey
ISBN: 978-1478355823

以及網站:「An Introduction to Programming in Go」。有平裝實體書版本,也有電子 Kindle 版,網站上有 PDF 可以下載,或是直接 HTML 觀看。我是看完 HTML 版後買了一本 Kindle 版來翻...

這是一本講程式語言 Go 的入門書。看完後,我覺得這不是寫給第一次接觸程式語言而需要自己學習的人。這本書的編排,以及 Go 程式語言的特性,是寫給想要用 C++ 解決 C 問題卻弄的滿頭包的人另外一個方案。語言的特性很明顯可以感覺到 Go 想要找出更自然 (以及「優雅」) 的方式解決問題。

第三章講資料型態提到內建了 uint8uint16uint32uint64int8int16int32 以及 int64,以及 byte == uint8rune == int32。以前需要透過 autotools 的類的程式處理,現在是程式語言直接定義好。

然後支援 float32float64,以及 complex64complex128 直接避免 sqrt(-1) 的問題!內建 boolean (truefalse),把以前的壞習慣 (直接拿數字型態判斷) 處理掉...

第六章講內建 Arrays、Slices、Maps,這時候就可以發現 fmt.Println 可以直接輸出 (以前 C 就沒辦法用 printf 大絕直接對 array 輸出!) !然後很嚴格的不讓你在整數與小數之間亂轉...

而內建 Maps 這件事情超重要,已經是現在程式語言的基本資料型態 XD

第七章描述 Functions,把以前只能傳單變數的問題解決,並且介紹 Closure,然後介紹 Defer!是 Defer 啊!(該死的 fd leak...)

第十章 Concurrency 把以前用 POSIX threading library 的痛給解掉,多個 thread 要怎麼有效的互相傳資料一直都是痛 (超痛),引入 channel 的觀念內建進 Go...

很推薦購買的一本書,天瓏如果有進的話應該會再去拿一本實體...

AWS CloudFront 的等級

在 CDN 報價時,會把歐美與非歐美區 (通常是指亞洲與澳洲) 的報價分開,主要是因為頻寬的成本不同。

不過亞洲客戶通常不會遇到這個問題,因為對方看你是亞洲客戶,第一份報價會直接使用亞洲區的報價,當你跟業務一直橋價錢,業務就有可能會跟跟你解釋這是因為亞洲區成本比較高 blah blah blah... 這時候業務就會拿出 US & EU only PoP 的報價單出來,如果你測過覺得 okay,那麼就搞定...

所以每次遇到 AWS 的業務被問到「你覺得 AWS 有什麼可以改善的?」幾乎都會提分級的事情,而從三年前 (應該吧) 就一直提的東西終於做出來了:「Amazon CloudFront - Cookie Support and More」。

現在 CloudFront 支援三種等級,Price Class All (預設等級,包含所有的 PoP),Price Class 200 (歐美、日本、香港、新加坡),以及 Price Class 100 (歐美),可以透過 Web Console 直接設定,接下來可以來觀察看看有哪些網站換掉 :p

拿掉 Blogger 的 Country Redirect

在台灣看 Blogger 時會被導到 blogspot.tw 網域,目的是為了要能夠支援 content filter,也就是「Why does my blog redirect to a country-specific URL? (ccTLD)」裡的這段:

Q: Why is this happening?
A: We are doing this to provide more support for managing content locally. If we receive a removal request that violates local law, that content may no longer be available to readers on local domains where those laws apply. This update is in line with our approach to free expression and controversial content, which hasn’t changed.

後來在 Chrome Web Store 上翻到可以透過 NCR 固定在 blogspot.com domain 上的方法了:「NoCountryRedirect (NCR)」,透過 /ncr 重導設定 NCR cookie...

伺服器的 BIOS 保護機制

NIST (National Institute of Standards and Technology) 是美國的政府機關 (國家標準技術研究所),訂定了非常多的標準。像是 DES 的制定 (NIST 前身,NBS - National Bureau of Standards) 與 AES 的選拔都是 NIST 的成果。

Slashdot 上看到 NIST 對於伺服器 BIOS 的保護機制提出建議:「NIST Publishes Draft Guidelines For Server BIOS Protection」,NIST 原始公告則是在「Security First: New NIST Guidelines on Securing BIOS for Servers」。都有原始 PDF 連結可以直接點。

BIOS Protection Guidelines for Servers ToC

標題是「BIOS Protection Guidelines for Servers」,目前還是在 draft 階段,頁數也還不太多...

找 CloudFront 問題的方法...

分別是 identity.cloudfront.netresolver-identity.cloudfront.net 的 TXT record,像是這樣:

;; QUESTION SECTION:
;identity.cloudfront.net.       IN      TXT

;; ANSWER SECTION:
identity.cloudfront.net. 60     IN      TXT     "ns-nrt52-02.cloudfront.net.nrt52"

以及:

;; QUESTION SECTION:
;resolver-identity.cloudfront.net. IN   TXT

;; ANSWER SECTION:
resolver-identity.cloudfront.net. 10 IN TXT     "210.242.135.97"

看起來是 AWS 在 forum 上回答時的 SOP 之一...

Amazon Web Services 新的儲存方案:Amazon Glacier

Amazon Simple Storage Service (Amazon S3)AWS 第一代儲存服務。後來 S3 又提供了 Reduced Redundancy Storage,降低可靠度 (一年 99.99%) 換取價錢上的優勢,用在 cache file 之類的還蠻不錯。目前兩者在美東的價錢是 USD$0.125/GB 與 USD$0.093/GB。這兩種都是隨時可以存取的服務。

Amazon Glacier 則是提供超低的價錢與超高的可靠度:USD$0.01/GB 與一年 99.999999999%,而這是靠取回檔案的時間換來的。取回檔案需要排 3.5 到 4.5 小時的時間 (後面傳輸的時間另外計算):

Retrieving archives from Amazon Glacier requires the initiation of a job. Jobs typically complete in 3.5 to 4.5 hours.

是靠著機械手臂與軌道在處理嗎?

但這樣就多了很多用途啊... Data warehouse 是個很明顯的方向。目前可以透過 AWS Import/Export 匯入大量資料:

You can also use AWS Import/Export to accelerate moving large amounts of data into Amazon Glacier using portable storage devices for transport.

之後則是會提供從 S3 搬出去與搬進去的功能:

In the coming months, Amazon Simple Storage Service (Amazon S3) plans to introduce an option that will allow you to seamlessly move data between Amazon S3 and Amazon Glacier using data lifecycle policies.

等工具完整後再來研究 :p