SlideShare a Scribd company logo
1 of 130
Download to read offline
Microservices
A Tutorial Session
JavaOne 2016
by Jason Swartz
@swartzrock
MICROSERVICES
WHAT WHY
a.k.a “WHEN”
HOW
What’s A
Microservice?
Your Application,
Subdivided
Recipe: Microservices
(makes 5-10 microservices)
Ingredients:
● A Monolithic API, Too Big To Handle
Instructions:
1. Find the seams in your application - by operation, business area, or team.
2. Split your API into multiple smaller API’s, each on its own server.
3. Figure out how to deploy them w/o breaking everything.
4. Figure out how they’ll talk to each other w/o breaking more things.
5. Figure out how complex data operations will work across multiple data stores.
Let’s Split-Up
That Service
1. Small & Maintainable
2. Private data
3. Generally Isolated
Microservice Properties
1. Small & Maintainable
2. Private data
3. Generally Isolated
Microservice Nice-To-Haves
1. Findable
2. Scalable
3. Resilient
4. Monitorable
Microservice Nice-To-Haves
Microservices That Speak To Each Other Via
Asynchronous Communication
Microservice Real Nice-To-Haves
Let’s See a
Real
Transaction
Web Client: PUT issues/123 Assignee=10
Issues Service: Read from issues db
Issues Service: GET users/10
Issues Service: POST users/notify/10
Issues Service: Write to issues db
Issues Service: Return response with result
Web Client: Read response & status then handle it
Web Client: PUT issues/123 Assignee=10
Issues Service: Read from issues db
// block for synchronous transaction
// block for synchronous transaction
Issues Service: Write to issues db
Issues Service: Return response with result
Web Client: Read response & status then handle it
Blocking Isn’t
Isolated, Scalable
Or Resilient
But It Is
Easy!
1. Easy!
2. Gratifying.
3. Testable.
Synchronous Messaging Pros
1. Prevents microservices from being isolated,
scalable, and resilient.
2. Hope you like waiting.
Synchronous Messaging Cons
Microservices
Should Talk
Asynchronously
1. Non-Blocking IO (eg RxJava, Netty)
2. Queues (eg SQS)
3. Event Streams (eg Kafka, Kinesis)
4. Actors (eg Akka)
Talking Asynchronously
What About The
Clients?
1. Synchronous REST with Async Clients
2. Http 202
3. Websockets
4. Http/2
Responding Asynchronously
That’s What
Microservices Are All
About
WHAT WHY
a.k.a “WHEN”
HOW
Monolith
To
Microservices
Why
Might This Be A
Good Idea?
(Assuming You’re Planning
to Split Up your Monolith)
1. Finding code and refactoring it is pretty easy.
2. No network lag
3. No format conversion errors
4. Deploy in one go
Monoliths - Not So Bad
That’s All
Thanks For Listening!
1. Hard to scale up just one feature
2. Hard to deploy just one change
3. Not suitable for more than a small team
Monoliths - Not So Scalable Either
Organizations Are
Constrained To Produce
Designs That Match Their
Communication Structure
Max Capacity:
One Team
Max Capacity:
Two Teams
Don’t Split Monoliths
Across Your
Communication
Structures
(we kind of covered this already)
Microservices Pros
1. Network Lag
2. Multiple Data Formats
3. Service Resolution
4. Troubleshooting
5. More Deployment Work
6. More Monitoring
Microservices Challenges
No Problem.
Let’s Get Started On
How
You’ll Build Em
WHAT WHY
a.k.a “WHEN”
HOW
Microservices In
Java
How Will You Get
Your App In
Production?
1. Self-Running Jar’s
2. VM Images
3. Docker Images
Deployment Formats
1. Use A CI To Build / Test / Merge in CI
2. Use A CD To Deploy (Push-Button / Auto)
3. VM Deployment (eg Spinnaker)
4. Docker Deployment (eg ECS, K8s, Marathon)
5. Cluster Management (eg K8s, Mesos, Swarm)
Deployment Strategies
Yes
Should I Deploy To The Cloud?
YES OH YES
Should I Test It First?
1. Service Resolution (K8s, Consul)
2. Scaling
3. Visibility
4. Authentication
5. Monitoring
Microservice Management
Let’s Talk
Microservices
Development
(why switch now?)
Choosing A Framework
1. Spring Boot
2. Lagom
3. Ratpack
4. Dropwizard
Choosing A Framework
1. Good Ol’ SQL (eg MySQL, Postgresql)
2. Document-type NoSQL
3. Fast Key-Value Caches
Choosing A Data Store
1. CRUD operations endpoints & tables
2. CRUD endpoints and immutable tables
3. Event-Sourced Data
Choosing A Data Scheme
Create-Read-
Update-Delete
Let’s Talk About
Immutable Tables
GET /issues
GET /issues/{id}
POST /issues
PUT /issues/{id}
Issue Endpoints
How Do These Events
Affect The Database?
1. POST /issues title=’Config ELB’
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
Not Bad.
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
Do You Know How We Got Here?
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
Do You Know How We Got Here?
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
Do You Know How We Got Here?
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
Why is ‘assignee’ NULL?
Mutable Table Rows
Lose History
Immutable Table
Rows KeepTheir History
Let’s Try To
Lock Down
Our State
1. POST /issues title=’Config ELB’
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:19 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:19 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
1. GET /issues/1
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:19 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | NULL | true |
+------+-------------+------------+----------+-------+
How Do You Make An
Append-Only
Table?
One: Don’t Let Your DB
User Make
Changes
Grant select, insert on
issues to my-db-user;
Two: Pick The Right
Columns
create table issues (
id serial,
created timestamp default now(),
creator_id int,
issue_id int default nextval(‘iseq’),
title text,
assignee int,
done boolean default false
)
Do We Still Need
State?
Let’s Talk About
Event-Sourcing
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | 10 | true |
+------+-------------+------------+----------+-------+
1. POST /issues title=’Config ELB’
2. PUT /issues/1 assignee=10
3. PUT /issues/1 done=true
+------+-------------+------------+----------+-------+
| id | updated | title | assignee | done |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:13 | Config ELB | NULL | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:16 | Config ELB | 10 | false |
+------+-------------+------------+----------+-------+
| 1 | 09-18 18:24 | Config ELB | 10 | true |
+------+-------------+------------+----------+-------+
Events
States
Now We’re Storing
Events,
Not States
create table issue_events (
id serial,
created timestamp default now(),
issue_id int default nextval(‘iseq’),
originator text,
payload text
)
1. POST /issue/1/event ‘Originator: 4a48239-8a..’
payload=’<Update val=”done=true”>’
+----+-------------+----------+------------+---------+
| id | created | issue_id | originator | payload |
+----+-------------+----------+------------+---------+
| 14 | 09-18 18:50 | 1 | 4a482... | <...> |
+----+-------------+----------+------------+---------+
Create Events And
Simulate The State
1. Create-Issue
Issue(“Config ELB”, null, false);
Real Events
Virtual States
1. Create-Issue
2. Assign-Issue
Issue(“Config ELB”, 10, false);
Real Events
Virtual States
1. Create-Issue
2. Assign-Issue
3. Complete-Issue
Issue(“Config ELB”, 10, true);
Real Events
Virtual States
So Why Use
Event-Sourcing?
1. High Write Performance
2. Potential for Command/Query Separation
3. Auditable
4. Replayable
5. Undo-able
6. Monitorable
Reasons For Event-Sourcing
It’s Like Having Control
Over The Versions Of
Your State Changes
It’s Like Having Control
Over The Versions Of
Your Data
It’s Like Git
For Your Data
1. Frankly, It’s Weird
2. Requires Events. No Events, No Event-Sourcing.
3. As Of Sept 2016, It’s Still Non-Standard
Reasons Against Event-Sourcing
That About Sums Up
Microservice
Development
That About Sums Up
Microservice
Development
Okay, Actually That’s The
Entire Session
Unless There’s More Time
WHAT WHY
a.k.a “WHEN”
HOW
by Jason Swartz
@swartzrock
Microservices
A Tutorial Session
JavaOne 2016
Web Applications for the REST of Us: An Introduction to
Ember.js, Akka, and Spray (Craig Tataryn & Sean Kowaski)
A Practical RxJava Example with Ratpack (Laurent Doguin)
One Microservice Is No Microservice: They Come In Systems
(Markus Eisele)
Make Sure To See...
Thank You
For Attending
Fin
Just Kidding, There’s
Another Section
Let’s Talk
Asynchronous
Architectures in AWS
Do You Want To Use
Caches To Prevent
Unnecessary
Blocking Calls?
Do You Want To Insert
Rows And Publish
Events In One Stroke?
Do You Want To
Mass-Publish One Event
To All Microservices?
Note About Your Solution:
I’m Not Saying It’s AWS
But It’s AWS
Okay, We Are Really
Done This Time
THIS SPACE
LEFT BLANK

