Download - Lightening Talk @Symfony Conference 2016
![Page 1: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/1.jpg)
Microservice experiences in 7 minutes8 questions and our answers to microservices in a 100mio revenue eCommerce business
1
Contact: [email protected]
![Page 2: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/2.jpg)
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
![Page 3: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/3.jpg)
33
![Page 4: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/4.jpg)
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
![Page 5: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/5.jpg)
5
2. Micro vs. Macro? Our architecture
5
Routing/rendering
S1
S5
S2
S6
S4
S7
S9
S3
S8
![Page 6: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/6.jpg)
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
![Page 7: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/7.jpg)
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?
![Page 8: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/8.jpg)
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
![Page 9: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/9.jpg)
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
![Page 10: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/10.jpg)
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
![Page 11: Lightening Talk @Symfony Conference 2016](https://reader031.vdocument.in/reader031/viewer/2022030305/5870809f1a28ab57368b6491/html5/thumbnails/11.jpg)
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