TRANSITION FROM MONOLITH TO MICROSERVICES: A DREAM OR A TESTERS - - PowerPoint PPT Presentation

transition from monolith to microservices a dream or a
SMART_READER_LITE
LIVE PREVIEW

TRANSITION FROM MONOLITH TO MICROSERVICES: A DREAM OR A TESTERS - - PowerPoint PPT Presentation

NW SOFTW ARE QUALITY CIFIC CONFERENCE A P TRANSITION FROM MONOLITH TO MICROSERVICES: A DREAM OR A TESTERS NIGHTMARE? Natalja Pletneva, Okko. DATE: OCTOBER 14 PNSQC 1 NW SOFTW ARE QUALITY CIFIC CONFERENCE A P WHO AM


slide-1
SLIDE 1
  • 1

TRANSITION FROM MONOLITH TO MICROSERVICES: A DREAM OR A TESTER’S NIGHTMARE?

Natalja Pletneva, Okko.

DATE: OCTOBER 14

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-2
SLIDE 2
  • 2
  • I got a Master's degree in Telecommunication.
  • In testing since 2015.
  • Work with Okko.tv in Saint-Petersburg.
  • Started testing manually.
  • Backend testing.

WHO AM I?

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

PNSQC™

slide-3
SLIDE 3
  • 3

Okko — media-services provider:

  • Service for watching TV episodes and movies on your devices.
  • Online or stream right to your:
  • SmartTV, PlayStation 3, 4/4 PRO, Xbox;
  • AndroidTV, Nvidia Shield;
  • AppleTV;
  • iPhone/Android Phone;
  • Web site okko.tv.
  • Okko is available in Russia.

WHAT IS OKKO?

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-4
SLIDE 4
  • 4

The English Premier League

  • nly at Okko.Sport in Russia.

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-5
SLIDE 5
  • 5

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-6
SLIDE 6
  • 6
  • The main problems with changing in testing process.
  • Reappraisal of microservices testing approaches.
  • Transition period.
  • The main opportunities that arise when testing microservices.
  • The main profit of the transition from the monolith to microservices.

TODAY’S OUTLINE

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-7
SLIDE 7
  • 7
  • The client part (User Interface).
  • The server part (Business Logic

Layer and Data Access Layer).

  • Database.

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

MONOLITHIC ARCHITECTURE

P A CIFIC NW

slide-8
SLIDE 8
  • 8

Benefits of Monolithic Architecture

In the early stages of the project without any complicated business logic:

  • Simple to develop.
  • Simple to deploy.
  • Simple to test.
  • Simple to scale horizontally by running multiple copies behind a load

balancer.

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

MONOLITHIC ARCHITECTURE

slide-9
SLIDE 9
  • 9

Benefits of Monolithic Architecture

  • It was simple to maintain the

monolith - few users

  • At the beginning we were

in the dark ages, and no

  • ne wanted to pay for

movies, pirates were everywhere

  • More pirates - less paying

users - less DB.

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

MONOLITHIC ARCHITECTURE

slide-10
SLIDE 10
  • 10

Why not a monolith?

  • Increase written code.
  • Limitation in size and complexity.
  • Barrier to adopting new technologies.
  • Single point of failure.
  • Scalability (less pirates - more paying users).
  • Any changes require redeploy

the entire application.

MONOLITHIC ARCHITECTURE

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-11
SLIDE 11
  • 11

MONOLITHIC ARCHITECTURE

  • Difficulty getting test data.
  • The load can affect the whole environment.
  • Difficulty Testing the API.
  • Bug analysis problematic.
  • Full testing before release.
  • Any changes require re-testing the entire monolith.
  • Autotest coverage ~ 25%.

Monolith testing

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

PNSQC™

  • 11
slide-12
SLIDE 12
  • 12

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

DIFFICULTY GETTING TEST DATA

P A CIFIC NW

List of tags (part). Be careful, everyone can be tagged.😉

slide-13
SLIDE 13
  • 13

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

EXAMPLES OF THE SAME APPLICATION SCREENS DEPENDING ON SET OF TAGS

Free movie preview tag = true.

P A CIFIC NW

slide-14
SLIDE 14
  • 14

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

EXAMPLES OF THE SAME APPLICATION SCREENS DEPENDING ON SET OF TAGS

Free movie preview tag = false.

P A CIFIC NW

slide-15
SLIDE 15
  • 15

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

EXAMPLE OF THE SAME START SCREENS DEPENDING ON SET OF TAGS

P A CIFIC NW

slide-16
SLIDE 16
  • 16

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

EXAMPLE OF THE SAME START SCREENS DEPENDING ON SET OF TAGS

P A CIFIC NW

slide-17
SLIDE 17
  • 17

What we need for test:

  • Adapt tags to the user:
  • Create/ Delete
  • Re-login into the app for activation tags.
  • Prepare platform data depending on the device.
  • The current state of the user (user context story).
  • Prepare another data for tests.

DIFFICULTY GETTING TEST DATA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-18
SLIDE 18
  • 18

DIFFICULTY GETTING TEST DATA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

SAY TEST SCRIPTS 1 MORE TIME

I DARE YOU

  • Regular copy DB from the

production env for data flexibility.

  • Change content rights and prices
  • almost all new movies get

subscription rights over time.

slide-19
SLIDE 19
  • 19

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

  • ARCHITECTURE ‘BEFORE’

P A CIFIC NW

  • MONOLITH
slide-20
SLIDE 20
  • 20

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

  • ARCHITECTURE ‘AFTER'

DON’T ZOOM

P A CIFIC NW

slide-21
SLIDE 21
  • 21

