Microservice experiences in 7 minutes 8 questions and our answers to microservices in a 100mio revenue eCommerce business 1 Contact: [email protected]
Microservice experiences in 7 minutes8 questions and our answers to microservices in a 100mio revenue eCommerce business
1
Contact: [email protected]
2
1. What are major painpoints of microservices?
A microservice architecture is a distributed system.
2
There is:● an isolated vertical infrastructure for each service● no referential integrity across services● no “shared memory” across services● communication only via APIs
33
4
2. Micro vs. Macro?
rule of thumb: slice rather to large than to small
4
We sliced:business● Customer● Order● Payment● Checkout● Contentmanagement● Products/Search● Cart● Calculation● Search
infrastructure● Rendering/Routing● Logging● Authentification● E-Mails● Pricing● Stock
5
2. Micro vs. Macro? Our architecture
5
Routing/rendering
S1
S5
S2
S6
S4
S7
S9
S3
S8
6
3. Should I secure my service communication?
You must!
6
We use:- encrypted communication between services- token based authorization for services and users- role based access system for services and users
7
4. What should my services return?
In general: everything you want!
7
We return:● pure JSON
or● full rendered HTML wrapped in JSON with metainformation
(Status Codes, Messages, Redirects, …)
The question is: Who will merge everything together?
8
5. What about sessions?
Shared data in a distributed system?
8
Our approach:The session
● is managed by the Routing/Rendering service● is namespaced per service● is transmitted to a service in the header● can be updated by the service response
9
6. What about different service/api versions?
You will have different versions of services in production!You will probably have the same service in different versions in production!
9
Our approach:● services are versioned● APIs are versioned● API version can be selected via Header● APIs are documented via Swagger
10
7. What about scaling and performance?
The application must be built to be scalable!The infrastructure must be built to be scalable!
10
Our approach:● decided for docker (is a pain for developers on Mac)● one kubernetes cluster per system● running on a AWS infrastructure with terraform● definition of performance budgets for services
11
8. What else have we learned?
● You need a really good team
● Take time to think and discuss before
● Question whether a microservice architecture is really the way to go
11