More Related Content

Viewers also liked

Build Enterprise APIs WIth Ease (And Scala)
Build Enterprise APIs WIth Ease (And Scala)Build Enterprise APIs WIth Ease (And Scala)
Build Enterprise APIs WIth Ease (And Scala)Jason Swartz
 
Cryptographic Hash Function using Cellular Automata
Cryptographic Hash Function using Cellular AutomataCryptographic Hash Function using Cellular Automata
Cryptographic Hash Function using Cellular AutomataEditor IJCATR
 
Owasp Forum Web Services Security
Owasp Forum Web Services SecurityOwasp Forum Web Services Security
Owasp Forum Web Services SecurityMarco Morana
 
XML And Web Services Security Standards
XML And Web Services Security StandardsXML And Web Services Security Standards
XML And Web Services Security Standardsguest68465b
 
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]Bert Ertman
 
18 hashing
18 hashing18 hashing
18 hashingdeonnash
 
Web Services Security Tutorial
Web Services Security TutorialWeb Services Security Tutorial
Web Services Security TutorialJorgen Thelin
 
Everyone's guide to event sourcing and async-messaging
Everyone's guide to event sourcing and async-messagingEveryone's guide to event sourcing and async-messaging
Everyone's guide to event sourcing and async-messagingJason Swartz
 
