4. Realm is
SQL
SELECT user.name, user.email
FROM user
INNER JOIN shop ON user.id = shop.userid
INNER JOIN city ON user.cityid = city.id
WHERE user.name = 'the flash'
No-SQL
Realm.getA().getC().getF();
A
B C
D E F
G
X
Z
y
4
5. Realm is
SQLite
SELECT user.name, user.email
FROM user
INNER JOIN shop ON user.id = shop.userid
INNER JOIN city ON user.cityid = city.id
WHERE user.name = 'khac'
No-SQLite
Realm.getA().getC().getF();
A
B C
D E F
G
X
Z
y
5
26. Limitations
26
1. Class names: <= 57 letters*
2. Field names: <= 63 letters
3. Nest transactions -> not supported!
4. String & byte[] < 16Mb
*Realm auto append class_ at begin of class name
29. • Why do you choose Realm?
• Faster 5~10 times, especialy in write data
• Combine with ActiveAndroid
• Which data should be stored in Realm?
• The data need to be writen many times, ex: total
chats.
• Should remove ActiveAndroid to only play with Realm.
• Yes, it’s doesn’t complicated but ActiveAndroid has
value too.
• Easy to synchronize with data from server
• Yes, no problem
• Use for both Android & Ios?
• Yes
29
ChatWork
Ryutaro Miyashita
https://realm.io/users/chatwork/
33. Memory-mapped
33
Memory-mapped I/O uses the same address bus to
address both memory and I/O devices
CPU
RAM
Hard Disk
I/O
https://en.wikipedia.org/wiki/Memory-mapped_file
34. http://www.slideshare.net/jpountz/how-does-lucene-store-your-data
http://lemire.me/blog/2012/03/06/how-fast-is-bit-packing/
Bit-packing
34
• Efficient technique to store blocks of small ints
• Supports random access
• Special case: bits per value = 1 is a bit set
• Say you want to store
• 5 30 1 1 10 12
• Raw data: 6 * 32 = 192 bits
• Packed : 6 * 5 = 30 bits (84% size reduction!)
0000 0000 0000 0000 0000 0000 0000 0101 = 5
0000 0000 0000 0000 0000 0000 0001 1110 = 30
0000 0000 0000 0000 0000 0000 0000 0001 = 1
0000 0000 0000 0000 0000 0000 0000 0001 = 1
0000 0000 0000 0000 0000 0000 0000 1010 = 10
0000 0000 0000 0000 0000 0000 0000 1100 = 12