Why microservices?

  • Less code for one service.
  • Implementation independence.
  • No single point of failure.
  • Independent deployment.
  • Independent testing.
  • Scalable at every level when needed.

MICROSERVICES ARCHITECTURE

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-22
SLIDE 22

TRANSITION

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

User tag. Tag in ClientFilter. Client Filter flags.

  • 22

Microservices user.

slide-23
SLIDE 23
  • 23
  • A set of functionally complete services.
  • Interaction between services either

synchronously via HTTP / HTTPS or asynchronously through a message manager

  • Mixed Type Architecture
  • Standard messaging interface.

MICROSERVICES TESTING

What do we get for testing finally?

Testing department.

P A CIFIC NW

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

slide-24
SLIDE 24

EXPECTATION

  • 24

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-25
SLIDE 25
  • 25

EXPECTATION

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-26
SLIDE 26
slide-27
SLIDE 27
  • 27

REALITY

  • 1. «It is faster».
  • 2. «It is easier».
  • 3. «Microservices are better for testing».

Illusions of Microservices Boom

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-28
SLIDE 28
  • 28

The Illusion «It is faster»:

  • Separate functional testing - more coverage and less pain.
  • Integration testing of properly working microservices also reduces complexity.
  • Monitoring and debugging.
  • Added testing in production.

MICROSERVICES TESTING

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-29
SLIDE 29
  • 29

THE PROBLEM OF COLLECTING LOGS IN ONE PLACE.

Problems:

  • You have to remember all

interactions.

  • It is difficult to find a problem

in such distributed scenarios.

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

Sample scenario: movie purchase.

slide-30
SLIDE 30
  • 30

JAEGER MONITORING

Solution: Jaeger OpenTracing:

  • HTTP
  • RabbitMQ
  • DB

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-31
SLIDE 31
  • 31

KIBANA

  • Log virtualization.
  • Client / Server.
  • Acceptable search
  • Filtration
  • Index Search
  • Charts, patterns for search,

dashboards.

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-32
SLIDE 32

MICROSERVICES TESTING

The Illusion «It is easier»:

  • Monolith + microservices.
  • What about getting data?
  • Separate microservice with tags and filters
  • Separate microservice with catalog data

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

  • 32
slide-33
SLIDE 33

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

PNSQC™

  • 33

The Illusion «It is easier»:

Postman Collection.

MICROSERVICES TESTING

  • Easy to use.
  • Little setup needed.
  • Leightweighted JSON definition.
  • Run tests using the JavaScript.
slide-34
SLIDE 34

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

PNSQC™

  • 34

The Illusion «It is easier»:

MICROSERVICES TESTING

Swagger 🎊

  • Part of the methods include

a session ID, it helps to identify user and device (this information is also needed to select proper data filter)

  • All requests of these

methods should have special HTTP header which contains method signature

slide-35
SLIDE 35

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

PNSQC™

  • 35

The Illusion «It is easier»:

MICROSERVICES TESTING

  • Put out the server.
  • Increased the response time.
  • Put out the messenger.
  • Ran the high load.
  • Blocked network traffic.
slide-36
SLIDE 36
  • 36
  • Chelsea vs Liverpool
  • Retry storm:
  • API gateway, which proxies

microservices and fragment of a monolith, suffered from monolith errors on the background of mass retrays.

THE GUARDIAN. MICROSERVICES TESTING

slide-37
SLIDE 37
  • 37

The Illusion «Microservices are better for testing»:

AS A CONCLUSION

  • pros
  • Testing has become clearer.
  • Freedom to do load tests.
  • Getting test data.
  • Organization and structuring of testing processes.
  • Automated tests.
  • PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

slide-38
SLIDE 38
  • 38

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

  • Python
  • Pytest (+ Allure Reports)
  • Locust (Redis + Grafana/Zabbix)
  • Postman
  • Autotests coverage
  • 25 % monolith vs 80% microservices

Sample of Allure Report. AS A CONCLUSION

slide-39
SLIDE 39
  • 39

PNSQC™

SOFTW ARE

QUALITY

CONFERENCE

P A CIFIC NW

  • cons
  • Constant synchronization with

the team.

  • Monitoring and storage of logs

→ but you will find a problem faster.

  • It was worth it, or it wasn't.

AS A CONCLUSION

slide-40
SLIDE 40
  • 40

THANK YOU!

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-41
SLIDE 41
  • 41
  • We have our own CDN for movies that can serve about 40000

simultaneous FHD views. In addition we have 2 connected CDNs each can serve more than 200K views.

  • For live events we have 3 CDNs connected
  • So we believe that together they can serve about 1M simultaneous

views

  • Login requests in the app per month 30m
  • Paying users 100+ ths

EXTRA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

LOAD AND DB

slide-42
SLIDE 42
  • 42
  • All connections are only through https.
  • Billing information is protected by external banking companies.
  • Monitoring of suspicious attacks on balancers.
  • We do not keep any personal information of users, encrypted data.

EXTRA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

Security:

slide-43
SLIDE 43
  • 43
  • Movie - from $3 to $7
  • Subscription - from $7 to $12 per month
  • Impact on users after the transition - minimal
  • Our competitors:
  • There are 4 major companies in this market
  • Including Netflix(but this service is not so popular in Russia)

EXTRA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW

slide-44
SLIDE 44
  • 44
  • 30% - monolith, 70% - microservices
  • Autotest coverage - 80%
  • Split all microservices between testing department (4-6 services for 1

employee)

  • Documentation we use:
  • Jira
  • Confluence
  • TestPad
  • Kubernetes - next step(?)

EXTRA

SOFTW ARE

QUALITY

CONFERENCE

PNSQC™

P A CIFIC NW