Communication Methods and Protocols Between Microservices on a Public Cloud Platform

Loading...
Thumbnail Image

URL

Journal Title

Journal ISSN

Volume Title

Perustieteiden korkeakoulu | Master's thesis

Date

2021-06-14

Department

Major/Subject

Computer Science

Mcode

SCI3042

Degree programme

Master’s Programme in Computer, Communication and Information Sciences

Language

en

Pages

57+1

Series

Abstract

Microservices are a modern architectural paradigm that is in wide use for a variety of use cases. They aim to compose the functionality of a system from a set of small and highly independent services, or microservices. The realization of the overall functionality requires communication between these services, which makes the communication a crucial piece of the overall design and architecture. Public cloud platforms are a common modern choice to build systems on. In addition to easy on-demand access to computational resources, they also offer managed services that make it easy to get production-grade systems up and running. Choosing a correct method of communication to fit a use case and requirements is important for an architecture to reach its goals. If asynchronous communication is required, using an existing managed service for it can enable a team to focus on the business logic rather than infrastructural tasks. Therefore the goals of this thesis are to research what strengths do different communication protocols, methods and paradigms have, and what kind of managed asynchronous communication services can be found on a modern public cloud platform. When comparing monolith to microservices it is seen that microservices are not a silver bullet and a monolith application can be a valid solution in many cases. Microservices enable organizational and development scaling, but also introduces a wide variety of new issues to solve such as monitoring and fault-tolerance. Synchronous communication is easier and more intuitive to implement. REST over HTTP is ubiquitous and easy to integrate to. GRPC on the other hand offers type-safety, streaming of input and output, and a size-efficient binary wire format. Asynchronous communication often involves more complexity and a dedicated broker service. Pub/sub can be used for general fan-out messages, while message queues are useful for load-balancing consumers. Event streaming platforms offer persisting and replaying of events, and very high scalability and throughput. Amazon Web Services offers managed services for pub/sub (SNS), message queue (SQS) and event streaming (MSK, Kinesis) communication methods. These can be combined with each other to enhance functionality, such as using an SQS queue to load-balance a consumer group for an SNS topic.

Mikropalvelut ovat nykyaikainen arkkitehtuurinen paradigma, joka on laajasti käytössä erilaisissa käyttötapauksissa. Sen ideana on muodostaa järjestelmän kokonais- toiminnallisuus monen pienen ja itsenäisen palvelun, eli mikropalveluiden, kautta. Kokonaistoiminnallisuuden toteuttaminen vaatii kommunikaatiota näiden palveluiden välillä, joka tekee siitä kriittisen aspektin kokonaissuunnittelussa ja arkkitehtuurissa. Julkiset pilvialustat tarjoavat muun muassa hallinnoituja palveluita, jotka mahdollistavat tuotantojärjestelmien nopean pystytyksen. Oikean kommunikaatiotavan valinta käyttökohteen ja vaatimusten perusteella on tärkeää arkkitehtuurin onnistumisen suhteen. Tämän diplomityön tavoitteena on tutkia mitä erilaisia vahvuuksia kommunikaatiotavoilla ja protokollilla on, ja mitä hallinnoituja asynkronisen kommunikaation palveluita on saatavilla nykyaikaisella julkisella pilvialustalla. Verrattaessa monoliittia mikropalveluihin voidaan nähdä, että mikropalvelut eivät ole mikään ihmelääke ja monoliittinen sovellus saattaa olla paras ratkaisu monessa tapauksessa. Mikropalvelut mahdollistavat organisaation ja kehitystyön skaalautuvuutta, mutta myös tuovat uuden kokoelman haasteita ratkottavaksi, kuten monitoroinnin ja vikasietoisuuden. Synkroninen kommunikaatio on helpompaa ja intuitiivisempaa toteuttaa. REST HTTP:n yli on laajasti käytössä ja helposti integroituvissa. GRPC sen sijaan tarjoaa tyyppiturvallisuutta, syötteen ja tulosten striimausta, ja tilallisesti tehokkaan binäärisen siirtoformaatin. Asynkroninen kommunikaatio vaatii usein suurempaa monimutkaisuutta järjestelmältä, ja erillisen välityspalvelun. Pub/sub voi olla hyödyllinen yleisille fan-out toimitettaville viesteille. Viestijonot voivat olla hyödyllisiä tasatessa kuluttajapalveluiden ryhmää. Tapahtumastriimausalustat tarjoavat tapahtumien tallentamista ja myöhemmin uudelleen kuluttamista, sekä erittäin suurta skaalautuvuutta. Amazon Web Services tarjoaa hallinnoituja palveluita pub/sub (SNS), viestijono (SQS) ja tapahtumastriimaus (MSK, Kinesis) tarpeisiin. Palveluita voi myös yhdistellä toistensa kanssa, esimerkiksi käyttämällä SQS-jonoa tasoittamaan kuormaa SNS-otsikon kuluttajaryhmän instanssien välillä.

Description

Supervisor

Siekkinen, Matti

Thesis advisor

Siekkinen, Matti

Keywords

microservices architecture, synchronous communication, asynchronous communication, Amazon Web Services

Other note

Citation