Collecting Information from a Decentralized Microservice Architecture
Total Page:16
File Type:pdf, Size:1020Kb
Linköping University | IDA Bachelor Thesis | Computer Engineering Spring 2018 | LIU-IDA/LITH-EX-G--18/025—SE Collecting Information from a decentralized microservice architecture Carl Ekbjörn Daniel Sonesson Tutor, Jonas Wallgren Examiner, Lena Buffoni Upphovsrätt Detta dokument hålls tillgängligt på Internet – eller dess framtida ersättare – under 25 år från publiceringsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/. Copyright The publishers will keep this document online on the Internet – or its possible replacement – for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to download, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/. © Carl Ekbjörn, Daniel Sonesson Abstract As a system grows in size, it is common that it is transformed into a microservice architecture. In order to be able monitor this new architecture there is a need to collect information from the microservices. The software company IDA Infront is transitioning their product iipax to a microservice architecture and is faced with this problem. In order to solve this, they propose the use of a Message-oriented Middleware (MOM). There exists many different MOMs that are suitable to execute this task. The aim of this thesis is to determine, in terms of latency, throughput and scalability, which MOM is best suitable for this. Out of four suitable MOMs Apache Kafka and RabbitMQ are chosen for further testing and benchmarking. The tests display that RabbitMQ is able to send single infrequent messages (latency) faster than Kafka. But it is also shown that Kafka is faster at sending a lot of messages rapidly and with an increased number of producers sending messages (throughput and scalability). However, the scalability test suggests that RabbitMQ possibly scales better with a larger amount of microservices, thus more testing is needed to get a definite conclusion. iii iv Table of Contents Upphovsrätt ...................................................................................................................... ii Copyright .......................................................................................................................... ii 1. Introduction ........................................................................................................................... 7 2. Background............................................................................................................................ 9 2.1 iipax ............................................................................................................................. 9 2.2 iipax archive ................................................................................................................ 9 3. Theory .................................................................................................................................. 13 3.1 Messaging Protocols .................................................................................................. 13 3.1.1 AMQP ................................................................................................................ 13 3.2 Message-Oriented Middleware.................................................................................. 15 3.2.1 RabbitMQ........................................................................................................... 15 3.2.2 ActiveMQ ........................................................................................................... 16 3.2.3 Apache Qpid ...................................................................................................... 16 3.2.4 Apache Kafka ..................................................................................................... 16 3.3 Quality of service....................................................................................................... 17 3.3.1 Correctness ........................................................................................................ 17 3.3.2 Scalability .......................................................................................................... 18 3.3.3 Efficiency ........................................................................................................... 18 3.4 Microservices............................................................................................................. 18 3.4.1 Microservices in iipax ........................................................................................ 18 4. Method ................................................................................................................................. 21 4.1 Related work .............................................................................................................. 21 4.2 Analysis of MOMs .................................................................................................... 22 4.3 Benchmarking of MOMs ........................................................................................... 24 4.3.1 Latency ............................................................................................................... 24 4.3.2 Throughput......................................................................................................... 25 4.3.3 Scalability .......................................................................................................... 26 4.4 The Kafka Configuration ........................................................................................... 26 4.4.1 Kafka Producer .................................................................................................. 26 4.4.2 Kafka Consumer ................................................................................................ 26 4.5 The RabbitMQ Configuration ................................................................................... 27 4.5.1 RabbitMQ Producer .......................................................................................... 27 4.5.2 RabbitMQ Consumer ......................................................................................... 27 5. Results .................................................................................................................................. 29 5.1 Latency ...................................................................................................................... 29 5.2 Throughput ................................................................................................................ 29 5.2.1 Throughput Send Time ....................................................................................... 29 5.2.2 Throughput Receive Time .................................................................................. 30 5.2.2 Throughput Total Time ...................................................................................... 30 5.3 Scalability .................................................................................................................. 31 5.3.1 Scalability Send Time......................................................................................... 31 5.3.2 Scalability Receive Time .................................................................................... 32 5.3.3 Scalability Total Time ........................................................................................ 32 6. Discussion ............................................................................................................................. 35 6.1 Latency ...................................................................................................................... 35 6.2 Throughput ................................................................................................................ 35 6.3 Scalability .................................................................................................................