Reader small image

You're reading from  Software Architecture for Busy Developers

Product typeBook
Published inOct 2021
PublisherPackt
ISBN-139781801071598
Edition1st Edition
Right arrow
Author (1)
Stéphane Eyskens
Stéphane Eyskens
author image
Stéphane Eyskens

Stéphane Eyskens has a developer background and became a solution architect about a decade ago. As a cloud subject matter expert, he contributed to many digital transformation programs, helping organizations get better results out of their cloud investments. As an MVP, he is an active contributor to the Microsoft Tech Community and has worked on multiple open source projects available on GitHub. Stéphane is also a Pluralsight assessment author as well as the author of multiple books and online recordings.
Read more about Stéphane Eyskens

Right arrow

Chapter 7: Trendy Architectures and Global Summary

This chapter is the continuation of the previous one since trendy architectures are often cloud-based. In this chapter, we are going to focus on the main architectural trends that every software architect should master.

More specifically, we will cover the following topics:

  • API-driven architectures
  • Hands-on with a microservice architecture example
  • Hands-on with a serverless architecture example

Because I have already introduced the theoretical aspects of serverless and microservices, I wanted to satisfy the developer in you, and walk you through more concrete examples, at the risk of being less technology agnostic. By the end of this chapter, you should have grasped the basics about API-driven architectures and get started with serverless and microservices.

Technical requirements

If you want to practice implementing the explanations provided in this chapter, you will need the following:

  • Visual Studio 2019: To open the solution provided on GitHub.
  • Kubernetes: You will need a vanilla cluster such as MiniKube or Docker Desktop with K8s embedded. You can also use any cloud-provided cluster (Azure, AWS, or GCP). I used Azure Kubernetes Service to host my demo solution. Whatever solution you choose, make sure that the cluster has access to the internet so that it can pull the Docker images that I published to Docker Hub.
  • An Azure subscription: I used Azure for the serverless sample application. To create your own free Azure account, follow the steps explained at https://azure.microsoft.com/free/.

All the code samples and diagrams for this chapter are available at https://github.com/PacktPublishing/Software-Architecture-for-Humans/tree/master/CHAPTER%207/.

API-driven architectures

Modern assets ship with APIs, but the notion of an API itself has changed over time. In the nineties, an API was some sort of client library you could use to interact with an application. In 2021, an API is a physical endpoint acting as a client interface that allows clients to interact with backend services. The form has changed but the purpose is the same. Both forms aim at facilitating integration scenarios and exposing application features to client programs. Yet, I have noticed that although developers are usually aware of how to develop backend services, they often lack skills in API management solutions that can be used for both internal and internet-facing APIs. API management solutions accommodate a few design patterns out of the box:

  • Backend for frontends (BFF): The purpose of a BFF is to propose an API that is tailor-made to a given consuming channel, such as a mobile application. The purpose is to satisfy the specific requirements of a given...

Hands-on with a microservice architecture example

I introduced microservices in Chapter 4, Reviewing the Historical Architecture Styles, at a high-level. Going through a full explanation is beyond the scope of this book. However, because microservices have become a serious trend, I wanted to dive a little deeper with a concrete example. The objective is to focus on the communication aspects, both synchronous and asynchronous, of the different services.

The following diagram illustrates a small application I built for you to taste the flavor of microservices:

Figure 7.1 – Microservice application example

In this example, we have three services:

  • The order processing service, which is called by the client app that places orders. This client app could be a mobile app, a web app, or another API. In theory, you would put a BFF between the client and the order processing service, but I wanted to keep things as simple as possible.

    Once the order processing...

Hands-on with a serverless architecture example

I introduced serverless architectures in Chapter 6, Impact of the Cloud on the Software Architecture Practice, so it is time to go through a small example to let you taste the serverless flavor. Remember that true serverless is based on fully delegating the infrastructure to the cloud provider, and costs are consumption-based. Therefore, it is hard to be cloud-agnostic, so I had to choose a cloud vendor for this example. Due to this, I went for Azure. The following diagram shows our very simple application:

Figure 7.10 – Diagram of the serverless sample application

We are going to reuse the same K8s cluster to host the event publisher, which publishes events to a custom event grid topic. An Azure function, represented by the event handler in the preceding diagram, subscribed to our topic and gets triggered by the event grid whenever a new event is being pushed. As I explained earlier, serverless architectures...

Summary

In this chapter, I tried to give you more concrete examples of trendy architecture styles, because I already introduced the theoretical part in the previous chapter. The purpose of the two examples provided in this chapter was to demonstrate how quickly you can get started with cloud and cloud-native applications. Both examples relied on Infrastructure as Code. The remaining manual steps were there to keep things simple but rest assured that this can be fully automated in the real world.  

Both examples showed that the ecosystem plays an important role when building new solutions. For the serverless application, we relied on Azure Functions and Azure Event Grid, and we leveraged K8s's built-in scaling capabilities to load test our function handler. In the microservices example, we used Dapr, yet another great framework that comes from the K8s ecosystem. Both demos were intended to highlight the importance of this ecosystem, which you should never neglect as...

Postface

I hope that you enjoyed your software architecture journey. As you understood from the initial chapter, there is no single vision of software architecture. I think that a good software architect must specialize in application development and architecture, as well as understand the bigger picture. A good software architect must be able to interact with every type of stakeholder. This is why I took you through the discovery of a few popular frameworks, such as TOGAF, ITIL, and NIST, as well as the ATAM methodology. These skills (even partially) are a must-have to grow as an architect. The frameworks help you structure and organize your work. The extent to which you apply them depends on the organization you are working for.

I could not bypass design patterns because they are an integral part of the software architect's job, but there are tons of books about them, so I did not want to write yet another book on design patterns. Our last two chapters showed how the cloud...

Why subscribe?

  • Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
  • Improve your learning with Skill Plans built especially for you
  • Get a free eBook or video every month
  • Fully searchable for easy access to vital information
  • Copy and paste, print, and bookmark content

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.

At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Software Architecture for Busy Developers
Published in: Oct 2021Publisher: PacktISBN-13: 9781801071598
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Stéphane Eyskens

Stéphane Eyskens has a developer background and became a solution architect about a decade ago. As a cloud subject matter expert, he contributed to many digital transformation programs, helping organizations get better results out of their cloud investments. As an MVP, he is an active contributor to the Microsoft Tech Community and has worked on multiple open source projects available on GitHub. Stéphane is also a Pluralsight assessment author as well as the author of multiple books and online recordings.
Read more about Stéphane Eyskens