{"id":82379,"date":"2018-10-03T19:00:17","date_gmt":"2018-10-03T16:00:17","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=82379"},"modified":"2023-12-11T14:38:03","modified_gmt":"2023-12-11T12:38:03","slug":"microservices-java-developers-monoglot-polyglot","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html","title":{"rendered":"Microservices for Java Developers: Monoglot or Polyglot?"},"content":{"rendered":"<h2><a name=\"introduction\"><\/a>1. Introduction<\/h2>\n<p>Along the previous parts of the tutorial we have talked quite a lot about the benefits of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a>. It is essentially a loosely coupled distributed system which provides a particularly important ability to pick the right tool for the job. It could mean not just a different framework, protocol or library but a completely different programming language.<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#monoglot\">2. There is Only One<\/a><\/dt>\n<dt><a href=\"#polyglot\">3. Polyglot on the JVM<\/a><\/dt>\n<dt><a href=\"#zoo\">4. The Language Zoo<\/a><\/dt>\n<dt><a href=\"#reference\">5. Reference Application<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#customer\">5.1. Customer Service<\/a><\/dt>\n<dt><a href=\"#inventory\">5.2. Inventory Service<\/a><\/dt>\n<dt><a href=\"#payment\">5.3. Payment Service<\/a><\/dt>\n<dt><a href=\"#reservation\">5.4. Reservation Service<\/a><\/dt>\n<dt><a href=\"#gateway\">5.5. API Gateway<\/a><\/dt>\n<dt><a href=\"#bff\">5.6. BFF<\/a><\/dt>\n<dt><a href=\"#admin\">5.7. Admin Web Portal<\/a><\/dt>\n<dt><a href=\"#web\">5.8. Customer Web Portal<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#conclusions\">6. Conclusions<\/a><\/dt>\n<dt><a href=\"#next\">7. What\u2019s next<\/a><\/dt>\n<\/dl>\n<\/div>\n<p>In this part we are going to discuss the monoglot and polyglot <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a>, the value each choice brings to the table and hopefully come up with the rational conclusions to help you make the decisions. Also, we will present the architecture of the reference application we are about to start developing. Its main purpose is to serve as the playground for numerous further topics we are going to look at.<\/p>\n<h2><a name=\"monoglot\"><\/a>2. There is Only One<\/h2>\n<p>Over the years many organizations have accumulated tremendous expertise around one particular programming language and its ecosystem, like for example Java, the subject of our tutorial. They have skilled developers, proven record of successful projects, in-depth knowledge of certain libraries and frameworks including the deep understanding of their quirks and peculiarities. Should all of that be thrown away in order to adopt the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a>? Is this knowledge even relevant or useful?<\/p>\n<p>Those are very hard questions to answer since many organizations get stuck with very old software stacks. Making such legacy systems fit the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a> may sound quite impractical. However, if you have been lucky enough to bet on the frameworks and libraries we have discussed <a href=\"https:\/\/www.javacodegeeks.com\/2018\/09\/microservices-java-developers-java-jvm-landscape.html\">in the previous part of the tutorial<\/a>, you are pretty much well positioned. You may certainly look around for better, modern options but starting with something you already know and familiar with is a safe bet. And frankly speaking, things do evolve over time, you may never feel the need to get off the Java train or your favorite set of frameworks and libraries.<\/p>\n<p>There is nothing wrong with staying monoglot and building your <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> all the way on Java. But there is a trap where many adopters may fall into: very tight coupling between different services which eventually ends up with a birth of the <a href=\"https:\/\/www.infoq.com\/news\/2016\/02\/services-distributed-monolith\">distributed monolith<\/a>. It stems from the decisions to take a shortcuts and share Java-specific artifacts (known as <a href=\"https:\/\/en.wikipedia.org\/wiki\/JAR_(file_format)\">JAR<\/a>s) instead of relying on more generic, language-agnostic contracts and schemas.<\/p>\n<p>Even if you prefer to stay monoglot, please think polyglot!<\/p>\n<h2><a name=\"polyglot\"><\/a>3. Polyglot on the JVM<\/h2>\n<p>Beside just Java, there are many other languages which natively run on JVM, like for example <a href=\"https:\/\/www.scala-lang.org\/\">Scala<\/a>, <a href=\"https:\/\/kotlinlang.org\/\">Kotlin<\/a>, <a href=\"https:\/\/clojure.org\/\">Clojure<\/a>, <a href=\"http:\/\/groovy-lang.org\/\">Groovy<\/a>, <a href=\"https:\/\/ceylon-lang.org\/\">Ceylon<\/a> to mention a few. Most of them have an excellent level of the interoperability with the code written in the plain old Java so it is really easy to take the polyglot <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> route staying entirely on JVM platform. Nonetheless, since everything is still packaged and distributed in <a href=\"https:\/\/en.wikipedia.org\/wiki\/JAR_(file_format)\">JAR<\/a>s, the danger to build the <a href=\"https:\/\/www.infoq.com\/news\/2016\/02\/services-distributed-monolith\">distributed monolith<\/a> remains very real.<\/p>\n<p>While touching upon development of the polyglot applications on the JVM, it is unforgivable not to mention the cutting edge technology which came out of <a href=\"https:\/\/labs.oracle.com\/pls\/apex\/f?p=labs\">Oracle Labs<\/a> and is bearing the name <a href=\"https:\/\/www.graalvm.org\/\">GraalVM<\/a>.<\/p>\n<blockquote>\n<p><a href=\"https:\/\/www.graalvm.org\/\"><em>GraalVM<\/em><\/a><em> is a universal virtual machine for running applications written in JavaScript, Python 3, Ruby, R, JVM-based languages like Java, <\/em><a href=\"https:\/\/www.scala-lang.org\/\"><em>Scala<\/em><\/a><em>, <\/em><a href=\"https:\/\/kotlinlang.org\/\"><em>Kotlin<\/em><\/a><em>, and LLVM-based languages such as C and C++. <\/em><a href=\"https:\/\/www.graalvm.org\/\"><em>GraalVM<\/em><\/a><em> removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of <\/em><a href=\"http:\/\/openjdk.java.net\/\"><em>OpenJDK<\/em><\/a><em>, <\/em><a href=\"https:\/\/nodejs.org\/\"><em>Node.js<\/em><\/a><em>, Oracle Database, or MySQL. &#8211; <\/em><a href=\"https:\/\/www.graalvm.org\/\"><em>https:\/\/www.graalvm.org\/<\/em><\/a><\/p>\n<\/blockquote>\n<p>In the spirit of the true innovation, the <a href=\"https:\/\/www.graalvm.org\/\">GraalVM<\/a> opens whole new horizons for the JVM platform. It is not ready for production use yet (still in the release candidate phase as of today) but it has all the potential to revolutionize the way we are building the applications on the JVM, especially the polyglot ones.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2><a name=\"zoo\"><\/a>4. The Language Zoo<\/h2>\n<p>In the industry driven by hype and unrealistic promises, the new shiny things appear all the time and the developers are eager to use them right away in production. And indeed, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a> enables us to make such choices regarding the best language or\/and framework to solve the business (or even technical) problems in a most efficient manner (but certainly does not mandate doing that).<\/p>\n<p>In the same vein of promoting responsibility and ownership it looks logical to let the individual teams make the technological decisions. The truth is though in reality it is quite expensive to deal with the zoo of different languages and frameworks. That is why if you look around, you will see that most of the industry leaders bet on 2-3 primary programming languages, an important observation to keep in mind while evolving your <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> implementations.<\/p>\n<h2><a name=\"reference\"><\/a>5. Reference Application<\/h2>\n<p>To shift our discussions from the theory to practice, we are going to introduce the reference project we are about to start working on. Unsurprisingly, it is going to be built following the guiding principles of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a>. Since our tutorial is Java-oriented, most of our components will be written in this language but it is very important to see the big picture and realize that Java is not the only one. So let us roll up the sleeves and start building the polyglot <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a>!<\/p>\n<p>Our reference project is called <strong>JCG Car Rentals<\/strong>: a simplistic (but realistic!) application to provide car rental services to the various customers. There are several goals and objectives it pursues:<\/p>\n<ul>\n<li>Demonstrate the benefits of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a><\/li>\n<li>Showcase how the various technology stacks (languages and frameworks) integrate with each other to compose a cohesive living platform<\/li>\n<li>Introduce the best practices, emerging techniques and tools for every aspect of the project lifecycle, ranging from development to operation in production<\/li>\n<li>And, hopefully, conclude that developing complex, heterogeneous distributed systems (which <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> are) is really difficult and challenging journey, full of tradeoffs<\/li>\n<\/ul>\n<p>The <strong>JCG Car Rentals<\/strong> is quite far from the modern large-scale systems with hundreds of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> deployed in production. However even an application as simple as that posses many questions and problems. Let us take a look on the <strong>JCG Car Rentals<\/strong> architecture diagram below.<\/p>\n<p><figure id=\"attachment_82395\" aria-describedby=\"caption-attachment-82395\" style=\"width: 731px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/10\/jcg-car-rentals-jcg-1.png\"><img decoding=\"async\" class=\"wp-image-82395 size-full\" title=\"JCG Car Rentals Microservice Architecture\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/10\/jcg-car-rentals-jcg-1.png\" alt=\"Monoglot or Polyglot - JCG Car Rentals Microservice Architecture\" width=\"731\" height=\"351\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/10\/jcg-car-rentals-jcg-1.png 731w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/10\/jcg-car-rentals-jcg-1-300x144.png 300w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/a><figcaption id=\"caption-attachment-82395\" class=\"wp-caption-text\">JCG Car Rentals Microservice Architecture<\/figcaption><\/figure><\/p>\n<p>You may notice that there are quite a few contractions to some principles we have talked before. For example, each service uses own programming language or\/and framework, the same happens to apply for frontends as well. Isn\u2019t it the <a href=\"#zoo\">language zoo<\/a> we have been cautiously warned before? Yes, indeed, we have deliberately weakened some of the criteria in order to cover larger set of topics and interoperability scenarios. Please do not adopt this architecture as the blueprint for your applications but focus on the parts which work best for you.<\/p>\n<p>With that, it would be useful to go over each box we have drawn and briefly explain the reasoning behind the choices we have made.<\/p>\n<h3><a name=\"customer\"><\/a>5.1. Customer Service<\/h3>\n<p>The responsibility of the customer service would be to manage the personal data of the <strong>JCG Car Rentals <\/strong>customers. This service has no upstream dependencies and we are going to implement it in Java as the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer\">RESTful web API<\/a>, using one of the <a href=\"https:\/\/jcp.org\/en\/jsr\/detail?id=370\">JAX-RS<\/a> implementations (to be precise, we are going to rely on <a href=\"http:\/\/cxf.apache.org\/\">Apache CXF<\/a> framework).<\/p>\n<p><strong>Why: &nbsp;<\/strong>objectively, <a href=\"https:\/\/jcp.org\/en\/jsr\/detail?id=370\">JAX-RS<\/a> is a number one choice in the world of enterprise Java. The <a href=\"http:\/\/cxf.apache.org\/\">Apache CXF<\/a> is not only <a href=\"https:\/\/jcp.org\/en\/jsr\/detail?id=370\">JAX-RS<\/a> compliant but provides a lot of additional must-have features for building successful <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architectures<\/a>.<\/p>\n<h3><a name=\"inventory\"><\/a>5.2. Inventory Service<\/h3>\n<p>The inventory service is going to be an authoritative source of the cars and quantities available in the stock for rentals. It is also has no upstream dependencies and our implementation choice for it is going to be <a href=\"https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer\">RESTful web service<\/a> built on top of <a href=\"https:\/\/www.scala-lang.org\/\">Scala<\/a> and <a href=\"https:\/\/akka.io\/akka-http\/\">Akka HTTP<\/a>.<\/p>\n<p><strong>Why: <\/strong><a href=\"https:\/\/akka.io\/akka-http\/\">Akka HTTP<\/a> has proven to be an outstanding framework for implementing <a href=\"https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer\">RESTful web services<\/a> on JVM. Although it has Java <a href=\"https:\/\/en.wikipedia.org\/wiki\/Domain-specific_language\">DSL<\/a>, the usage of <a href=\"https:\/\/www.scala-lang.org\/\">Scala<\/a> in the first place gives the most out of it.<\/p>\n<h3><a name=\"payment\"><\/a>5.3. Payment Service<\/h3>\n<p>The payment service would handle all the customer\u2019s charges for the services provided by <strong>JCG Car Rentals<\/strong>. We are picking a completely different technology stack here by building this service in <a href=\"https:\/\/golang.org\/\">Go<\/a> and using <a href=\"https:\/\/grpc.io\/\">gRPC<\/a> protocol over <a href=\"https:\/\/en.wikipedia.org\/wiki\/HTTP\/2\">HTTP\/2<\/a> to communicate with it. This is an example of the purely internal service which we may not want to expose externally.<\/p>\n<p><strong>Why: &nbsp;<\/strong><a href=\"https:\/\/grpc.io\/\">gRPC<\/a> has proven to be an efficient and an effective protocol for service to service communication. On the other side, <a href=\"https:\/\/golang.org\/\">Go<\/a> is tremendously popular and has outstanding support of the <a href=\"https:\/\/grpc.io\/\">gRPC<\/a>.<\/p>\n<h3><a name=\"reservation\"><\/a>5.4. Reservation Service<\/h3>\n<p>The reservation service is the core of the <strong>JCG Car Rentals<\/strong> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a>. It is solely dedicated to manage the car reservations and depends on <a href=\"#_Payment_Service\">payment service<\/a>, <a href=\"#_Customer_Service\">customer service<\/a> and <a href=\"#_Inventory_Service\">inventory service<\/a>. Since it is most critical and important piece, we are going to implement it as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer\">RESTful web APIs<\/a> using <a href=\"https:\/\/spring.io\/projects\/spring-boot\">Spring Boot<\/a> and <a href=\"https:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/web-reactive.html\">Spring WebFlux<\/a>.<\/p>\n<p><strong>Why: <\/strong><a href=\"https:\/\/spring.io\/projects\/spring-boot\">Spring Boot<\/a>, and more generally <a href=\"https:\/\/spring.io\/\">Spring Platform<\/a>, absolutely dominates the Java ecosystem. Built on proven foundation of <a href=\"https:\/\/spring.io\/projects\/spring-framework\">Spring Framework<\/a>, it offers exceptional productivity, smart configuration capabilities and seamless integrations with most popular libraries and frameworks. The choice of <a href=\"https:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/web-reactive.html\">Spring WebFlux<\/a> (versus traditional <a href=\"https:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/web.html\">Spring Web MVC<\/a>) may not be so obvious at first but hopefully the next part of the tutorial is going to clarify that.<\/p>\n<h3><a name=\"gateway\"><\/a>5.5. API Gateway<\/h3>\n<p>The <a href=\"https:\/\/microservices.io\/patterns\/apigateway.html\">API gateways<\/a> secured their firm place in the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a> since the early days. It turns out that exposing all (or most) of your services to be publicly accessible is in fact easy but not a very good idea. We are going to talk about <a href=\"https:\/\/microservices.io\/patterns\/apigateway.html\">API gateways<\/a> in great details later on in the tutorial but just to highlight a few key issues they help to address:<\/p>\n<ul>\n<li><strong>discoverability<\/strong>: the consumers do not need to know where the upstream dependencies live (for example hosts and ports)<\/li>\n<li><strong>partitioning<\/strong>: the consumers do not need to know what are the exact services application constitutes of since the architecture may change over time<\/li>\n<li><strong>unified protocol<\/strong>: the consumers do not need to worry about all kinds of different protocols each service speaks<\/li>\n<li><strong>client<\/strong> <strong>friendliness<\/strong>: different clients may need to shape data differently<\/li>\n<\/ul>\n<p>Our choices here are going to vary over time. We will start with <a href=\"https:\/\/github.com\/Netflix\/zuul\">Zuul<\/a>, the Java-based gateway service from <a href=\"https:\/\/netflix.github.io\/\">Netflix<\/a>, and slowly take it from there.<\/p>\n<p><strong>Why: <\/strong><a href=\"https:\/\/netflix.github.io\/\">Netflix<\/a> run <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> at massive scale. <a href=\"https:\/\/github.com\/Netflix\/zuul\">Zuul<\/a> (or more precisely <a href=\"https:\/\/github.com\/netflix\/zuul\/\">Zuul 2<\/a>) incorporates the invaluable experience of how the gateway service should operate.<\/p>\n<h3><a name=\"bff\"><\/a>5.6. BFF<\/h3>\n<p>The <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">backend for frontend<\/a> (or just <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">BFF<\/a>) came into the view not so long ago as an alternative to general-purpose <a href=\"https:\/\/microservices.io\/patterns\/apigateway.html\">API gateways<\/a>. In short, each frontend is unique. At some point it became clear that the demands of the mobile frontends are quite different from let say a full-fledged desktop ones. To address this disparity, the <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">BFF<\/a> basic promise is to provide the outstanding support for one particular frontend, hence the name &#8211; <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">backend for frontend<\/a>.<\/p>\n<p>There are quite a few frameworks to help us develop efficient <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">BFF<\/a>s but arguably the possibilities which are provided by <a href=\"https:\/\/graphql.org\/\">GraphQL<\/a> make the latter a particularly appealing foundation to build <a href=\"https:\/\/samnewman.io\/patterns\/architectural\/bff\/\">BFF<\/a>s upon. And who can do the job better than <a href=\"https:\/\/www.apollographql.com\/\">Apollo<\/a> platform.<\/p>\n<p><strong>Why: <\/strong><a href=\"https:\/\/www.apollographql.com\/\">Apollo<\/a> platform is the bleeding edge of the <a href=\"https:\/\/graphql.org\/\">GraphQL<\/a> ecosystem. It is significantly more advanced and feature-rich than the <a href=\"https:\/\/www.javacodegeeks.com\/2018\/09\/microservices-java-developers-java-jvm-landscape.html#graphql\">JVM alternatives we have looked before<\/a>.<br \/>\n[ulp id=&#8217;DdINgEqoOovgkhhk&#8217;]<br \/>\n&nbsp;<\/p>\n<h3><a name=\"admin\"><\/a>5.7. Admin Web Portal<\/h3>\n<p>The admin web portal is the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Front_and_back_office_application\">back-office<\/a> for <strong>JCG Car Rentals <\/strong>platform. It will expose the ability to perform certain administrative functions, including the ones needed for customer support. Since this is an internal component, we are going to build it in <a href=\"https:\/\/www.scala-lang.org\/\">Scala<\/a> using <a href=\"https:\/\/www.playframework.com\/\">Play Framework<\/a>.<\/p>\n<p><strong>Why: <\/strong>quite often the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Front_and_back_office_application\">back-office<\/a> applications fall in hands of backend developers. The <a href=\"https:\/\/www.playframework.com\/\">Play Framework<\/a>, backed by <a href=\"https:\/\/www.scala-lang.org\/\">Scala<\/a>, is truly a hyper productive choice for them.<\/p>\n<h3><a name=\"web\"><\/a>5.8. Customer Web Portal<\/h3>\n<p>The customer web portal is the public entry point into <strong>JCG Car Rentals<\/strong> application. This is the place we expect people to search for deals and make the reservations, all that powered by handful of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a>. It is going to be developed using <a href=\"https:\/\/en.wikipedia.org\/wiki\/JavaScript\">JavaScript<\/a> and <a href=\"https:\/\/vuejs.org\/\">Vue.js<\/a>.<\/p>\n<p><strong>Why: <\/strong>this is a typical frontend stack for modern, single-page web applications (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Single-page_application\">SPA<\/a>). The preference to <a href=\"https:\/\/vuejs.org\/\">Vue.js<\/a> (and not <a href=\"https:\/\/reactjs.org\/\">React<\/a> or <a href=\"https:\/\/angular.io\/\">Angular<\/a> for example) is given because of its simplicity and ease of use.<\/p>\n<h2><a name=\"conclusions\"><\/a>6. Conclusions<\/h2>\n<p>In this section we have talked about the opportunities the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservice architecture<\/a> provides with respect to having a freedom to make technical choices. We have discussed the pros and cons of monoglot versus polyglot <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> and some pitfalls you should be aware of.<\/p>\n<h2><a name=\"next\"><\/a>7. What\u2019s next<\/h2>\n<p>In the next section of the tutorial we are going to have a conversation about different programming paradigms which are often used to build <a href=\"https:\/\/en.wikipedia.org\/wiki\/Microservices\">microservices<\/a> and modern distributed systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction Along the previous parts of the tutorial we have talked quite a lot about the benefits of the microservice architecture. It is essentially a loosely coupled distributed system which provides a particularly important ability to pick the right tool for the job. It could mean not just a different framework, protocol or library &hellip;<\/p>\n","protected":false},"author":141,"featured_media":2386,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[960,1814,1815],"class_list":["post-82379","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-microservices","tag-monoglot","tag-polyglot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-03T16:00:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-11T12:38:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Andrey Redko\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andrey Redko\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html\"},\"author\":{\"name\":\"Andrey Redko\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\"},\"headline\":\"Microservices for Java Developers: Monoglot or Polyglot?\",\"datePublished\":\"2018-10-03T16:00:17+00:00\",\"dateModified\":\"2023-12-11T12:38:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html\"},\"wordCount\":2160,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"keywords\":[\"Microservices\",\"Monoglot\",\"Polyglot\"],\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html\",\"name\":\"Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"datePublished\":\"2018-10-03T16:00:17+00:00\",\"dateModified\":\"2023-12-11T12:38:03+00:00\",\"description\":\"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/10\\\/microservices-java-developers-monoglot-polyglot.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/software-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microservices for Java Developers: Monoglot or Polyglot?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/771a6504862edc45322776832cbce413\",\"name\":\"Andrey Redko\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g\",\"caption\":\"Andrey Redko\"},\"description\":\"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\\\/EE, C#\\\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).\",\"sameAs\":[\"http:\\\/\\\/aredko.blogspot.com\\\/\",\"http:\\\/\\\/ca.linkedin.com\\\/in\\\/aredko\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/andrey-redko\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks","description":"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html","og_locale":"en_US","og_type":"article","og_title":"Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks","og_description":"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!","og_url":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-10-03T16:00:17+00:00","article_modified_time":"2023-12-11T12:38:03+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","type":"image\/jpeg"}],"author":"Andrey Redko","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Andrey Redko","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html"},"author":{"name":"Andrey Redko","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413"},"headline":"Microservices for Java Developers: Monoglot or Polyglot?","datePublished":"2018-10-03T16:00:17+00:00","dateModified":"2023-12-11T12:38:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html"},"wordCount":2160,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","keywords":["Microservices","Monoglot","Polyglot"],"articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html","url":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html","name":"Microservices for Java Developers: Monoglot or Polyglot? - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","datePublished":"2018-10-03T16:00:17+00:00","dateModified":"2023-12-11T12:38:03+00:00","description":"Interested to learn more about Microservices? Then check out our detailed example on Microservices for Java Developers: Monoglot or Polyglot!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2018\/10\/microservices-java-developers-monoglot-polyglot.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/www.javacodegeeks.com\/category\/software-development"},{"@type":"ListItem","position":3,"name":"Microservices for Java Developers: Monoglot or Polyglot?"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/771a6504862edc45322776832cbce413","name":"Andrey Redko","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/16419ce8394173028eddaeb992859862bab50cfcf74589fa9bb9a3dd8bb27518?s=96&d=mm&r=g","caption":"Andrey Redko"},"description":"Andriy is a well-grounded software developer with more then 12 years of practical experience using Java\/EE, C#\/.NET, C++, Groovy, Ruby, functional programming (Scala), databases (MySQL, PostgreSQL, Oracle) and NoSQL solutions (MongoDB, Redis).","sameAs":["http:\/\/aredko.blogspot.com\/","http:\/\/ca.linkedin.com\/in\/aredko"],"url":"https:\/\/www.javacodegeeks.com\/author\/andrey-redko"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/82379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=82379"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/82379\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/2386"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=82379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=82379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=82379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}