On UnQLite
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

On UnQLite

  • 3,560 views
Uploaded on

Presented at Kyoto.pm Tech Talk #5

Presented at Kyoto.pm Tech Talk #5

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
3,560
On Slideshare
3,547
From Embeds
13
Number of Embeds
1

Actions

Shares
Downloads
5
Comments
0
Likes
1

Embeds 13

https://twitter.com 13

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. On UnQLite Kenichi Ishigaki (@charsbar) Kyoto.pm #5 Jul 13, 2013
  • 2. http://blog.64p.org/entry/2013/07/05/155212
  • 3. UnQLite = Not SQLite
  • 4. What's Different • Key/Value Store • Document Store (JSON) • License (2-Clause BSD)
  • 5. What's Similar • Self-contained • Cross Platform
  • 6. Suitable For Toolchains
  • 7. Usage: Like A Hash tie my %hash, 'UnQLite', 'foo.db'; $hash{foo} = 'bar'; print $hash{foo};
  • 8. Usage: OOPs my $db = UnQLite->open('foo.db'); $db->kv_store(foo => 'bar'); my $v = $db->kv_fetch('foo');
  • 9. Usage: Iteration my $db = UnQLite->open('foo.db'); my $cursor = $db->cursor_init; while($cursor->next_entry && $cursor->valid_entry) { my ($key, $data) = ($cursor->key, $cursor->data); ... }
  • 10. JSON... only for Jx9 my $db = UnQLite->open(':memory:'); $db->exec(<<'JX9'); db_exists('foo') || db_create('foo'); db_store('foo', [{bar: 'baz'}]) || print db_errlog(); print db_fetch('foo');# {"bar":"baz","__id":0} JX9 say dump $db->kv_fetch('foo'); # ?????
  • 11. Performance
  • 12. $ perl bench.pl --perl --bdb --sqlite 100 10000 (store) Rate sql bdb_hs bdb_bt unq kc unq_m perl sql 23.5/s -- -10% -19% -22% -41% -80% -86% bdb_hs 26.1/s 11% -- -10% -13% -35% -78% -85% bdb_bt 29.0/s 23% 11% -- -4% -28% -75% -83% unq 30.1/s 28% 15% 4% -- -25% -74% -83% kc 40.2/s 71% 54% 39% 33% -- -66% -77% unq_m 118/s 400% 351% 306% 291% 193% -- -32% perl 172/s 633% 560% 495% 472% 329% 47% --
  • 13. $ perl bench.pl --perl --bdb --sqlite 10 100000 (store) Rate bdb_hs sql unq bdb_bt kc perl unq_m bdb_hs 1.14/s -- -53% -57% -60% -81% -89% -89% sql 2.43/s 114% -- -8% -15% -59% -76% -77% unq 2.65/s 133% 9% -- -7% -55% -74% -75% bdb_bt 2.87/s 152% 18% 8% -- -52% -72% -73% kc 5.95/s 424% 145% 124% 108% -- -42% -44% perl 10.2/s 798% 320% 285% 256% 71% -- -4% unq_m 10.6/s 836% 338% 301% 271% 79% 4% --
  • 14. $ perl bench.pl --perl --bdb --sqlite 10 1000000 (store) s/iter bdb_hs unq sql bdb_bt unq_m kc perl bdb_hs 10.7 -- -32% -61% -65% -81% -83% -87% unq 7.29 47% -- -43% -49% -72% -76% -81% sql 4.17 158% 75% -- -10% -51% -57% -67% bdb_bt 3.74 187% 95% 12% -- -45% -52% -63% unq_m 2.04 426% 257% 104% 83% -- -13% -32% kc 1.78 502% 309% 134% 110% 14% -- -22% perl 1.40 669% 423% 199% 168% 46% 28% --
  • 15. $ perl bench.pl --perl --bdb --sqlite 10 10000000 (store) s/iter unq_m bdb_hs unq kc sql bdb_bt perl unq_m 184 -- -38% -51% -67% -77% -78% -91% bdb_hs 114 62% -- -20% -46% -62% -64% -85% unq 91.0 103% 25% -- -33% -53% -55% -82% kc 61.3 201% 86% 48% -- -30% -33% -73% sql 43.1 328% 164% 111% 42% -- -5% -61% bdb_bt 40.9 350% 178% 122% 50% 5% -- -59% perl 16.6 1008% 584% 447% 268% 159% 146% --
  • 16. $ perl bench.pl --bdb 100 10000 (fetch) Rate bdb_bt unq bdb_hs kc bdb_bt 40.0/s -- -5% -8% -23% unq 42.2/s 5% -- -3% -19% bdb_hs 43.7/s 9% 3% -- -16% kc 52.1/s 30% 23% 19% --
  • 17. $ perl bench.pl --bdb 10 100000 (fetch) Rate bdb_hs bdb_bt unq kc bdb_hs 2.21/s -- -39% -43% -59% bdb_bt 3.60/s 63% -- -7% -33% unq 3.88/s 76% 8% -- -28% kc 5.41/s 145% 50% 39% --
  • 18. $ perl bench.pl --bdb 10 1000000 (fetch) s/iter bdb_hs unq bdb_bt kc bdb_hs 4.94 -- -26% -40% -61% unq 3.67 35% -- -19% -48% bdb_bt 2.97 67% 24% -- -35% kc 1.92 158% 92% 55% --
  • 19. $ perl bench.pl --bdb 10 10000000 s/iter bdb_hs unq kc bdb_bt bdb_hs 53.2 -- -15% -20% -37% unq 45.0 18% -- -6% -26% kc 42.5 25% 6% -- -22% bdb_bt 33.3 60% 35% 28% --
  • 20. New storage engines are coming soon(?)
  • 21. Further Information http://unqlite.org https://github.com/tokuhirom/UnQLite