Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
A Developer's Guide to Building Resilient Cloud Applications with Azure

You're reading from   A Developer's Guide to Building Resilient Cloud Applications with Azure Deploy applications on serverless and event-driven architecture using a cloud database

Arrow left icon
Product type Paperback
Published in Feb 2023
Publisher Packt
ISBN-13 9781804611715
Length 296 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Hamida Rebai Hamida Rebai
Author Profile Icon Hamida Rebai
Hamida Rebai
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: Building Cloud-Oriented Apps Using Patterns and Technologies
2. Chapter 1: Introduction to Serverless Architecture, Event-Driven Architecture, and Cloud Databases FREE CHAPTER 3. Chapter 2: API Management – Import, Manage, and Publish Your First API 4. Chapter 3: Developing Event-Based and Message-Based Solutions 5. Part 2: Connecting Your Application with Azure Databases
6. Chapter 4: Creating and Deploying a Function App in Azure 7. Chapter 5: Develop an Azure Service Fabric Distributed Application 8. Chapter 6: Introduction to Application Data 9. Chapter 7: Working with Azure SQL Database 10. Chapter 8: Working with Azure Storage 11. Chapter 9: Working with Azure Cosmos DB to Manage Database Services 12. Chapter 10: Big Data Storage Overview 13. Part 3: Ensuring Continuous Integration and Continuous Container Deployment on Azure
14. Chapter 11: Containers and Continuous Deployment on Azure 15. Assessments 16. Index 17. Other Books You May Enjoy

Understanding serverless architecture

Serverless architecture is a software design pattern where applications are hosted by a third-party service, allowing developers to build and run services without having to manage the underlying infrastructure.

Applications are divided into separate functions that can be called and scaled individually.

Developers implement and deploy application-only code and can run applications, databases, and storage systems hosted in servers provisioned by cloud providers.

We will understand the role of APIs inside an application and the ecosystem. To start modernizing legacy applications without any modification, we can use APIs to interact with existing code. These APIs will run in the cloud, but if we need to add more features to the application to modernize it, we will encapsulate the data and the functions in services via an API. This encapsulation phase is a technique that consists of reusing legacy software components. The goal is to keep the code in its environment and connect it to the new presentations via encapsulation to access the different layers through an API. APIs permit you to define common protocols (rules) to expose data from an application with the possibility of decoupling the presentation layer.

Technically, the encapsulation works with wrapper technology, providing a new interface for a legacy component. This component will be easily accessible from the rest of the software components.

These minimal modifications reduce the risk of destabilizing the application. Even if encapsulation is a fast, effective, and less expensive solution, it will not solve the present problems related to the difficulties of maintenance or upgrading.

Because we are talking about the role of APIs in digital transformation and their life cycle, we need to define them.

API definition

APIs form a bridge between different applications to ensure communication and the exchange of information between them. They can even define the behavior of these applications.

APIs are considered connectors because they provide the ability for disparate applications to exchange information.

The information exchanged is generally data; for example, if we make a request in a mobile application, the data will be sent to a server that performs the reading and then sends back a response in a format readable in JSON.

Sometimes, microservices are compared with APIs. We often talk about the relationship between APIs and microservices, but there is also a difference between them. Microservices are a style of architecture that divides an application into a set of services; each service presents a very particular domain, for example, an authentication service or another service for the management of the products. On the other hand, an API is a framework (a structure that you can build software on) used by developers to provide interaction with a web application. Alternatively, microservices can use an API to provide communication between services. But how does an API work?

Applications that send requests are called clients, and applications that send responses are called servers. Using bees as an example, the hive is the client, the flower is the server, and the bee is the communication path (REST API requests).

The API life cycle

The API manager – usually the enterprise architect or API product manager – manages the API life cycle.

The API life cycle consists of the following three main phases:

  • The creation phase: This consists of creating and documenting the API. There are some key aspects of API creation to consider; the API will use or reuse backend resources (service or business capability implementation). These resources are typically available as RESTful services, Simple Object Access Protocol (SOAP)-based web services, or even Advanced Message Queuing Protocol (AMQP)-compliant message brokers.
  • The control phase: This consists of applying the security policies necessary to ensure that the exchanges are secure.
  • The consumption phase: This consists of publishing the API so that we can consume and monetize it.

After understanding the API life cycle and the different phases, we will next look at the important role of an API in terms of communication between applications.

An APIs role

A set of rules ensures the communication of APIs by defining how applications or machines can communicate, so the API is an intermediate bridge between two applications wanting to communicate with each other.

API types

A web API is an API that can be accessed via the HTTP protocol. There are many API protocols/specifications, as follows:

  • Open APIs
  • Partner APIs
  • Internal APIs
  • Composite APIs
  • Representational State Transfer (REST)
  • SOAP
  • Extensible Markup Language Remote Procedure Call (XML-RPC)
  • JavaScript Object Notation Remote Procedure Call (JSON-RPC)

The most popular type of API is RESTful because it has several advantages in terms of flexibility when creating an API that meets the client’s needs and dependencies because the data is not bound to methods or resources. A RESTful API supports different data formats, such as application/json, application/xml, application/x-wbe+xml, multipart/form-data, and application/x-www-form-urlencoded.

RESTful APIs take advantage of existing protocols – for example, web APIs take advantage of the HTTP protocol.

So far, in this chapter, we have talked about encapsulation to access the different layers through an API as a technique used for legacy system modernization. We have presented the API life cycle and API roles, which encompasses several roles to ensure communication, and we have identified the API types, such as RESTful APIs, which are the most popular. In the next section, we will present the event-driven architecture used to improve agility in complex applications.

You have been reading a chapter from
A Developer's Guide to Building Resilient Cloud Applications with Azure
Published in: Feb 2023
Publisher: Packt
ISBN-13: 9781804611715
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.
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 $19.99/month. Cancel anytime
Banner background image