Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Full Stack Development with JHipster
  • Table Of Contents Toc
Full Stack Development with JHipster

Full Stack Development with JHipster - Second Edition

By : Deepu K Sasidharan, Sendil Kumar Nellaiyapen
3.3 (3)
close
close
Full Stack Development with JHipster

Full Stack Development with JHipster

3.3 (3)
By: Deepu K Sasidharan, Sendil Kumar Nellaiyapen

Overview of this book

JHipster is an open source development platform that allows you to easily create web apps and microservices from scratch without spending time on wiring and integrating different technologies. Updated to include JHipster 6, Java 11, Spring Boot 2.1, Vue.js, and Istio, this second edition of Full Stack Development with JHipster will help you build full stack applications and microservices seamlessly. You'll start by understanding JHipster and its associated tools, along with the essentials of full stack development, before building a monolithic web app. You'll then learn the JHipster Domain Language (JDL) with entity modeling using JDL-Studio. With this book, you'll create production-ready web apps using Spring Boot, Spring Framework, Angular, and Bootstrap, and run tests and set up continuous integration pipelines with Jenkins. As you advance, you'll learn how to convert your monoliths to microservices and how to package your application for production with various deployment options, including Heroku and Google Cloud. You'll also learn about Docker and Kubernetes, along with an introduction to the Istio service mesh. Finally, you'll build your client-side with React and Vue.js and discover JHipster's best practices. By the end of the book, you'll be able to leverage the best tools available to build modern web apps.
Table of Contents (23 chapters)
close
close
1
Section 1: Getting Started with the JHipster Platform
4
Section 2: Building and Customizing Web Applications with JHipster
8
Section 3: Continuous Integration and Testing
11
Section 4: Converting Monoliths to Microservice Architecture
15
Section 5: Deployment of Microservices
18
Section 6: React and Vue.js for the Client Side

Web architecture patterns

The full stack landscape is further complicated by the different web architecture patterns commonly used these days. The widely used web application architecture patterns today can be broadly classified into two patterns—monolithic architecture and microservice architecture, the latter of which has become mainstream (fashionable) in recent years.

Monolithic web architecture

A monolithic architecture is the most widely used pattern for web applications because of its simplicity to develop and deploy. Though the actual moving parts will differ from application to application, the general pattern remains the same. In general, a monolithic web application can do the following:

  • It can support different clients, such as desktop/mobile browsers and native desktop/mobile applications.
  • It can expose APIs for third-party consumption.
  • It can integrate with other applications over REST/SOAP web services or message queues.
  • It can handle HTTP requests, execute business logic, access databases, and exchange data with other systems.
  • It can run on web application containers, such as Tomcat and JBoss.
  • It can be scaled vertically by increasing the power of the machines it runs on or scaled horizontally by adding additional instances behind load balancers.
REST (short for REpresentational State Transfer) relies on a stateless, client–server, cacheable communications protocol. HTTP is the most commonly used protocol for REST. It is a lightweight architectural style in which RESTful HTTP communication is used to transfer data between a client and a server, or between two systems.

SOAP (short for Simple Object Access Protocol) is a messaging protocol using HTTP and XML. It is widely used in SOAP web services to transfer data between two different systems.

An example of a typical monolithic web application architecture would be as follows: Let's imagine an online hotel reservation system that takes online reservation orders from customers, verifies the room availability, verifies the payment option, makes the reservation, and notifies the hotel. The application consists of several layers and components, including a client-side app—which builds a nice, rich user interface—and several other backend components responsible for managing the reservations, verifying the payment, notifying customers/hotels, and so on.

The application will be deployed as a single monolithic web application archive (WAR) file that runs on a web application container such as Tomcat, and will be scaled horizontally by adding multiple instances behind an Apache web server acting as a load balancer. Take a look at the following diagram:

The advantages of a monolithic web application architecture are as follows:

  • It is simpler to develop, as the technology stack is uniform throughout all layers.
  • It is simpler to test, as the entire application is bundled in a single package, making it easier to run integration and end-to-end tests.
  • It is simpler and faster to deploy, as you only have one package to worry about.
  • It is simpler to scale, as you can multiply the number of instances behind a load balancer to scale it out.
  • It requires a smaller team to maintain the application.
  • The team members share more or less the same skill set.
  • The technical stack is simpler and, most of the time, is easier to learn.
  • Initial development is faster, thereby making the time to market shorter.
  • It requires a simpler infrastructure. Even a simple application container or JVM will be sufficient to run the application.

