June 2019
July 2019
-
-
-
18 - Reactive Microservices
The requirements of modern applications force developers to make fundamental changes in how we construct applications. In this article, we will look at the Reactive Microservice approach. This approach focuses on four guiding attributes: Responsiveness, Resiliency, Elasticity, and Message-Driven.
reactive
microservices
elastic
message-driven
resilient
-
August 2019
-
-
-
-
28 - Message-Driven Microservices
When developing applications, there is a common expectation that the caller will wait for the result to be returned. This synchronous approach is usually more straightforward programmatically but comes at the cost of idle resources. An alternate approach is to introduce an asynchronous communication model built around messages and message queues. This article introduces the reader to Message-Driven Microservices
Message Driven microservices
September 2019
-
01 - From Transactions to Sagas
In a microservice application, it is common for services to manage their own entity stores. Complications arise for operations that must span multiple services. When this occurs, the complexity involved in managing the distributed transaction can seriously impact performance. This article introduces the Saga pattern to address this situation.
saga
two-phase commit
distributed transactions
-
21 - Event Sourcing
It is a fact of life that applications will have defects. The process of remediating an error is straightforward. Write a unit test to reproduces the defect (if one doesn't already exist) and then modify the defective source code until the unit test passes. But how do we fix data that has been corrupted by the faulty code? If we use the common CRUD approach, we store only the current state of an entity. In this situation, we have no way of knowing how we arrived at that state. This article explores the Event Sourcing approach as a means to address the problem.
Event Sourcing
Event Streams
CRUD
events
snapshots
October 2019
-
14 - Command Query Responsibility Segregation
In the previous article, we introduced Event Sourcing and identified one of the primary disadvantages of event sourcing when a single aggregate root couldn't answer our queries. In this article, we present a solution to the problem: Command Query Request Segregation.
CQRS
commands
events
queries
-
-
25 - API Gateway Pattern
When building microservices applications, it is not practical to expose individual services directly to the application client. Instead, it is often advisable to introduce a mediator between the client application and its desired services. In this article, we present the "API Gateway" pattern.
api gateway
pattern
November 2019
-
03 - Retry Pattern
All applications, regardless of their architecture, must embrace the idea that failure is an option. We can count on hardware and networks to fail, so we must code for these failures. However, most failures are not terminal. Given sufficient time, many failures are recoverable. In this article, we introduce the Retry pattern as an approach to gracefully recover from failure.
retry
pattern
-
10 - Circuit Breaker Pattern
In the previous article, we introduced the Retry Pattern for recoverable failures. However, what do we do when a failure isn't recoverable? This article will look at the Circuit Breaker Pattern and how it applies to failures.
circuit breaker
pattern
-
17 - Microservices and Containers
Managing an extensive collection of services directly in production can be difficult. In this article, we introduce service containerization to begin addressing this problem.
container
Docker
-
December 2019
-
02 - Microservice Monitoring
In an application composed of tens, hundreds, or even thousands of services, how can you determine when a service is under stress or has stopped working. In this article, we will introduce Microservice Monitoring to provide insight for troubleshooting and analysis.
monitoring
-
12 - Microservices Logging
In a monolithic application executing in a single process, it is a relatively trivial exercise to troubleshoot the application from its log files. But how do you troubleshoot a distributed application that may have hundreds of log files? In this article, we introduce distributed logging to a microservice application.
logging
fluentd
Elastisearch
Logstash
Kibana
-
19 - Microservices Configuration
When our application runs in a single execution environment, a simple local configuration file may be sufficient to provide configuration. However, when our application's services span multiple machines, data centers, and geographic regions, local configuration files are inadequate. In this article, we introduce the concept of a Configuration Service to handle application configuration.
configuration
configuration profile
-
26 - Microservice Authentication & Authorization
Monolithic applications resources share the same execution environment. This attribute allows the application's resources to share a common authentication and authorization mechanism. However, in a microservice, each service runs in its own execution environment and cannot share a common authentication and authentication mechanism. This article introduces an approach that divides the authentication and authorization responsibilities in the application. Authentication is handled by an Authentication Service that verifies a user's credentials and issues the caller a JSON Web Token (JWT), representing the authenticated user. Any service that contains secured resources is responsible for handling access authorization. The service performs access authorization by comparing claims contained in the JWT against the required resource privileges.
authentication
authorization
JWT
January 2020
-
-
17 - A Spring-Based Reference Implementation
In the previous article, we outlined a Reference Architecture of our foundational microservice application. To realize this architecture, we have selected Java as our implementation language. Additionally, we will leverage the Spring framework's various features to support our microservice implementation. This article provides a brief history of the Spring framework and why it was selected.
Spring
Spring Boot
Spring Cloud
Spring Actuator
-
-
27 - Configuration Service & Unified Logging
In this article, we will start constructing our reference implementation. We will implement our first service and set up the applications distributed logging and monitoring infrastructure. We begin by building the ConfigurationService, which externalizes and centralizes the application's configuration. While building the service, we introduce Spring Actuator, Micrometer, and Prometheus to capture and store the service's metrics and Grafana to render the application's metrics. Distributed logging is handled using a combination of Fluentd, Elasticsearch, and Kibana to capture, index, and query log data. Finally, we orchestrate our service and its supporting infrastructure with Docker-Compose.
Spring Cloud
Spring Config
Docker
Docker-Compose
Fluentd
Elasticsearch
Kibana
Prometheus
Grafana
-
30 - Discovery Service
Microservice applications are generally composed of a large number of services which must communicate with each other. However, to communicate with another service, we must first know its location and port. In this article, we implement a "Discovery Service" that services can both register their availability and query to find other services.
Discovery Service
Eureka
February 2020
-
05 - Content Service
It is a common requirement for applications to serve static content. This requirement can be fulfilled by a content delivery network (CDN), web-enabled object-store (e.g., Amazon S3, IBM Cloud Object Storage, Digital Ocean Spaces) or a web server. This article will build a simple Spring-based Content Service to serve the application's static assets.
Content
Spring
service
-
10 - API Gateway Service
Microservices applications are composed of many services, each with a unique host and port. Rather than directly exposing each service to an application client, it is usually preferable to provide a single endpoint service that performs client service queries and handles service request and response proxying. In this article, we will build the API Gateway Service. It leverages the Spring Cloud Gateway project to support declarative routing, service query, and load balancing.
API Gateway Service
api gateway
spring cloud
-
-
-
26 - Outbound SMS Service
Another common requirement for modern applications is the support of SMS/MMS messaging. In this article, we will build OutboundSMSService, which parallels the structure and implementation of the service by including both a REST Controller endpoint and a MessageQueue listener. We supplement this architecture with a pluggable provider interface to support multiple options when selecting a messaging service provider. This article will be implementing a Twilio service provider implementation to demonstrate integration with a third-party messaging service. We will exercise the REST endpoint the generated Swagger ui, and we will use RabbitMQ to enqueue messages for OutboundSMSService to consume. We end the article by viewing the OutbounndSMSService's operation metrics using a Grafana dashboard.
Outbound SMS Service
March 2020
-
01 - Notification Service
In the previous three articles, we created two services, the OutboundEmailService and the OutboundSMSService. Both of these services can be called directly via their respective REST endpoints. However, Calling these services directly can potentially cause contention when the service is under heavy load. We did, however, anticipate this situation when creating the services by including a message queue listener. In this article, we will build the NotificationService, which accepts both email and SMS/MMS message requests, and enqueues the message in the respective message queue topics. This approach reduces the concurrent load on each of the messaging services. After the NotificationService is constructed, we will exercise it using its generated Swagger interface, and view its operational metrics using the corresponding Grafana dashboard.
Notification Service
message queue
Swagger
Grafana
-
05 - Authentication Service (PART I)
Most applications require some form of authentication to restrict access to secured various service features. Additionally, we need a mechanism to register users and recover a user's forgotten passwords. To fulfill these requirements, this will be the first of a four-part series of articles cover the construction of the AuthenticationService. In this article, we introduce the basic components of the AuthenticationService.
Authentication Service
Spring
JWT
authentication
authorization
-
10 - Authentication Service (PART II)
In this second article discussing the AuthenticationService, we cover several areas. First, we introduce the user credentials and privileges role data model and the Spring repositories used to persist the data. We also look at the service's event publisher, the JSON Web Token (JWT) provider, and the email client the service uses to send messages to the Notification Service.
Authentication Service
Spring
JWT
Notification Service
-
-
-
20 - Account Profile Service
For every registered user in the application, there exists a corresponding profile that contains application-specific information for that user. In this article, we construct the AccountProfileService, which is responsible for managing this data. The service provides a REST endpoint as well as a MessageQueue listener and persists the profile data in a MongoDB database. We will deploy the application and exercise its REST endpoint using the generated Swagger user interface. We wrap up by viewing the operational metrics using the AccountProfile Grafana dashboard.
Account Profile Service
Swagger
Grafana
dashboard
-
26 - Account History Service
During the lifetime of every user account, various events are generated and published to the application's message queue. It is advantageous to capture and persist these events to provide an audit log of an account's activity. In this article, we will build the AccountHistoryService which performs this task. In addition to capturing the account events, the service also provides a REST endpoint to query these events. After construction, we will deploy the application and exercise the generated Swagger interface. We then view the operational metrics using the AccountHistory Grafana dashboard.
AccountHistoryService
REST
Swagger
Spring
Grafana
dashboard
April 2020
-
10 - Administration Service
Every application needs an administration console, and ours is no exception. In this article, we will build the AdministrationService to provide users with administration privileges to view, query, and control, various aspects of the application. Once constructed, we will exercise the service's Swagger interface and view the service's operational metrics using the AdministrationDashboard in Grafana.
Adminstration Service
Swagger
REST
Grafana
dashboard
-
20 - Telemetry Service
Throughout the construction of the microservice reference implementation, we have had access to our services aggregated logging and operational metrics. It would be advantageous to extend this visibility beyond the boundary of the backend to our application clients. This article constructs the TelemetryService. This service provides application clients with an endpoint where they can log operational messages for troubleshooting and analysis.
Telemetry Service
telemetry
REST
Swagger
-
24 - Feature Service
When building and deploying application clients, controlling the visibility of various runtime features can simplify client deployment and testing. In this article, we will build the FeatureService which allows an application to query the service for a set of runtime feature toggles. These feature toggles can be used by the application client to enable or disable selected features.
Feature Service
feature flag
feature toggle
REST
Swagger
May 2020
-
04 - Peer-Signaling Service
In a Post-Covid19 world, the need for integrated peer to peer, streaming audio and video service in modern applications will become an increasingly more common requirement. In this article, we build a PeerSignalingService to support a WebRTC-based application client's point-to-point video chat feature.
Peer-Signaling Service
WebRTC
Video
WebSocket
-
25 - Angular Application Client
In the last article, we completed the core services for our reference implementation. This article introduces the reader to an example application client built using the Angular framework. This application client demonstrates how a web application can be used to exercise the reference implementation's features. Construction of the application client is out of scope for the article, but the Angular client's source code is available for interested readers.
Angular Application Client
SPA
Angular
WebRTC
June 2020
July 2020
August 2020
September 2020
October 2020
November 2020
-
17 - Accessing Kubernetes Programatically
While kubetctl allows developers and operations to control Kubernetes clusters, it may be necessary to interact with your Kubernetes instances programatically. In this article, we will explore the using the Kubernetes Java Client API provided by Fabric8.
Kubernetes
microk8s
REST
fabric8
December 2020
January 2021
February 2021
March 2021
May 2021
-
17 - RSocket Microservices
While REST is the most common way to access a microservice, other alternative approaches do exist. In this example we will introduce rsocket, and explain how to use it to expose your service.
rsocket
REST
June 2021
-
15 - NATS Messaging
Message-Driven architectures need a messaging platform. In this article, we introduce NATS Messaging, discuss its supported messaging patterns, demonstrate how to scale NATS using clustering, and implement three Spring Boot services to demonstrate NATS client integration.
NATS
Kubernetes
July 2021
-
12 - NATS JetStream
In the previous article we introduced NATS Messaging and its core messaging patterns. In this article, we look at NATS messaging streaming support with NATS JetStream and demonstrate JetStream integration with a simple Spring Boot REST service.
NATS
Kubernetes
JetStream
August 2021
September 2021
-
30 - Object Storage, Minio, and Kubernetes
The ephemeral nature of microservices and their containers poses challanges for storing application state. In this article we look at using an object-store (Minio) and demonstrate how we can access it from a Spring-Boot service. We start by deploying a Docker-ized instance ofMinIO as our Spring-Boot object-store and then deploy the MinIO Kubernetes operator using Krew in a MicroK8s instance.
Minio
Kubernetes
microstorage
March 2022
-
15 - Object Caching, Redis, and Kubernetes
The ephemeral nature of microservices and their containers poses challanges for storing application state. In this article we look at using an object-cache (Redis) and demonstrate how we can access it from a Spring-Boot service. We start by deploying a Docker-ized instance ofRedis as our Spring-Boot object-cache and deploy the Redis Kubernetes operator .
Redis
caching