12
Microservice experiences in 7 minutes 8 questions and our answers to microservices in a 100mio revenue eCommerce business 1 Contact: [email protected]

Lightening Talk @Symfony Conference 2016

Embed Size (px)

Citation preview

Page 1: Lightening Talk @Symfony Conference 2016

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

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

33

Page 4: Lightening Talk @Symfony Conference 2016

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

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

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

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

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

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

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

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

Page 12: Lightening Talk @Symfony Conference 2016

Thank you for your attention!

Contact: [email protected]

12