The disadvantages of a monolithic web application architecture are as follows:

  • Components are tightly coupled together, resulting in unwanted side effects, such as changes to one component causing a regression in another.
  • It becomes complex and huge as time passes, resulting in slow development turnaround. New features will take more time to develop and refactoring existing features will be more difficult because of tight coupling.
  • The entire application needs to be redeployed whenever any change is made.
  • It is less reliable because of tightly coupled modules. A small issue with any service might break the entire application.
  • Newer technology adoption is difficult as the entire application needs to be migrated. Incremental migration is not possible most of the time, which means that many monolithic applications end up having an outdated technology stack after some years.
  • Critical services cannot be scaled individually, resulting in increased resource usage. As a result, the entire application will need to be scaled.
  • Huge monolith applications will have a higher start up time and higher resource usage in terms of CPU and memory.
  • Teams will be more interdependent and it will be challenging to scale the teams.

Microservice architecture

The microservice architecture has gained momentum in recent years and is gaining popularity in large-scale web application development because of its modularity and scalability. Microservice architecture can offer almost all the features of a monolith that we saw in the previous section. Additionally, it offers many more features and flexibility and so is often considered a superior choice for complex, large-scale applications. Unlike the monolithic architecture, it's quite difficult to generalize the microservice architecture as it could vary heavily depending on the use case and implementation. But they do (generally) share some common traits, which are as follows:

  • Microservice components are loosely coupled. Components can be developed, tested, deployed, and scaled independently without disrupting other components.
  • Components need not be developed using the same technology stack. This means that a single component can choose its own technology stack and programming language.
  • They often utilize advanced features such as service discovery, circuit breaking, and load balancing.
  • Microservice components are mostly lightweight and perform a specific functionality. For example, an authentication service will only care about authenticating a user into the system.
  • It often has an extensive monitoring and troubleshooting setup.

An example of a microservice web application architecture would be as follows: Let's imagine a huge online e-commerce system where customers can go through categories of merchandise, list their favorites, add items to a shopping cart, make and track orders, and so on. The system has inventory management, customer management, multiple payment modes, order management, and so on. The application consists of several modules and components, including a UI gateway application, which builds a nice, rich user interface and also handles user authentication and load balancing, and several other backend applications responsible for managing the inventory, verifying the payment, and managing orders. It also has performance monitoring and automatic failover for services.

The application will be deployed as multiple executable WAR files in Docker containers hosted by a cloud provider. Take a look at the following diagram:

The advantages of a microservice web application architecture are as follows:

  • Loosely coupled components resulting in better isolation, which means that they are easier to test and faster to start up.
  • Faster development turnaround and better time to market for new features, and existing features can be easily refactored.
  • Services can be deployed independently, making the application more reliable and making patching easier.
  • Issues, such as a memory leak in one of the services, are isolated and will not bring down the entire application.
  • Technology adoption is easier, as components can be independently upgraded with incremental migration, making it possible to have a different stack for each component.
  • More complex and efficient scaling models can be established. Critical services can be scaled more effectively. Infrastructure is used more efficiently.
  • Individual components will start up faster, making it possible to parallelize and improve overall startup for large systems.
  • Teams will be less dependent on each other. This is best suited for agile teams.

The disadvantages of a microservice web application architecture are as follows:

  • It is more complex in terms of the overall stack as different components might have different technology stacks, forcing the team to invest more time in keeping up with them.
  • It is difficult to perform end-to-end tests and integration tests as there are more moving parts in the stack.
  • The entire application is more complex to deploy as there are complexities with containers, orchestration, and virtualization involved.
  • Scaling is more efficient, but it is also more complex, as it would require advanced features, such as service discovery and DNS routing.
  • It requires a larger team to maintain the application, as there are more components and more technologies involved.
  • Team members share varying skill sets based on the component they work on, making replacements and knowledge sharing harder.
  • Applications with many microservices and different teams managing different services creates more organizational challenges.
  • The technical stack is complex and, most of the time, it is harder to learn.
  • Initial development time will be higher, making the time to market longer.
  • It requires a complex infrastructure. Most often, it will require containers (Docker), orchestration (Kubernetes), and multiple JVM or app containers to run on.
  • To effectively manage distributed systems, you need to set up monitoring, distributed tracing, service discovery, and so on. These are not easy to set up and require additional components to be run which will produce overhead and additional costs.
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Full Stack Development with JHipster
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon