How to save money by scaling a system using software and not hardware methods
Problem
The performance of systems, especially those implemented long ago, can be critically degraded.

Prerequisites:
  • The increase of the number of requests
  • The traffic growth with the increase of requests/services
  • The increase of the number of computations (more processes/ reports/ it is necessary to crunch the larger volumes of data during search, etc.)
Ways of Solving
  • A simple way: we build a cluster of higher performance and buy additional hardware
  • Plusses: you should not bother with updating; the scalability issues are solved at the stage of designing a physical architecture
  • Minuses: specialized hardware is expensive. When DBMS is for payment you should buy an additional expensive license; the growth of load can be non-linear, then the cost of scaling will be very high
  • Software solution: building a microservice architecture. Each microservice will accept certain types of requests. Thus, we decrease the load and can use cheaper hardware. Further, it is necessary to solve the architecture issues: we need either a bus (pluses – it is possible to create infinitely many services; minus – we create another bottleneck or let the services transmit data (pluses – practically unlimited horizontal scalability; minuses – building an individual microservice will become more expensive)
  • Pluses: considerably save our money, scalability becomes possible including the cases of non-linear growth of load
  • Minuses: it is necessary to create a team for developing such solution
The results attained by one of the Projects
  • Rewritten 8 services, which provided biggest load
  • Overall load decreased for 25% (+/-5%)
  • Significantly increased throughput of components. For example, service for getting list of client’s accounts now handles 3000 rps instead of 500-1000.
  • No need of purchasing of new server
Technologies
  • Apache Kafka for data transportation
  • MongoDB for data storage
  • Java 11 + Spring for services development
  • Docker, Mesos/Marathon, HAProxy for deployment and load balancing