12. start DynamoDB local
$curl localhost:8000
{
"__type":"com.amazonaws.dynamodb.v20120810#MissingAuthenticationToken",
"message":"Request must contain either a valid (registered) AWS access key ID or X.509 certificate."
}
または、http://localhost:8000/shell/
Hamamatsu.rb, @jacoyutorius 12
17. table
class Music
set_table_name :Music
string_attr :artist, hash_key: true
string_attr :song_title, range_key: true
string_attr :album_title
end
4 artistをハッシュキー、song_titleをソートキー。
4 2つの値でレコードを一意に識別する。
Hamamatsu.rb, @jacoyutorius 17
18. Artist
id name
1 AJICO
2 Bill Evans
3 Cream
class Artist
set_table_name :Artist
integer_attr :id, hash_key: true
string_attr :name
end
Hamamatsu.rb, @jacoyutorius 18
19. Album
artist title
AJICO AJICO SHOW
Bill Evans Portrait in JAZZ
Bill Evans Waltz for Debby
Cream BBC Sessions
class Album
set_table_name :Album
string_attr :artist, hash_key: true
string_attr :title, range_key: true
end
Hamamatsu.rb, @jacoyutorius 19
20. Song
artist song_title album_title
Bill Evans Waltz for Debby Waltz for Debby
Bill Evans Detour Ahead Waltz for Debby
Bill Evans Autumn Leaves Portrait in JAZZ
class Song
set_table_name :Song
string_attr :artist, hash_key: true
string_attr :song_title, range_key: true
string_attr :album_title
end
Hamamatsu.rb, @jacoyutorius 20