Building Microservices with Micronaut®
eBook - ePub

Building Microservices with Micronaut®

Nirmal Singh, Zack Dawood, The Micronaut® Foundation

Condividi libro
  1. 362 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Building Microservices with Micronaut®

Nirmal Singh, Zack Dawood, The Micronaut® Foundation

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Explore different aspects of building modular microservices such as development, testing, maintenance, and deployment using the Micronaut frameworkKey Features• Learn how to build scalable, fast, and resilient microservices with this concise guide• Explore the many advantages of using reflection-free, compile-time dependency injections and aspect-oriented programming• Build cloud-native applications easily with the Micronaut frameworkBook DescriptionThe open source Micronaut® framework is a JVM-based toolkit designed to create microservices quickly and easily. This book will help full-stack and Java developers build modular, high-performing, and reactive microservice-based apps using the Micronaut framework.You'll start by building microservices and learning about the core components, such as ahead-of-time compilation, reflection-less dependency injection, and reactive baked-in HTTP clients and servers. Next, you will work on a real-time microservice application and learn how to integrate Micronaut projects with different kinds of relational and non-relational databases. You'll also learn how to employ different security mechanisms to safeguard your microservices and integrate microservices using event-driven architecture in the Apache Kafka ecosystem. As you advance, you'll get to grips with automated testing and popular testing tools. The book will help you understand how you can easily handle microservice concerns in Micronaut projects, such as service discovery, API documentation, distributed configuration management, fallbacks, and circuit breakers. Finally, you'll explore the deployment and maintenance aspects of microservices and get up to speed with the Internet of Things (IoT) using the Framework.By the end of this book, you'll be able to build, test, deploy, and maintain your own microservice apps using the framework.What you will learn• Understand why the Micronaut framework is best suited for building microservices• Build web endpoints and services in the Micronaut framework• Safeguard microservices using Session, JWT, and OAuth in Micronaut projects• Get to grips with event-driven architecture in Micronaut applications• Discover how to automate testing at various levels using built-in tools and testing frameworks• Deploy your microservices to containers and cloud platforms• Become well-versed with distributed logging, tracing, and monitoring in Micronaut projects• Get hands-on with the IoT using Alexa and the Micronaut frameworkWho this book is forThis book is for developers who have been building microservices on traditional frameworks such as Spring Boot and are looking for a faster alternative. Intermediate-level knowledge of Java programming and implementing web services development in Java is required.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Building Microservices with Micronaut® è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Building Microservices with Micronaut® di Nirmal Singh, Zack Dawood, The Micronaut® Foundation in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatica e Architettura di sistemi. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2021
ISBN
9781800567399
Edizione
1
Argomento
Informatica

Section 1: Core Concepts and Basics

This section kickstarts the microservices journey in the Micronaut framework while covering some fundamentals of microservices, microservices design patterns, and why Micronaut is the ideal framework for microservices development.
This section has the following chapter:
  • Chapter 1, Getting Started with Microservices Using the Micronaut Framework

Chapter 1: Getting Started with Microservices Using the Micronaut Framework

In recent times, there's been a good buzz about microservices and how the microservices architecture has been transformational in developing rapid, agile, and enterprise-grade web services to address the unique challenges and requirements of today's world. The microservices architecture has turned the page toward disciplining the standards on developing these web services. In this chapter, we will walk through the evolution of web services to microservices. We will quickly dive into some useful microservices design patterns. We will zero in on the key pitfalls in most of the traditional Java development frameworks and how their surface-level adoption to the microservices architecture has elevated performance and optimization issues. We will then explore how the Micronaut framework has addressed these performance and optimization issues in the microservices with an overhauled and ground-up approach to microservices development. Lastly, to get started with the Micronaut framework, we will set up the Micronaut CLI and work on a small hello world project.
In this chapter, we will focus on these topics in particular:
  • Introducing microservices and their evolution
  • Understanding microservices design patterns
  • Why Micronaut is the best choice for developing microservices
  • Getting started with the Micronaut framework
  • Working on the hello world project in the Micronaut framework
By the end of this chapter, you will have an understanding of how web services evolved in to microservices and why traditional Java frameworks are ineffective for developing microservices as compared to the Micronaut framework. Furthermore, we will also gain the practical knowledge to start using the Micronaut framework by working on a small project in the Micronaut framework.

Technical requirements

All the commands and technical instructions in this chapter are run on Windows 10 and mac OS X. Code examples covered in this chapter are available in the book's GitHub repository at https://github.com/PacktPublishing/Building-Microservices-with-Micronaut/tree/master/Chapter01.
The following tools need to be installed and set up in the development environment:
  • Java SDK: Version 13 or above (we used Java 14).
  • Maven: This is optional and only required if you would like to use Maven as the build system. However, we recommend having Maven set up on any development machine. Instructions to download and install Maven can be found at https://maven.apache.org/download.cgi.
  • Development IDE: Based on your preferences, any Java-based IDE can be used, but for the purpose of writing this chapter, IntelliJ was used.
  • Git: Instructions to download and install Git can be found at https://git-scm.com/downloads.

Introducing microservices and their evolution

Before we thoroughly jump into introducing and defining microservices, it will be helpful to know how microservices have evolved. In the late 1960s, Alan Kay coined the term object-oriented programming. Though it was a definitive idea, later it birthed the four pillars for building software solutions using object-oriented programming:
  • Encapsulation
  • Inheritance
  • Polymorphism
  • Abstraction
In a short mnemonic, it's known as EIPA. Since the inception of these four pillars, the software industry has seen the rise and fall of many programming languages, frameworks, design patterns, and so on. With each such adaption and idea, thinkers and tinkerers have tried to come closer to EIPA by keeping a modular design and loosely coupled yet tightly encapsulated application components. Over the last few decades, software teams have moved away from the art of object-oriented programming toward the science of object-oriented programming by systematically adopting these key pillars. This iterative journey is the evolution of microservices.
In the late 1980s and early 1990s, almost every enterprise application was exposed as either a command line or native desktop software. Applications were tightly connected to databases and it was almost as if the end user was directly interacting with the database with the application as a thin façade in between. It was the era of monolithic applications or client/server architecture.
In the proceeding diagram, we can see how users interacted with a monolith application:
Figure 1.1 – Monolithic client/server architecture
Figure 1.1 – Monolithic client/server architecture
As depicted in Figure 1.1, in monolithic client/server architecture, the application is tightly coupled to the database and the user interacts through a terminal façade or desktop application. In this architecture, it was painful to maintain good service-level agreements (SLAs). Almost all the key non-functional factors such as scalability, high availability, fault tolerance, and flexibility underperformed or failed.
To address some of these aspects service-oriented architecture (SOA) came into existence. In the 2000s, SOA was formalized in the industry with the definition of some standard protocols such as Simple Object Access Protocol (SOAP). Web Services Description Language (WSDL) was also created during this period. Web 2.0 applications were popular with Asynchronous JavaScript And XML (AJAX). Enterprise service bus and messaging systems were highly used in enterprise applications. Advancements in SOA catalyzed a new paradigm of delivering software solutions to end users: Software as a Service (SaaS). Instead of desktop applications and terminal clients, software solutions were delivered to end users over HTTP as hosted online services. In the proceeding diagram, we can see how users interacted with an SOA-based application:
Figure 1.2 – SOA
Figure 1.2 – SOA
As shown, SOA brought in some decoupling by separating the concerns between the web application, web server...

Indice dei contenuti