conventions between applications
TRANSCRIPT
![Page 1: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/1.jpg)
Conventions Between Applications
Michael Ries @mmmries
![Page 2: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/2.jpg)
![Page 3: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/3.jpg)
http://www.rubyfuza.org/images/speakers/2015/charles_nutter.jpghttps://scontent-sjc.cdninstagram.com/hphotos-xaf1/t51.2885-15/10838508_854030257976849_260521776_n.jpg
![Page 4: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/4.jpg)
![Page 5: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/5.jpg)
Distributed System?Made of multiple applications working together
![Page 6: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/6.jpg)
2012 => 254 deploys/yr 2014 => 1,884 deploys/yrWhat we learned along the way
everywhere on the internet
![Page 7: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/7.jpg)
Make a DirectoryPublish Events
Deploy Small Changes
![Page 8: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/8.jpg)
Sample Project
When a user is deleted we will cleanup their data
![Page 9: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/9.jpg)
Abacus Amigo
Sherlock BallistaDispatch
Bunyan
Grunt
Newman PersonaRelay Synchro
HulkWormholeFirefly Dunaway AlfredBatcave
Bullseye
![Page 10: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/10.jpg)
The Directory
Easily Navigable by Humans Used By Production Code
http://media.tumblr.com/f9b5d822e963e6f6fc7fe7008b5ee8aa/tumblr_inline_mhbi8egCJz1qz4rgp.gif
![Page 11: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/11.jpg)
Atlas - The Directory
Protobuf (https://developers.google.com/protocol-buffers/) Map Resources to Applications Private Gem
![Page 12: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/12.jpg)
![Page 13: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/13.jpg)
![Page 14: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/14.jpg)
Message Schema Migrations
Backwards Compatible Changes
Deprecations => Backwards Incompatible Changes
![Page 15: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/15.jpg)
User (1.0.0)
guid name
![Page 16: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/16.jpg)
User (1.0.0)
guid name
Amigo NewmanUserSearch
User (1.0.0)
![Page 17: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/17.jpg)
User (1.0.0)
guid name
Amigo Newman
User (1.1.0)
guid name email
UserSearch
User (1.1.0) ?✔
![Page 18: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/18.jpg)
User (1.0.0)
guid name
Amigo Newman
User (1.1.0)
guid name email
![Page 19: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/19.jpg)
User (1.0.0)
guid name
Amigo Newman
User (2.0.0) guid name email
first_name
UserSearch
User (2.0.0) ?X
![Page 20: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/20.jpg)
User (1.0.0)
guid name
Amigo Newman
User (1.2.0) guid
name (deprecated) email
first_name
![Page 21: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/21.jpg)
User (1.0.0)
guid name
Amigo Newman
User (1.2.0) guid
name (deprecated) email
first_name
UserSearch
User (1.2.0) ✔
![Page 22: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/22.jpg)
Newman
User (1.2.0) guid
name (deprecated) email
first_name
newman$ rspec.........DEPRECATION WARNING: Atlas::Amigo::User#name field usage is deprecated. (called from update at /Users/hqmq/code/newman/app/services/atlas/newman/notification_service.rb:26)
![Page 23: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/23.jpg)
The DirectoryNavigable by Team Members Used by Production Code Message Schema
Well-defined Migration Semantics
![Page 24: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/24.jpg)
Abacus Amigo
Sherlock BallistaDispatch
Bunyan
Grunt
Newman PersonaRelay Synchro
HulkWormholeFirefly Dunaway AlfredBatcave
Bullseye
![Page 25: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/25.jpg)
Amigo
User
Client
![Page 26: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/26.jpg)
Amigo
User
Abacus
AccountX X
![Page 27: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/27.jpg)
Amigo
User
Abacus
AccountX X
Newman
Notification
Persona
MemberX X
https://pbs.twimg.com/profile_images/2694242404/5b0619220a92d391534b0cd89bf5adc1_400x400.jpeg
![Page 28: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/28.jpg)
Events
Low Coupling Similar To Controller
![Page 29: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/29.jpg)
Amigo
User
Abacus
AccountX X
Newman
Notification
Persona
MemberX X
![Page 30: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/30.jpg)
Amigo
User X
amigo.user.deleted
![Page 31: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/31.jpg)
Amigo
User
Abacus
Account
Newman
Notification
Persona
Member
X X
X
X
![Page 32: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/32.jpg)
Abacus
Newman
Persona
Firefly
![Page 33: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/33.jpg)
Abacus
Abacus
Abacus
Abacus
Abacus
Abacus
Abacus
Abacus
Abacus
![Page 34: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/34.jpg)
ActionSubscriber
https://github.com/moneydesktop/action_subscriberhttp://hackers.lookout.com/images/jruby_large.png
https://cdn.tutsplus.com/net/uploads/legacy/ 966_essentialReading/images/rubylang.png
![Page 35: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/35.jpg)
class UserSubscriber < ActionSubscriber::Base
def deleted user = payload # Atlas::Amigo::User
delete_accounts_for_user(user.guid) end
end
![Page 36: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/36.jpg)
ActionPublisher
Coming Soon…
![Page 37: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/37.jpg)
ActionPublisher
class User < ActiveRecord::Base include ActionPublisher::Syncable
... other code ... end
![Page 38: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/38.jpg)
EventsLow Coupling Similar To Controller Opt-in To Messages 1 Message Per Application
![Page 39: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/39.jpg)
Amigo
User
Abacus
Account
Newman
Notification
Persona
Member
X X
X
X
![Page 40: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/40.jpg)
Amigo Abacus Persona
Publish user.deleted message
Cleanup Accounts
on user.deleted
Cleanup Members
on user.deleted
Newman
Cleanup Notifications
on user.deleted
![Page 41: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/41.jpg)
4 Tasks???
Cohesive Code Code Review Deploys Overhead
![Page 42: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/42.jpg)
Deployment CostsDeveloper Time Developer Interruption System downtime
![Page 43: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/43.jpg)
Zero-Downtime Matters
2012 2013 2014254 Deploys 1,597 Deploys 1,884 Deploys
Zero Downtime Implemented
![Page 44: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/44.jpg)
TrebuchetExtension to Capistrano Deploy 1-by-1 Deploy in groups
![Page 45: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/45.jpg)
Small DeploysCohesive Codebases Automate Deploys Minimize Cost (interruption/time) Minimize Risk
Code Review++
![Page 46: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/46.jpg)
Make a DirectoryPublish Events
Deploy Small Changes
![Page 47: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/47.jpg)
Team >> TechShared Ownership Teaching / Learning Discipline
http://gifrific.com/wp-content/uploads/2012/04/Punch-After-Celebration.gif
![Page 48: Conventions between applications](https://reader038.vdocument.in/reader038/viewer/2022110314/55cb361fbb61eb7a098b4880/html5/thumbnails/48.jpg)
End
Michael Ries @mmmries