Everyone's Guide to States, Events and Async-Messaging for Microservices
Everyone's Guide to States, Events and Async-Messaging for MicroservicesEveryone's Guide to States, Events and Async-Messaging for Microservices
Everyone's Guide to States, Events and Async-Messaging for MicroservicesJason Swartz
 
How Hootsuite Manages its Growing Microservice Landscape - Adam Arsenault
How Hootsuite Manages its Growing Microservice Landscape - Adam ArsenaultHow Hootsuite Manages its Growing Microservice Landscape - Adam Arsenault
How Hootsuite Manages its Growing Microservice Landscape - Adam ArsenaultAmbassador Labs
 
“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic DiabetesTzach Zohar
 
Microservices for Mortals
Microservices for MortalsMicroservices for Mortals
Microservices for MortalsBert Ertman
 
Engineering and Autonomy in the Age of Microservices - Nic Benders, New Relic
Engineering and Autonomy in the Age of Microservices - Nic Benders, New RelicEngineering and Autonomy in the Age of Microservices - Nic Benders, New Relic
Engineering and Autonomy in the Age of Microservices - Nic Benders, New RelicAmbassador Labs
 
Simple, battle proven microservices strategy
Simple, battle proven microservices strategySimple, battle proven microservices strategy
Simple, battle proven microservices strategyErez Lotan
 
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Sander Hoogendoorn
 
Enterprise APIs With Ease - Scala Developers of Barcelona
Enterprise APIs With Ease - Scala Developers of BarcelonaEnterprise APIs With Ease - Scala Developers of Barcelona
Enterprise APIs With Ease - Scala Developers of BarcelonaJason Swartz
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Chris Richardson
 
