Microservices at work? • Have heard of Event Sourcing? • Use Event Sourcing at work? • Think these are just fads just like *Javascript everywhere* and can’t wait for the next talk or the pub?
• Running the full test suite took upwards of 10 minutes • Deployments were closer to 20 minutes • Development boot time was approaching a minute • Even small changes required a deployment of the entire application • Each dependency (redis, memcache) was a dependency for everyone/everything • The haystack was large so tracking down bugs was often difficult • Conflicts between front and backend developers were common • Performance as perceived by the end user • Real time app, doesn't fit classic web development paradigms
common goal • Communication is often via HTTP(S)/REST • Can be deployed on the same or different machines • Have their own data stores • Can be scaled vertically or horizontally dependent on functionality
current application state • Workers/Modules/Services subscribe to events and cache what they need • Store snapshots of current state • Always have *Eventual Consistency* in mind
change ever • Trace/Debug every interaction within the system • Replicate the system at any point in time • Great performance thanks to parallelization • No more ORM’s YAY!!! • Data Mining
• Often lumped in with event sourcing • Avoid giant model types (less of a problem in Go) • E.G User creation validation rules run in a separate process to the CRM interface shown to the non tech people
Persistent queue based message broker • Acts as a load balancer • Well supported by all viable languages and platforms • Flexible topologies, ideal for fanning events out through services • Alternatives: Redis / PgSQL pub-sub/ sidekiq / beanstalkd / IronMQ / Amazon SQS • Currently have 3 exchanges: Events, Timber & Services
exchange • Karaoke: validates and authorizes • Karaoke: emits invite.created on the events exchange (does not store the invite) • Timber: stores the event and emits invite.created on the timber exchange • Karaoke: receives the invite.created on the timber exchange and updates its private/internal state and sends an email • Auth Service: receives the invite.created on the timber exchange and creates a record of the invite code to allow for account creation
• More data storage is needed (excluding files and other assets) • Often a different approach to previous experience • Lack of community/blog posts/libraries
the environment • Developers can start and stop only the services they need: $: docker-compose start karaoke • Environment is under version control • No need for virtual machines
Django & break off Go services as necessary • Complexity CAN be a one to one mapping for flexibility • State has bugs, a history of events is concrete even if assumptions on the world are wrong/change • Go is GREAT for micro services
naturally map with the CRUD paradigm • You need version history for audits or ‘undo’ actions • Your application is highly concurrent with long lived operations/actions • You're scaling and growth patterns are unclear