Riak at Kivra

2,046 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,046
On SlideShare
0
From Embeds
0
Number of Embeds
1,216
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Riak at Kivra

  1. 1. RIAK at KIVRABip Thelin@bipthelin
  2. 2. BIP THELIN CTO & Co-founder OO / SQL-background Open Source / Tomcat Committer Scalable platforms / Hosting Beer Homebrewer / Judge
  3. 3. API / Delivery serviceContent compositionContent creationDigital mailbox
  4. 4. ResponsiveWebiOS App
  5. 5. z zState machine y xInternal, External & c aTime Events b p f dHard to test / debug qError prone g eHardcoded flow rNo overview e i t u
  6. 6. Weoutgrew our system
  7. 7. QUOTE: Marriage is a wonderful institution, but who wants to live in an 24 / 7 / 365 institution? SECURE / Stable TESTABLE / OPERATIONAL Distributable / ScALABLE
  8. 8. Our PhilosophyKeep it simple, StupidDo one thing and do it wellSeparation of concernRight tool for the jobHasty generalization
  9. 9. RIAK + ErlangLightweightDistributedScalableResilient to failure
  10. 10. Frontend Service x y x y REST API z q Backend service z qExternal Services RIAK Internal Services
  11. 11. Right datastore for the job 3 x Riak Clusters
  12. 12. ManyONEBACKEND (s)to rule them all
  13. 13. RIAKLeveldbBitcask stackRiak-erlang-client (PB)JSON
  14. 14. OAUTH2Authorization layer on top of Riak
  15. 15. LAZYUPGRADE
  16. 16. -­‐record(user,  {        password                  =  <<"l0ln00b">,        name                          =  <<"noname">>, Get object        i_primary_email    =  <<"ih@ck.se">,        i_primary_phone    =  <<"461337">>,        i_ssn                        =  <<"0123456789">>,        l_tenant                  =  {<<"B">>,  <<"K">>} }).Check version Upgrade object [1...n] RIAK
  17. 17. LOGGING
  18. 18. 1. MetricsAnything youd want toplot on a graph
  19. 19. 2. (Un)structured Log data logging youd want to process
  20. 20. 3. Applicationlogging Error, Notice, Warning, etc
  21. 21. Lager Logglygithub.com/kivra/lager_loggly.git
  22. 22. Lager Sysloggithub.com/basho/lager_syslog
  23. 23. ~197 SLOC ~23 SLOC
  24. 24. Lager{lager,  [ {handlers,  [             {lager_console_backend,  info},                    {lager_loggly_backend,  [<<"Riak">>,                          info,  5,  3,                    "https://<Loggly  URI>"]},                      {lager_loggly_backend,  [<<"Riak">>,                      error,  5,  3,                        "https://<Loggly  URI>"]},                      {lager_file_backend,  [                         {"/path/error.log",  error,  10485760,  "$D0",  5},                              {"/path/console.log",  info,  10485760,  "$D0",  5}                    ]} ]},          ...]},
  25. 25. DEPLOYMENT Central configuration Infrastructure as Code Bootstrap/Upgrade
  26. 26. Data modeling DESIGN Conflict resolution DECISIONS 2i slow and no M/R, Links, Search, etc..TRADEOFFS Key generation Caching
  27. 27. What’s up?Riak CoreData encryptionSearchSession backend
  28. 28. Thank You!https://www.github.com/kivra Bip Thelin bip@kivra.com @bipthelin

×