Rethinking it for digital transformation
Rethinking it for digital transformationRethinking it for digital transformation
Rethinking it for digital transformationMuleSoft
 

Viewers also liked (20)

Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Build Enterprise APIs WIth Ease (And Scala)
Build Enterprise APIs WIth Ease (And Scala)Build Enterprise APIs WIth Ease (And Scala)
Build Enterprise APIs WIth Ease (And Scala)
 
Cryptographic Hash Function using Cellular Automata
Cryptographic Hash Function using Cellular AutomataCryptographic Hash Function using Cellular Automata
Cryptographic Hash Function using Cellular Automata
 
Owasp Forum Web Services Security
Owasp Forum Web Services SecurityOwasp Forum Web Services Security
Owasp Forum Web Services Security
 
XML And Web Services Security Standards
XML And Web Services Security StandardsXML And Web Services Security Standards
XML And Web Services Security Standards
 
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]
Migrating from Spring Applications to Java EE 6 [CHINESE VERSION]
 
18 hashing
18 hashing18 hashing
18 hashing
 
Web Services Security Tutorial
Web Services Security TutorialWeb Services Security Tutorial
Web Services Security Tutorial
 
Everyone's guide to event sourcing and async-messaging
Everyone's guide to event sourcing and async-messagingEveryone's guide to event sourcing and async-messaging
Everyone's guide to event sourcing and async-messaging
 
Everyone's Guide to States, Events and Async-Messaging for Microservices
Everyone's Guide to States, Events and Async-Messaging for MicroservicesEveryone's Guide to States, Events and Async-Messaging for Microservices
Everyone's Guide to States, Events and Async-Messaging for Microservices
 
How Hootsuite Manages its Growing Microservice Landscape - Adam Arsenault
How Hootsuite Manages its Growing Microservice Landscape - Adam ArsenaultHow Hootsuite Manages its Growing Microservice Landscape - Adam Arsenault
How Hootsuite Manages its Growing Microservice Landscape - Adam Arsenault
 
“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes
 
Digital Transformation and Microservices
Digital Transformation and MicroservicesDigital Transformation and Microservices
Digital Transformation and Microservices
 
Microservices for Mortals
Microservices for MortalsMicroservices for Mortals
Microservices for Mortals
 
Engineering and Autonomy in the Age of Microservices - Nic Benders, New Relic
Engineering and Autonomy in the Age of Microservices - Nic Benders, New RelicEngineering and Autonomy in the Age of Microservices - Nic Benders, New Relic
Engineering and Autonomy in the Age of Microservices - Nic Benders, New Relic
 
Simple, battle proven microservices strategy
Simple, battle proven microservices strategySimple, battle proven microservices strategy
Simple, battle proven microservices strategy
 
Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...Designing and building a micro-services architecture. Stairway to heaven or a...
Designing and building a micro-services architecture. Stairway to heaven or a...
 
Enterprise APIs With Ease - Scala Developers of Barcelona
Enterprise APIs With Ease - Scala Developers of BarcelonaEnterprise APIs With Ease - Scala Developers of Barcelona
Enterprise APIs With Ease - Scala Developers of Barcelona
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)
 
Rethinking it for digital transformation
Rethinking it for digital transformationRethinking it for digital transformation
Rethinking it for digital transformation
 

Similar to Microservices Tutorial Session at JavaOne 2016

Functional Database Strategies
Functional Database StrategiesFunctional Database Strategies
Functional Database StrategiesJason Swartz
 
Oracle Exadata Cloud Services guide from practical experience - OOW19
Oracle Exadata Cloud Services guide from practical experience - OOW19Oracle Exadata Cloud Services guide from practical experience - OOW19
Oracle Exadata Cloud Services guide from practical experience - OOW19Nelson Calero
 
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System TablesObservability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System TablesInfluxData
 
You got a couple Microservices, now what? - Adding SRE to DevOps
You got a couple Microservices, now what?  - Adding SRE to DevOpsYou got a couple Microservices, now what?  - Adding SRE to DevOps
You got a couple Microservices, now what? - Adding SRE to DevOpsGonzalo Maldonado
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
 
Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Ivan Ma
 
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)Yan Cui
 
