スティルハウスの書庫の書庫

はてなダイアリーで書いてた「スティルハウスの書庫」を移転してきました。

GAEのDatastore解説ビデオを見たメモ

http://sites.google.com/site/io/under-the-covers-of-the-google-app-engine-datastore

このビデオを見たときのメモ(気になったポイントだけ):

  • scan: 2 types of scan
    • prefix scan
    • range scan
      • Bigtableはscanがミソ、というかscanしかできない)
  • entity table
    • we basically have one column in the entity table that stores every single entity serialized down to the single ???
    • we dont do much, in terms of quering, filtering and sorting in the entity table
      • (queryはすべてindex頼りだから当然か)
    • primary key は変更できない
  • query
    • 0:16:20 bigtable doesnt let you use any high level operations: gt, lt, eq, sort, that kind of thing. all you can is scan. So we need to convert queries to scan. ... we dont wanna filter in memory, we dont wanna sort in memory. ... we dont know how many results are coming back.
      • (あえてメモリを使わないのはスケールするためのコツですね。。というかメインフレームみたいだ)
    • 0:17:28 The goal of the queries and the app engine datastore is, convert GQL queries or programatic queries build up to index scan
    • 0:20:50 We have two single property index: one that stores property values in ascending order,
      • (indexにすごく依存してますが、index容量が増えてもそれには課金したくないそうです)
      • (indexのscan結果のマージもしてるらしいけど、それもメモリじゃなくてディスクに書き出しているのか? やっぱりメインフレームだ。情報処理試験みたい)
    • 0:40:20 There's a way to do string prefix query... WHERE name >= 'A' AND name < 'Ax' xはUTF-8コードポイントの最大数
      • (なんか泥臭いぞ)
  • transaction
    • すべてoptimistic locking。ロックは使わない。パフォーマンスは高いがretryが必要。
    • root entityでentity group全体のcommitted/journalを管理する
      • (entity groupは1台のサーバーに集約されているらしいから、複数のentity groupにまたがる分散txは実装してないということか? そんなオヤジくさいことしてないだろうな)