Google Cloud Platform 美西機房

Google Cloud 在七月的時候開放了美西機房:「Introducing Cloud Natural Language API, Speech API open beta and our West Coast region expansion」,而且東京機房也快開了:

And as we announced in March, Tokyo will be coming online later this year and we will announce more than 10 additional regions in 2017.

看到「Why we moved from Amazon Web Services to Google Cloud Platform?」的時候去找資料才發現的。這篇讓我重新算了一次成本,如果不計算 Bandwidth Cost 的話,GCE 整體的 f1-micro 記憶體 + 20GB 比 DigitalOcean 多 (不過 DO 給的是 SSD 就是了),而且還比較便宜啊...

不過如果把頻寬成本算進去,Internet Egress (i.e. Outbound bandwidth) 一定要走 Google Network,這點就比較傷了... 有美西機房後,看起來可以開始考慮用看看就是了 :o

看到 zmx 貼了之前的連結,更確信 Uber 的問題不是技術問題了...

Twitter 上看到 zmx 提了一個連結,講 Uber 年初時貼的「How We Built Uber Engineering’s Highest Query per Second Service Using Go」這篇文章的問題:

對照最近的事情還蠻有趣的,尤其是這篇文章後面提到的,酸~爆~了~XDDD:

It is clear to me that the team at Uber under-engineered this problem. Thoughtfully designing this service could trim down the number of nodes by an order of magnitude and save hundreds of thousands of dollars each year. That may sound like pittance to a company valued at more than the GDP of Delaware, but in my eyes that’s the salaries of a few engineers and a few good engineers can go a long way. Maybe even further than the few extra Mercedes-Benz S-Classes they could add to their fleet from the money they could be saving...

先不提政治問題,上面提到的 Quadtree 算是簡單易懂的結構,好久沒看到這個資料結構了:

Humble Bundle 對抗信用卡盜刷的方法

Humble Bundle 說明他們如何對抗信用卡盜刷的方法,主要是不斷的降低風險,然後讓人介入的機會降低 (因為人事成本很高):「How Humble Bundle stops online fraud」。

其中第一點是特別想提的:

Our first line of defense is a machine-learning-based anti-abuse startup called Sift Science, which we’ve been training for years across 55,000,000 transactions. Given how many orders we process, Sift Science has a really good idea when someone is up to no good. The model adapts daily as we get more data.

Sift Science 在 2014 的時候提過:「偵測信用卡交易是否為盜刷的服務」。做的事情很簡單,你把大量的資料傳給 Sift Science,包括了各種使用者身份資訊,以及信用卡資料,Sift Science 可以透過 Machine Learning 的方法告訴你這筆交易的風險,讓你進一步的判斷。

其實不少家都有做類似的服務,像是 MaxMindminFraud (就是做 GeoIP database 很有名的那家公司的另外一個產品)。當交易量很大的時候是個很有趣的應用,降低處理盜刷後續處理的成本。

CloudFlare 又增加一個亞洲的點:泰國曼谷

CloudFlare 又增加一個亞洲的 PoP 了,整個東南亞愈來愈密了:「Bangkok, Thailand: CloudFlare’s 79th Data Center」。

下一個亞洲的點會是越南嗎?另外美國的點一直都有點少 (相較於其他地區),不知道會不會加...

Amazon EBS 推出新磁碟種類

Amazon EBS 推出了新的磁碟種類,都是比現在更經濟 (白話文:更便宜) 的方案:「Amazon EBS Update – New Cold Storage and Throughput Options」。

第一種是 Amazon EBS Throughput Optimized HDD,代號是 st1;第二種是 Amazon EBS Cold HDD,代號是 sc1,兩種都是傳統磁頭硬碟。

第一種 st1 重視 sequential 的 throughput:

Starts at 250 MB/s for a 1 terabyte volume, and grows by 250 MB/s for every additional provisioned terabyte until reaching a maximum burst throughput of 500 MB/s.

第二種 sc1 則是重視堆資料的費用:

Designed for workloads similar to those for Throughput Optimized HDD that are accessed less frequently; $0.025 / gigabyte / month.

要注意的是,IOPS 是可以累計的,而未滿 1MB 的 access 會計算成 1MB,所以只適合大量 sequential access 的應用,像是 Hadoop 這類 big data 類的應用:

For both of the new magnetic volume types, the burst credit bucket can grow until it reaches the size of the volume. In other words, when a volume’s bucket is full, you can scan the entire volume at the burst rate. Each I/O request of 1 megabyte or less counts as 1 megabyte’s worth of credit. Sequential I/O operations are merged into larger ones where possible; this can increase throughput and maximizes the value of the burst credit bucket (to learn more about how the bucket operates, visit the Performance Burst Details section of my New SSD-Backed Elastic Block Storage post).

另外 sc1 也是目前每單位裡面最便宜的價錢,不知道拿來當 root 會底多慢 XDDD

Stripe 所提到的 TLS 1.1 不安全

Stripe 在宣佈要淘汰 TLS 1.0 與 TLS 1.1 的計畫公告中 (「Upgrading to SHA-2 and TLS 1.2」) 提到了:

Why SHA-1, TLS 1.0 and 1.1 are insecure

但在文章裡面還是沒有提到為什麼 TLS 1.1 不安全。

在維基百科的「Transport Layer Security」條目中試著找內容,發現應該是 Data integrity 這段,TLS 1.1 不支援 HMAC-SHA256/384 與 AEAD,只支援比較弱的 HMAC-MD5 或是 HMAC-SHA1。

Amazon S3 與 HDFS 的速度差異

作者繼續以 A Billion Taxi Rides 的資料測試各種差異,這次測了 Amazon S3HDFS 的速度差異:「A Billion Taxi Rides: AWS S3 versus HDFS」。

前半部都在說明測試的環境設定,重點在文章的最後面 (也就是「Benchmarking HDFS」這段),裡面有各種 query 的速度。HDFS 的速度大約是 Amazon S3 的 1.25 到 1.75 倍,作者給的結論是:

Though the speed improvements using HDFS are considerable, S3 did perform pretty well. At worst there's a 1.75x overhead in exchange for virtually unlimited scalability, 11 9's of durability and no worrying about over/under-provisioning storage space.

雖然 HDFS 比較快,但 Amazon S3 其實表現的不錯,另外資料安全性 (平均 99.999999999%,也就是 11 個 9 的 durability) 及不需要怕空間不夠的優點也是應該考慮進去的因素。

拍照後讓程式自動人肉搜索 Social Network 上的照片...

在 social network 上掃了一堆照片後,路上隨便拍照讓程式自動人肉搜索找出可能的對象:「Russian photographer matches random people with social network photos」。

這個計畫叫做「YOUR FACE IS BIG DATA」,作者的照片來源是來自俄羅斯最大的社交網站 VKontakte,而計畫的網站在「Конец анонимности: Идентификация случайных попутчиков」這邊,可以連進去看他自動找出來的圖。

演算法本身並不難,有種老大哥計畫的感覺... 可以想像 FacebookInstagram 或是 VKontakte 如果自己做了之後拿給政府單位用的情況?

Google BigQuery 提供的 Public Datasets

AWS 的「AWS Public Data Sets」一樣,Google Cloud Platform 也提供了類似的服務給使用 Google BigQuery 的人使用:「Google BigQuery Public Datasets」。

目前資料看起來比較少 (因為最近才建立),包括了這六個項目:

  • USA Names Data
  • NYC TLC Trips
  • Hacker News
  • USA Disease Data
  • GDELT Books Corpus
  • NOAA GSOD Weather

在「Other Public Datasets」的地方就是不寫 AWS 的... XD