我以前也是 Hibernate expert 咧 (自稱)
不過用了幾年後就丟棄了… 現在變 JdbcTemplate expert 惹
唉,如果有仔細研究 Hibernate 的 source 就知道他們設計的真是精良,是非常懂物件導向和關聯式資料庫的人設計的,使用 Hibernate 也會讓你感覺到你是在處理物件的生命週期,而不是關聯式資料。
問題大概就是資料本身本來就不適合用物件導向解決吧,尤其是資料可能很巨量。物件導向它是強在 UI 元件…
讓我想到 cockroachdb 就看到 hackernews 上的 comment1 了
One of the big differences is that Spanner only uses SQL for read-only operations, with a custom API for writes. We use standard SQL for both reads and writes, which means we also work with major ORMs like GORM, SQLAlchemy, and Hibernate (docs should be live today or tomorrow). Spanner's custom write API will make it difficult to work with existing frameworks, or to convert an existing application to Spanner. Cloud Spanner only works on Google Cloud and is a black-box managed service. CockroachDB is open source and can be run on-prem or in any cloud on commodity hardware. (We don't offer CockroachDB as a service yet, but may in the future)
很扯...
- 支援 SQL select/join/subquery/index ...etc
- 不支援 DML (要用它的 client),猜測是目前只限於做 primary key 相關的 update
- 開一台 0.9 usd/hour,儲存和傳輸另外算錢
每一 instance 的能力 :
each Cloud Spanner node can provide up to 10,000 queries per second (QPS) of reads or 2000 QPS of writes (writing single rows at 1 KB data per row), and 2 TiB storage.
0.9 usd/hour 相當於 aws m4.4xlarge (16 core/64GB ram)