Case Study: MySQL migration from latin1 to UTF-8
Case Study: MySQL migration from latin1 to UTF-8Case Study: MySQL migration from latin1 to UTF-8
Case Study: MySQL migration from latin1 to UTF-8Olivier DASINI
 
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)Yan Cui
 
Harnessing Configuration for Web GIS Application Development
Harnessing Configuration for Web GIS Application DevelopmentHarnessing Configuration for Web GIS Application Development
Harnessing Configuration for Web GIS Application DevelopmentGeCo in the Rockies
 
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleVeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleJim Jones
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demoSudha Ch
 
MySQL 8.0: Secure your replication deployment
MySQL 8.0: Secure your replication deploymentMySQL 8.0: Secure your replication deployment
MySQL 8.0: Secure your replication deploymentPedro Figueiredo
 
Percona live-2012-optimizer-tuning
Percona live-2012-optimizer-tuningPercona live-2012-optimizer-tuning
Percona live-2012-optimizer-tuningSergey Petrunya
 
Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Yan Cui
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Wojciech Barczyński
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2Morgan Tocker
 

Similar to Microservices Tutorial Session at JavaOne 2016 (20)

Functional Database Strategies
Functional Database StrategiesFunctional Database Strategies
Functional Database Strategies
 
Oracle Exadata Cloud Services guide from practical experience - OOW19
Oracle Exadata Cloud Services guide from practical experience - OOW19Oracle Exadata Cloud Services guide from practical experience - OOW19
Oracle Exadata Cloud Services guide from practical experience - OOW19
 
Perf Tuning Short
Perf Tuning ShortPerf Tuning Short
Perf Tuning Short
 
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System TablesObservability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
 
You got a couple Microservices, now what? - Adding SRE to DevOps
You got a couple Microservices, now what?  - Adding SRE to DevOpsYou got a couple Microservices, now what?  - Adding SRE to DevOps
You got a couple Microservices, now what? - Adding SRE to DevOps
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
20150423 m3
20150423 m320150423 m3
20150423 m3
 
For Each Component
For Each ComponentFor Each Component
For Each Component
 
Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Exploring mysql cluster 7.4
Exploring mysql cluster 7.4
 
Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)Serverless in Production, an experience report (cloudXchange)
Serverless in Production, an experience report (cloudXchange)
 
Case Study: MySQL migration from latin1 to UTF-8
Case Study: MySQL migration from latin1 to UTF-8Case Study: MySQL migration from latin1 to UTF-8
Case Study: MySQL migration from latin1 to UTF-8
 
Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)Serverless in production, an experience report (LNUG)
Serverless in production, an experience report (LNUG)
 
Harnessing Configuration for Web GIS Application Development
Harnessing Configuration for Web GIS Application DevelopmentHarnessing Configuration for Web GIS Application Development
Harnessing Configuration for Web GIS Application Development
 
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at ScaleVeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
VeeamON 2023 Architecting Veeam Backup for Microsoft 365 at Scale
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
MySQL 8.0: Secure your replication deployment
MySQL 8.0: Secure your replication deploymentMySQL 8.0: Secure your replication deployment
MySQL 8.0: Secure your replication deployment
 
Percona live-2012-optimizer-tuning
Percona live-2012-optimizer-tuningPercona live-2012-optimizer-tuning
Percona live-2012-optimizer-tuning
 
Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)
 
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
Effective Kubernetes - Is Kubernetes the new Linux? Is the new Application Se...
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Microservices Tutorial Session at JavaOne 2016

  • 7. Recipe: Microservices (makes 5-10 microservices) Ingredients: ● A Monolithic API, Too Big To Handle Instructions: 1. Find the seams in your application - by operation, business area, or team. 2. Split your API into multiple smaller API’s, each on its own server. 3. Figure out how to deploy them w/o breaking everything. 4. Figure out how they’ll talk to each other w/o breaking more things. 5. Figure out how complex data operations will work across multiple data stores.
  • 8.
  • 9.
  • 10.
  • 12.
  • 13.
  • 14.
  • 15. 1. Small & Maintainable 2. Private data 3. Generally Isolated Microservice Properties
  • 16. 1. Small & Maintainable 2. Private data 3. Generally Isolated Microservice Nice-To-Haves
  • 17. 1. Findable 2. Scalable 3. Resilient 4. Monitorable Microservice Nice-To-Haves
  • 18. Microservices That Speak To Each Other Via Asynchronous Communication Microservice Real Nice-To-Haves
  • 19.
  • 21. Web Client: PUT issues/123 Assignee=10 Issues Service: Read from issues db Issues Service: GET users/10 Issues Service: POST users/notify/10 Issues Service: Write to issues db Issues Service: Return response with result Web Client: Read response & status then handle it
  • 22. Web Client: PUT issues/123 Assignee=10 Issues Service: Read from issues db // block for synchronous transaction // block for synchronous transaction Issues Service: Write to issues db Issues Service: Return response with result Web Client: Read response & status then handle it
  • 25. 1. Easy! 2. Gratifying. 3. Testable. Synchronous Messaging Pros
  • 26. 1. Prevents microservices from being isolated, scalable, and resilient. 2. Hope you like waiting. Synchronous Messaging Cons
  • 28. 1. Non-Blocking IO (eg RxJava, Netty) 2. Queues (eg SQS) 3. Event Streams (eg Kafka, Kinesis) 4. Actors (eg Akka) Talking Asynchronously
  • 30. 1. Synchronous REST with Async Clients 2. Http 202 3. Websockets 4. Http/2 Responding Asynchronously
  • 34. Why Might This Be A Good Idea?
  • 35. (Assuming You’re Planning to Split Up your Monolith)
  • 36. 1. Finding code and refactoring it is pretty easy. 2. No network lag 3. No format conversion errors 4. Deploy in one go Monoliths - Not So Bad
  • 38. 1. Hard to scale up just one feature 2. Hard to deploy just one change 3. Not suitable for more than a small team Monoliths - Not So Scalable Either
  • 39. Organizations Are Constrained To Produce Designs That Match Their Communication Structure
  • 40.
  • 42.
  • 44. Don’t Split Monoliths Across Your Communication Structures
  • 45. (we kind of covered this already) Microservices Pros
  • 46. 1. Network Lag 2. Multiple Data Formats 3. Service Resolution 4. Troubleshooting 5. More Deployment Work 6. More Monitoring Microservices Challenges
  • 47. No Problem. Let’s Get Started On How You’ll Build Em
  • 50. How Will You Get Your App In Production?
  • 51. 1. Self-Running Jar’s 2. VM Images 3. Docker Images Deployment Formats
  • 52. 1. Use A CI To Build / Test / Merge in CI 2. Use A CD To Deploy (Push-Button / Auto) 3. VM Deployment (eg Spinnaker) 4. Docker Deployment (eg ECS, K8s, Marathon) 5. Cluster Management (eg K8s, Mesos, Swarm) Deployment Strategies
  • 53. Yes Should I Deploy To The Cloud?
  • 54. YES OH YES Should I Test It First?
  • 55. 1. Service Resolution (K8s, Consul) 2. Scaling 3. Visibility 4. Authentication 5. Monitoring Microservice Management
  • 58. 1. Spring Boot 2. Lagom 3. Ratpack 4. Dropwizard Choosing A Framework
  • 59. 1. Good Ol’ SQL (eg MySQL, Postgresql) 2. Document-type NoSQL 3. Fast Key-Value Caches Choosing A Data Store
  • 60. 1. CRUD operations endpoints & tables 2. CRUD endpoints and immutable tables 3. Event-Sourced Data Choosing A Data Scheme
  • 63.
  • 64. GET /issues GET /issues/{id} POST /issues PUT /issues/{id} Issue Endpoints
  • 65. How Do These Events Affect The Database?
  • 66. 1. POST /issues title=’Config ELB’ +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+
  • 67. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+
  • 68. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+
  • 69. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+ Not Bad.
  • 70. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+ Do You Know How We Got Here?
  • 71. +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+ Do You Know How We Got Here?
  • 72. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+ Do You Know How We Got Here?
  • 73. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+ Why is ‘assignee’ NULL?
  • 76. Let’s Try To Lock Down Our State
  • 77. 1. POST /issues title=’Config ELB’ +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+
  • 78. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+
  • 79. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:19 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+
  • 80. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:19 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+
  • 81. 1. GET /issues/1 +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:19 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | NULL | true | +------+-------------+------------+----------+-------+
  • 82. How Do You Make An Append-Only Table?
  • 83. One: Don’t Let Your DB User Make Changes
  • 84. Grant select, insert on issues to my-db-user;
  • 85. Two: Pick The Right Columns
  • 86. create table issues ( id serial, created timestamp default now(), creator_id int, issue_id int default nextval(‘iseq’), title text, assignee int, done boolean default false )
  • 87. Do We Still Need State?
  • 89. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | 10 | true | +------+-------------+------------+----------+-------+
  • 90. 1. POST /issues title=’Config ELB’ 2. PUT /issues/1 assignee=10 3. PUT /issues/1 done=true +------+-------------+------------+----------+-------+ | id | updated | title | assignee | done | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:13 | Config ELB | NULL | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:16 | Config ELB | 10 | false | +------+-------------+------------+----------+-------+ | 1 | 09-18 18:24 | Config ELB | 10 | true | +------+-------------+------------+----------+-------+ Events States
  • 91.
  • 92.
  • 93.
  • 94.
  • 96. create table issue_events ( id serial, created timestamp default now(), issue_id int default nextval(‘iseq’), originator text, payload text )
  • 97. 1. POST /issue/1/event ‘Originator: 4a48239-8a..’ payload=’<Update val=”done=true”>’ +----+-------------+----------+------------+---------+ | id | created | issue_id | originator | payload | +----+-------------+----------+------------+---------+ | 14 | 09-18 18:50 | 1 | 4a482... | <...> | +----+-------------+----------+------------+---------+
  • 99. 1. Create-Issue Issue(“Config ELB”, null, false); Real Events Virtual States
  • 100. 1. Create-Issue 2. Assign-Issue Issue(“Config ELB”, 10, false); Real Events Virtual States
  • 101. 1. Create-Issue 2. Assign-Issue 3. Complete-Issue Issue(“Config ELB”, 10, true); Real Events Virtual States
  • 103. 1. High Write Performance 2. Potential for Command/Query Separation 3. Auditable 4. Replayable 5. Undo-able 6. Monitorable Reasons For Event-Sourcing
  • 104. It’s Like Having Control Over The Versions Of Your State Changes
  • 105. It’s Like Having Control Over The Versions Of Your Data
  • 106. It’s Like Git For Your Data
  • 107. 1. Frankly, It’s Weird 2. Requires Events. No Events, No Event-Sourcing. 3. As Of Sept 2016, It’s Still Non-Standard Reasons Against Event-Sourcing
  • 108. That About Sums Up Microservice Development
  • 109. That About Sums Up Microservice Development
  • 110. Okay, Actually That’s The Entire Session Unless There’s More Time
  • 114. Web Applications for the REST of Us: An Introduction to Ember.js, Akka, and Spray (Craig Tataryn & Sean Kowaski) A Practical RxJava Example with Ratpack (Laurent Doguin) One Microservice Is No Microservice: They Come In Systems (Markus Eisele) Make Sure To See...
  • 116. Fin
  • 119. Do You Want To Use Caches To Prevent Unnecessary Blocking Calls?
  • 120.
  • 121. Do You Want To Insert Rows And Publish Events In One Stroke?
  • 122.
  • 123.
  • 124. Do You Want To Mass-Publish One Event To All Microservices?
  • 125.
  • 126.
  • 127. Note About Your Solution: I’m Not Saying It’s AWS
  • 129. Okay, We Are Really Done This Time