Delicious 轉移到實體機器上...

在「Pinboard 收購 Delicious」這邊提到了 Pinboard 買下 Delicious 的事情,而剛剛在 Twitter 上看到費用:

順便打算把機器從 Linode 轉到實體機器上,原來 Delicious 之前在 Linode 上的費用也不怎麼便宜... (不過現在看起來還是放在 Linode 上面)

有量而且沒什麼變動的服務用實體機器的成本會低不少...

MySQL 上 Replication 的方案

Percona 的人整理了一篇關於 Replication 的方案 (以及 NDB,不過這邊就先偷偷跳過去...),雖然標題寫的是 High Availability:「The MySQL High Availability Landscape in 2017 (The Elders)」。

先講他給的另外兩個方案,一個是 Shared Storage,另外一個是 NDB。

其中 Shared Storage 其實在儲存空間端還是有單點失效的問題,而 NDB 的特性跟 InnoDB 不同,有很多概念要重新學... 如果就這三個比較,常見的還是第一個提到的 Replication。

其實把 Replication 用熟的話已經可以解決不少問題了 (不論是早期的 MMM,或是 MHA)。而且因為技術已經發展很久了,大家幾乎都很熟特性 (以及 bug XD),網路上可以找到不少資料,甚至 Percona 也都能夠支援 (當你願意付錢的時候 XDDD)。

AWS 香港區 2018 開台

業界這幾個月也傳的頗盛的消息總算也公開了。AWS 預定在 2018 年開香港區:「In the Works – AWS Region in Hong Kong」。

Today, I am happy to be able to tell you that we are planning to open up an AWS Region in Hong Kong, in 2018.

不過 HiNet 對香港的頻寬一直是個痛 (塞翻了),反倒是到日本的頻寬還比較順。明年上線後可以觀察看看 XDDD

另外日本有稅的問題,單價比起亞洲其他點高不少 (與新加坡比起來蠻明顯的)。香港的價錢不知道會怎麼算,雖然稅可能比較低 (maybe),但畢竟是一個沒什麼土地的地區,會不會在機器成本上其實也補回來不少...

然後再來是代碼,應該會是 ap-southeast-3

在 Production 上惡搞 PostgreSQL,建立一千萬筆 Index...

在「Running 10 Million PostgreSQL Indexes In Production (And Counting)」這邊看到 Heap 他們在 PostgreSQL 上惡搞的方式。

為了效能,所以在上面建立了大量的 Partial index。像是這樣的條件 (所以其實每個都不算太大):

CREATE INDEX ON events (time) WHERE type = ‘click’ AND text = ‘login’

要注意的是 MySQL 的 Partial index 其實是 prefix index,用以減少 index 的空間要求,這在 VARCHAR(255) 以及 MD5 後的欄位還蠻有幫助的。而 PostgreSQL 的 Partial index 則是指條件式,兩者不太一樣。

不過他們還是有遇到「建立 index」這件事情的效能問題 (以及 workaround 的方式)。

不太常看到這樣惡搞,看到這篇的時候在電腦前笑的頗開心的 XDDD

對純文字格式的推廣

在「The future of education is plain text」這邊看到對純文字格式的推廣 XDDD

作者提出了五點:

  • Plain text is always compatible
  • Plain text is easy to mix and match
  • Plain text is easy to maintain
  • Plain text is lightweight
  • Plain text is always forward compatible

是沒錯啦,把力氣專注在內容本身,而不是一堆格式上...

這讓我想起 George R. R. MartinConan 上提到他是用 WordStar 4.0 寫《冰與火之歌》的採訪片段:

又一篇戰文:討論 TDD 的過程

最近在 39th International Conference on Software Engineering 上受邀參加說明的論文,在 The Morning Paper 上看到的:「A dissection of the test-driven development process: does it really matter to test-first or test-last?」。

論文本身在「A Dissection of the Test-Driven Development Process: Does It Really Matter to Test-First or to Test-Last?」這邊可以下載,是去年 2016 就發出來的論文。

論文拆解 TDD 的行為,分析到底是哪些階段才是有正面幫助的:

Background: Test-driven development (TDD) is a technique that repeats short coding cycles interleaved with testing. The developer first writes a unit test for the desired functionality, followed by the necessary production code, and refactors the code. Many empirical studies neglect unique process characteristics related to TDD iterative nature. Aim: We formulate four process characteristic: sequencing, granularity, uniformity, and refactoring effort. We investigate how these characteristics impact quality and productivity in TDD and related variations. Method: We analyzed 82 data points collected from 39 professionals, each capturing the process used while performing a specific development task. We built regression models to assess the impact of process characteristics on quality and productivity. Quality was measured by functional correctness.

比較特別的是作者指出 refactoring 的負面效果:

Result: Quality and productivity improvements were primarily positively associated with the granularity and uniformity. Sequencing, the order in which test and production code are written, had no important influence. Refactoring effort was negatively associated with both outcomes. We explain the unexpected negative correlation with quality by possible prevalence of mixed refactoring. Conclusion: The claimed benefits of TDD may not be due to its distinctive test-first dynamic, but rather due to the fact that TDD-like processes encourage fine-grained, steady steps that improve focus and flow.

在 The Morning Paper 上的註解也可以看看 (反駁論文的意見),像是對論文使用自評系統的批評。

AWS Batch 在東京區可以用了

AWS Batch 支援東京區了:「AWS Batch is Now Available in Tokyo」。

總算是在東京出現了... 在 FAQ 裡面有提到:

AWS Batch uses Amazon ECS to execute containerized jobs and therefore requires the ECS Agent to be installed on compute resources within your AWS Batch Compute Environments. The ECS Agent is pre-installed in Managed Compute Environments.

開起來測一些東西看看...

Amazon Aurora 可以 clone 了...

Amazon Aurora 可以 clone 複製資料庫了:「Amazon Aurora Introduces Database Cloning Capabilities」。

而且是 COW 架構 (Copy on write),所以複製出來的部份不需要額外付儲存費用,只有修改的部份才要付費,這點相當殺啊:

A cloning operation does not incur any storage charges. You will only be charged for additional storage space if you make data changes.

這對於「測試」這件事情變出不少變化可以用...

官方支援 DynamoDB 的 Auto Scaling 了

DynamoDB 可以透過 console 或是 API 調整 R/W 的 capacity,但一直都沒有全自動的機制這件事情為人詬病頗久。

以前都是自己用 AWS Lambda 或是其他架構判斷調整,現在官方直接提供了:「New – Auto Scaling for Amazon DynamoDB」。

終於啊...