Braintree (PayPal) 用 PostgreSQL 的方式

RDBMS 最困難的事情都圍繞在「怎麼不中斷服務」(很多事情在不用考慮 uptime/downtime 的前提下很好做,不論是 ALTER 或是 failover,到備份還原計畫),而 PayPalBraintree 在「PostgreSQL at Scale: Database Schema Changes Without Downtime」這邊討論修改 PostgreSQL 的 database schema 時怎麼不中斷服務。

文章內的大部份都是給 DBA 知道的細節 (e.g. 怎麼樣才不會觸發大規模的 lock 導致服務中斷),而不是開發者面向的事情... 但開頭的部份,也是我認為最重要的部份,則是需要 Developer 參與的:

For all code and database changes, we require that:

  • Live code and schemas be forward-compatible with updated code and schemas: this allows us to roll out deploys gradually across a fleet of application servers and database clusters.
  • New code and schemas be backward-compatible with live code and schemas: this allows us to roll back any change to the previous version in the event of unexpected errors.

為了符合這兩個要素,可能會在 schema 設計上有好幾個階段的操作,而非一次到位。而且也才能避免要關站從 backup 倒資料回來的情況...

建議可以研究看看要怎麼玩,常見的情境知道怎麼設計步驟後,真的遇到的時候會比較熟練。

PayPal 本家也要支援 Bitcoin

先前 PayPal 的分家 Braintree 宣佈支援 Bitcoin,而現在本家也宣佈要支援:「PayPal and Virtual Currency」,不過目前只是放話順便在北美試辦,速度還是慢了不少...

Bitcoin 交易不可逆的性質讓很多事情都改變了,接下來應該會愈來愈精彩...

PayPal 旗下的 Braintree 將支援 Bitcoin 貨幣

Bitcoin 的特性使得各家金流業者被逼著要支援,不然就等著在市場上被淘汰。

Stripe 的測試「Stripe: Bitcoin」表態後,龍頭 PayPal 也出手了:「Braintree Brings One Touch Payments to the People and Will Offer Bitcoin to Developers Soon」。

目前是跟 Coinbase 合作:

In addition we announced that Braintree has partnered with Coinbase to offer a trusted and secure way for people to pay with bitcoin across their favorite apps in the coming months.

GitHub 也接受 PayPal 付款了,不過不是直接接 PayPal...

GitHub 宣佈接受 PayPal 付款,不過不是直接接 PayPal 的 API,而是透過 Braintree 提供的 API:「Pay for GitHub with PayPal」。


GitHub 官方提供的 screenshot

雖然 PayPal 的風評大家都知道,但如果要支援 PayPal 最直接的方式還是接 PayPal API... 不直接使用 PayPal API 而要透過其他 API 的原因...?