prophet
play

Prophet a path out of the cloud http://syncwith.us - PowerPoint PPT Presentation

Prophet a path out of the cloud http://syncwith.us jesse@bestpractical.com 1 You may know me from... RT (Request Tracker) Jifty SVK Hiveminder Perl 6 Shirts 2 Ive been hacking on an open source database called Prophet 3 It


  1. Prophet a path out of the cloud http://syncwith.us jesse@bestpractical.com 1

  2. You may know me from... RT (Request Tracker) Jifty SVK Hiveminder Perl 6 Shirts 2

  3. I’ve been hacking on an open source database called “Prophet” 3

  4. It has an API like Amazon SimpleDB or Google App Engine’s... 4

  5. It’s designed for “team-scale” apps 5

  6. It’s built for P2P replication and disconnected use 6

  7. App #1 is the canonical “offline bug tracker” 7

  8. App #2 will probably be a BBS you can sync over sneakernet 8

  9. But first, a brief digression... 9

  10. ...about cloud computing 10

  11. Living in the cloud = sharecropping 11

  12. (That’s bad) 12

  13. This is a rant 13

  14. The bad old days: 14

  15. Pic of sharecroppers 15

  16. You farmed land you didn’t own... 16

  17. ...with tools you couldn’t really afford 17

  18. You paid for it with part of your harvest... 18

  19. It sounded like a pretty sweet deal... 19

  20. ...until things got bad 20

  21. (Things always got bad) 21

  22. In a bad year, you got further in debt to the land owner 22

  23. 23

  24. The (more recent) bad old days: 24

  25. pic of mainframes 25

  26. You ran code you didn’t own on hardware you didn’t own 26

  27. Things got a little better: 27

  28. Pic of PCs 28

  29. Things weren’t all rosy: 29

  30. Pic of BSOD 30

  31. Sometimes new versions of software killed features... 31

  32. ...so you were locked in to old versions 32

  33. pic of win 31? 33

  34. Things got ‘better’: 34

  35. rms che 35

  36. Now, things are getting worse again... 36

  37. 37

  38. What happens when your favorite service goes down? 38

  39. pic of twitter being down 39

  40. ...or stops accepting new signups? 40

  41. 41

  42. ...or gives all your data to the secret police? 42

  43. Pic of yahoo.cn 43

  44. ...or starts making arbitrary choices about what’s ‘safe’ content? 44

  45. 45

  46. You don’t own the services you use 46

  47. When the service provider cuts you off, that’s it. No recourse. 47

  48. Not so secret shame: I’m a really bad zealot 48

  49. My calendar lives at google.com 49

  50. 50

  51. I make a web 2.0 tasklist service called Hiveminder.com 51

  52. pic of hiveminder 52

  53. Using hosted apps is going to hurt you 53

  54. Data access is important 54

  55. APIs are great 55

  56. ...but easy access to a service just makes it easier to get locked in 56

  57. What about Google Gears, Adobe Air, etc? 57

  58. Great. now you can use your word processer while you’re offline! 58

  59. Pic of wordperfect 59

  60. Real offline apps shouldn’t need servers 60

  61. Real offline apps should sync like you do 61

  62. I might be a nut job 62

  63. ...but smart people seem to agree with me 63

  64. If we want people to have the same degree of user autonomy as we've come to expect from the world, we may have to sit down and code alternatives to Google Docs, Twitter, and EC3 that can live with us on the edge, not be run by third parties. - Danny O’Brien http://www.oblomovka.com/entries/2008/07/16 64

  65. Back to that database thing... 65

  66. Jesse Vincent 66

  67. Chia-liang Kao 67

  68. We work together 68

  69. CL lives in Taipei Jesse lives in Boston 69

  70. Sometimes we need to work face to face 70

  71. TPE - BOS: 9410 mi TPE - HNL: 5,095 mi BOS - HNL: 5,069 mi 71

  72. Our Plan Step 1: Go to Hawaii for “work” Step 2: ??? Step 3: Prophet! 72

  73. The Plan Backfired We were there for 8 days We wrote 8000 lines of Perl We figured out step 2 73

  74. Step 2: Build a Disconnected Syncable Database 74

  75. Prophet 75

  76. Getting Prophet Prophet http://syncwith.us/prophet SD http://syncwith.us/sd 76

  77. Prophet A grounded, semirelational, peer to peer replicated, disconnected, versioned, property database with self-healing conflict resolution 77

  78. What do all those buzzwords mean? 78

  79. grounded Runs here 79

  80. grounded Not here 80

  81. grounded Runs at the edge Doesn’t need to run in the cloud Syncs with services you already use (We call the adaptors “Foreign Replicas”) 81

  82. semirelational Joins are expensive (They’re still possible) 82

  83. peer-to-peer replicated Update any replica Pull from any replica Push to any replica Publish a replica Changes will propagate 83

  84. disconnected Real-time replication is hard to scale It only “works” with constant connectivity I don’t have constant connectivity Neither do you Prophet sync can happen whenever 84

  85. versioned Every update is recorded as a change set Change sets don’t lose any data (so you can use them to go backwards) All history is introspectable Replication just replays changesets 85

  86. property database Atomic operations CREATE, READ, UPDATE, DELETE, SEARCH Record types can have optional validation and canonicalization Records of the same type do not need to have the same properties Add and remove properties at will 86

  87. self-healing conflict resolution Remembers all conflict resolutions Syncs all resolutions with your peers Detects identical conflicts Uses your peers’ resolutions to “vote” for the winner of a conflict 87

  88. Working with Prophet 88

  89. RESTy API GET /records.json GET /records/Cars.json GET /records/Cars/716499-5F9-4AC4-827.json GET /records/Cars/716499-5F9-4AC4-827/wheels.json POST /records/Cars.json POST /records/Cars/716499-5F9-4AC4-827.json POST /records/Cars/716499-5F9-4AC4-827/wheels.json 89

  90. RESTy API Yes, we should be using PUT and DELETE Yes, you can have a commit bit and help us fix it :) 90

  91. Native API (Yes, the core is Perl.) my $cli = Prophet::CLI->new(); my $cxn = $cli->app_handle->handle; my $record = Prophet::Record->new( handle => $cxn, type => 'Person' ); my $uuid = $record->create( props => { name => 'Jesse', age => 31 } ); $record->set_prop( name => 'age', value => 32 ); my $people = Prophet::Collection->new( handle => $cxn, type => 'Person' ); $people->matching( sub { shift->prop('species') ne 'cat' } ); 91

  92. What could you build with Prophet? 92

  93. sd A bug tracker: “simple defects” • id. Status, Summary • (Arbitrary other properties too) • History • Comments • Attachments 93

  94. Create ./bin/sd ticket create -- summary="Can't sync sd with Google Code" status=new Created ticket 5 (93BF979E-08C1-11DD-94C3-D4B1FCEE7EC4) 94

  95. List and Search ./bin/sd ticket search --regex publish 29 } new the online help doesn't describe publish 34 } new publish a static html view of records 35 } new publish should create a static rss file 95

  96. Updates ./bin/sd ticket update --uuid 93BF979E-08C1-11DD-94C3-D4B1FCEE7EC4 -- status=resolved 96

  97. Bugs on my laptop aren’t interesting. 97

  98. Sync! Jesse sd publish --to fsck.com:public_html/sd/ CL sd pull --from http://my.com/~jesse/sd 98

  99. My project has a bug tracker 99

  100. My project has a bug tracker Actually, mine use two: • RT • hiveminder.com 99

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend