design micro service architectures the right way...design micro service architectures the right way...
TRANSCRIPT
![Page 1: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/1.jpg)
Design Micro Service Architectures the
Right Way
Michael [email protected] / @mbryzek
Cofounder / CTO Flow
Cofounder / ex-CTO Gilt
![Page 2: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/2.jpg)
A personal story
Could you change this URL from
https://foo.com/latest/bar.js to
https://foo.com/1.5.3/ bar.js ?
è Sorry – that would take weeks; we don’t have the resources to do that.
![Page 3: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/3.jpg)
https://www.pinterest.com/pin/262264378280617506/
It’s just a friggin URL!!!
![Page 4: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/4.jpg)
How does this happen?
• URL in a library• 100s of services to update• Some not touched in years,
requiring dependency updates
https://www.pinterest.com/pin/262264378280617506/
![Page 5: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/5.jpg)
Great Architecture
Scales Development Teams
Delivers Quality
Enables High Performance / Low Cost
Supports Future Features Naturally
![Page 6: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/6.jpg)
Not So Great Architecture
Tradeoffs:
http://ziogeek.com/wp-content/uploads/2013/07/spaghetti.jpg
Near term velocity
Future Paralysis
![Page 7: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/7.jpg)
Design Micro Service Architectures the Right Way
![Page 8: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/8.jpg)
About Me
www.flow.io
www.gilt.com
![Page 9: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/9.jpg)
Let’s Start
With a few
Misconceptions
![Page 10: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/10.jpg)
Misconception #1
Micro Services enable our teams to choose the best
programming languages and frameworks for their tasks
Reality:We’ll demonstrate just how expensive this is.
Team size and investment are critical inputs.
![Page 11: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/11.jpg)
Misconception #2
Code Generation is Evil
Reality:
What’s important is creating a defined
schema that is 100% trusted.
We’ll demonstrate one technique leveraging code generation
![Page 12: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/12.jpg)
Misconception #3
The Event Log Must be the Source of Truth
Reality:
Events are critical parts of an interface.
But it’s okay for services to be the
system of record for their resources.
![Page 13: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/13.jpg)
Misconception #4
Developers can maintain no more than 3 services each
Reality:
Wrong metric; we’ll demonstrate where automation shines.
Flow developers today each maintain ~5 services
Weekly maintenance <5% of time
![Page 14: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/14.jpg)
Flow Commerce ArchitectureFlow Platform Architecture
Exte
rnal
Dat
a Pro
vider
s (e
.g.,
FX, I
P Ge
o, II
N/BI
N, e
tc.)
Catalog Payment Inventory Orders 100+ services
Event Bus (Kinesis)
Lambda Architecture / Data Mart
API Proxy
OMS
3PL / WMS, Etc.
EcommercePlatform
RetailWebsite
FLOW APIs
Flow
.js
Flow Console Track.flow.ioM
icro
serv
ices
Integration Methods & Services
Client Platform
Fulfillment
Shopify Magento
SFCC Solidus
Plugins & Cartridges
Direct Integrations
Checkout UI
Flow SystemClient System3rd Party DataData Flow
Key
FTP Webhook
Kinesis Partner API
Amazon Web Services
Client Checkout
![Page 15: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/15.jpg)
API Definition Done correctly, even things likeGDPR compliance can be modeled
![Page 16: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/16.jpg)
Resource Oriented
![Page 17: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/17.jpg)
Definitions in Git, with Continuous Integration
![Page 18: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/18.jpg)
Tests Enforce Consistency
Goal: It should feel like one person wrote the entire API
![Page 19: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/19.jpg)
Tests Prevent Errors
https://app.apibuilder.io/history?org=flow&app=api
Verify potentially breaking changesduring API Design Phase
![Page 20: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/20.jpg)
API Implementation Supported by Code Generation
![Page 21: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/21.jpg)
Code Generation: Routes
Guarantee that API operations are actually defined
User friendly paths
Consistent naming for methods
![Page 22: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/22.jpg)
Code Generation: Client
![Page 23: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/23.jpg)
Code Generation: Mock Client
Mock and Client from Same Source
Enables High Fidelity, Fast Testing
![Page 24: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/24.jpg)
Code Generation: Clients
The system of record IS the API specification
Code generation ensures that we actually adhere to the spec
Provide many common languages for our users
[https://app.apibuilder.io/generators/]
![Page 25: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/25.jpg)
Now Let’s Implement
Goal: Code we actually write is simple, consistent
![Page 26: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/26.jpg)
Database Architecture
Each micro service application owns its database
No other service is allowed to connect to the database
Other services use only the service interface (API + Events)
![Page 27: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/27.jpg)
Create a DatabaseCLI as single interface for infra and common development tasks
![Page 28: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/28.jpg)
Define storage requirements in metadata
Describe ”scala” requirements
Describe “psql” requirements
Code generate the table definition
Code generate the Data Access Object
Note data tier independent from API,
Just uses same toolchain
![Page 29: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/29.jpg)
Code generation: Create a Table
Consistent checks, metadata
Enable global features like ‘hash_code’ to minimize writes
![Page 30: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/30.jpg)
Code generation: Scala Class
Normalize access to DB
Ensure proper indexes exist from start
![Page 31: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/31.jpg)
Automated Tests
Use the generated mock client
![Page 32: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/32.jpg)
Test Resource Operations
Use the generated mock clients to write simple tests
![Page 33: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/33.jpg)
Time to Deploy
![Page 34: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/34.jpg)
Continuous Delivery
“Continuous Delivery is a
prerequisite to managing micro
service architectures”
--@mbryzek
![Page 35: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/35.jpg)
Continuous Delivery
Deploy triggered by a git tag
Git tags created automatically by a change on master (e.g. merge PR)
100% automated, 100% reliable
![Page 36: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/36.jpg)
Continuous Delivery is Critical
https://github.com/flowcommerce/delta
![Page 37: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/37.jpg)
Auto Deploy on New Commit on Master
![Page 38: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/38.jpg)
Microservice Infrastructure – keep it simple
![Page 39: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/39.jpg)
Standard Health Checks
![Page 40: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/40.jpg)
Events
![Page 41: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/41.jpg)
“We have an amazing API, but
please subscribe to our event
streams instead.”
![Page 42: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/42.jpg)
Principles of an Event Interface
First class schema for all events
Producers guarantee at least once delivery
Consumers implement idempotency
Flow:
- End to end single event latency ~ 500 ms
- Based on postgresql – scaled to ~1B events / day / service
![Page 43: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/43.jpg)
Events: Approach
Producers:• Create a journal of ALL operations on table
• Record operation (insert, update, delete)
• On creation, queue the journal record to be published
• Real time, async, we publish 1 event per journal record
• Enable replay by simply requeuing journal record
![Page 44: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/44.jpg)
Events: Approach
Consumers:• Store new events in local database, partitioned for fast removal
• On event arrival, queue record to be consumed
• Process incoming events in micro batches (by default every 250ms)
• Record failures locally
![Page 45: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/45.jpg)
Events: Schema First
1 model / event
N events in one union type
1 union type / stream
Stream owned by 1 service
Most services define exactly 1 stream
![Page 46: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/46.jpg)
Events: Schema Linter
![Page 47: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/47.jpg)
Producers: Database Journal
Document retention period
Code generate journal
Use partitions to manage storage
https://github.com/gilt/db-journaling
![Page 48: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/48.jpg)
Producers: Streams
Reflection used to generate stream name
io.flow.v0.user_event.json
![Page 49: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/49.jpg)
Producing an Event
Note the UserVersion class which is also code generated.
Guarantees that all code in all services looks the same.
![Page 50: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/50.jpg)
Producers: Testing
![Page 51: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/51.jpg)
Consumers: Processing Incoming Events
![Page 52: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/52.jpg)
Consumers: Testing
Factories classes generated from the API Spec
![Page 53: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/53.jpg)
Dependencies
Keeping things up to date
![Page 54: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/54.jpg)
Dependencies
Goal: Automatically update all services to latest dependencies• Critical for security patches / bug fixes in core libraries
• Takes hours (not weeks or months)
• Same process for internally developed libraries and open source
• Flow: we upgrade all services every week to latest dependencies
![Page 55: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/55.jpg)
Dependencies: Tracking
https://dependency.flow.io/
https://github.com/flowcommerce/dependency
![Page 56: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/56.jpg)
Dependencies: Updating
![Page 57: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/57.jpg)
Dependencies & Continuous Delivery
Deploy Once the Build Passes
![Page 58: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/58.jpg)
Summary: Critical Decisions
Design schema first for all APIs and Events– consume events (not API) by default
Invest in automation – deployment, code generation, dependency management
Enable teams to write amazing and simple tests– drives quality, streamlines maintenance, enables continuous delivery
![Page 59: Design Micro Service Architectures the Right Way...Design Micro Service Architectures the Right Way Michael Bryzek mike@flow.io/ @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO GiltHow](https://reader036.vdocuments.mx/reader036/viewer/2022070718/5ede2170ad6a402d66696bdc/html5/thumbnails/59.jpg)
Thank You!Go forth and Design Micro Service Architectures the Right Way
Michael [email protected] / @mbryzek
Cofounder / CTO Flow
Cofounder / ex-CTO Gilt
We’re hiring: https://www.flow.io/careers