Utilize Microservices Architecture to Optimize Your Application Performance

Deploy Microservices with Function Compute: Visitor Card of Cloud Customer Service

This article shows you how you can deploy microservices on Alibaba Cloud with Function Compute by using Cloud Customer Service as an example.

Challenges

Users have tried to migrate Java by themselves but encountered the following technical challenges:

Dependencies on Local JAR Packages

fccsplatform-common-crypto-1.0.0.20161108.jar is a package in the Maven warehouse in Alibaba Cloud’s internal network. It is only available to external network customers through Cloud Customer Service. The following XML fragment is a common way in which Maven depends on local JAR packages. Because this is not a typical scenario, additional information is required to complete it.

<dependency>
<groupId>com.alipay.fc.csplatform</groupId>
<artifactId>fccsplatform-common-crypto</artifactId>
<version>1.0.0.20161108</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/fccsplatform-common-crypto-1.0.0.20161108.jar</systemPath>
</dependency>

Related Blogs

Using SSD and Microservices to Optimize App Performance

Microservices help to make application delivery more agile and nimble. Solid-state disk (SSD) technology makes applications faster. This you already know.

The Basics: Microservices and SSD

Microservices are an approach to application architecture that involves breaking complex applications into multiple discrete parts, or services.

Marrying Microservices and SSD in the Cloud

Microservices and SSD each offer distinct advantages on their own.

Solving Data Consistency Problems in a Microservices Architecture

Practices for solving data consistency problems in a microservices architecture

Business Description

The commodity purchase business includes three microservices:

  1. Order service: generates an order based on a purchase request.
  2. Account service: deducts a specific amount from the user account.
public interface StorageService {    
/**
* deduct storage count
*/
void deduct(String commodityCode, int count);
}
public interface OrderService {    
/**
* create order
*/
Order create(String userId, String commodityCode, int orderCount);
}

Visualizing a Microservices Architecture with AHAS

This blog explores how architectural visualization can help us identify problems that exist in our architecture, and ensure our system is highly available.

Why Do We Need Architectural Visualization?

Every time a microservice architecture is changed, it becomes more complex. Frequent architectural changes may lead to huge differences between the actual architecture and the expectations. Because of these changes, it is difficult for architects or system operations and maintenance (O&M) personnel to accurately remember the composition and interaction of all resources and instances.

  1. Architectural Problem Identification
    Based on the high-availability principle, a visual architecture diagram can help us assess possible security risks, for example, the system robustness in disaster tolerance, isolation, and self-healing dimensions. Second, some architectural link visualization tools (such as Yingyan) have greatly helped developers efficiently troubleshoot and locate problems during their actual work.
  2. System Availability Improvement
    With the upstream and downstream dependency graphs of the system architecture diagram, developers can quickly locate the source of the problem according to data dependency in the case of fault, greatly reducing the mean time to repair (MTTR). With the help of the architecture diagram, we can sort out the strong and weak dependencies in the system. We can either downgrade the weak dependencies during service peak times, or perform fault simulation for each component that the system depends on. By doing so, we can evaluate the reliability of the system as a whole in the case of local faults.

Common Architectural Visualization Practices

Many familiar architecture diagrams exist in static PowerPoint slides. While we may still be using these legacy architectural diagrams, they are often outdated after significant architectural changes. Using an outdated architecture diagram may lead to misunderstanding of the online architecture. We need to constantly update the view of the system architecture in our minds to be sensitive to any architectural changes. Big promotions or major system transformations happening each year provides us with opportunities to sort out and re-recognize the system architecture. Then we may use various tools to view the distribution of various system components, and the internal and external dependencies they have. This is the mostly commonly used method to sort out an architecture diagram. We may call it the “manual drafting method”.

Simplifying the World of Microservices and Container Technology

Microservices architecture involves developing applications as a suite of multiple independent modular services with each of them serving a unique purpose.

Microservice Overview

Microservices is a way of breaking large software projects into loosely coupled modules that communicate with each other through simple APIs.

Need of Microservices Architecture:

An independent application may have different individual modules that cater to the different business or technical needs. For a low-scale application with low complexity, the processing of overall tasks isn’t difficult when all modules are present in the same application. In fact, this improves program debugging speed and ensures a high level of execution efficiency.

Microservices Advantages

An application is made up of multiple services, where each service handles one set of tasks. In microservice architecture, these multiple services communicate with each other using web protocols, such as HTTP or JSON. Microservice advantages are:

  1. Easy-to-enhance: The code becomes easy to change, overwrite, and discard as per the requirement.
  2. Ease-of-deployment: Deployment or rollback of independent modules become easier and faster without any impact on the remaining system.
  3. Improved Fault Isolation: Failure of a single module doesn’t affect other modules present in the application.
  4. Individual Services Scalability: Demanding modules or services can be easily scaled up without any need of scaling up the whole application.
  5. Hybrid Programming Support: Gives flexibility to select the most appropriate technologies for individual services without any impact on other services.
  6. Simplified Development Process: Independent modules can be assigned to different teams/groups to make the overall development process easier and convenient.

Microservices: A silver bullet?

Although the name includes the qualifier, “micro,” its implementation requires manual efforts. If you do not have a complete understanding of the business field and are unaware of the true business needs, the management of multiple services along with numerous relevant processes becomes a daunting task. Besides, the number of processes grows when load balancing and messaging middleware are added. Management, operation, and orchestration of all these services become cumbersome. In addition, you need a DevOps expert for implementation and management of these architectures, which adds to overall overhead.

Related Courses

How to Manage Ultra Large Application with EDAS

Manage Ultra-Large-Scale application has many challenges, such as application management and monitoring, high availability, performance optimization, and system expansion .etc. This course will show you how to manage the large applications on Alibaba Cloud using EDAS which is the core product supports 99 percent of Alibaba Cloud’s large-scale application systems.

How to Achieve Automated Cloud Resource Orchestration with Terraform

This course introduces the concepts related to resource configuration & orchestration automation, and installation and configuration of the popular resource automation tool terraform. Through the actual operation demo, you will learn how to use terraform to achieve automatic configuration and orchestration of application resources based on Alibaba Cloud platform.

Related Market products

An Introduction to Microservice Architecture

Through this course, you can fully understand what a microservice architecture is and how to implement microservice architecture based on Alibaba Cloud container service.

Problem Diagnosis and Monitoring for Containerized Applications

Through this course, you will learn the basic knowledge and common tools of problem diagnosis and monitoring for containerized applications, and understand Alibaba Cloud Container Service.)

Using Swarm to Orchestrate and Manage Containers

This course aims to help IT companies who want to container their business applications, and cloud computing engineers or enthusiasts who want to learn container technology and Swarm. By learning this course, you can fully understand what a Swarm is, some key concepts of Swarm, the basic architecture of Swarm, why we need Swarm, and the basic use of Alibaba Cloud Container Service for Swarm, so as to provide reference for the evaluation, design and implementation of application containerization.

Related Documentation

Operations in Function Compute

This topic describes the basic operations in Function Compute. Function Compute allows you to quickly build an application by writing function code, meaning no server management is required. Additionally, Function Compute supports elastic scaling. You can use services on a Pay-As-You-Go basis.

Developer tools

Function Compute supports the following tools: command-line tool fcli, command-line tool fun, and console. You can use fcli or the console to build services or query logs.

Create a function

Functions are segments of application code that run a specific function, and are used in system scheduling and running. You can use the handlers provided by Function Compute to write code and then deploy the code as functions in Function Compute. Services in Function Compute correspond to the microservices in the software application architecture. When you build an application in Function Compute, you must abstract service logic into microservices as needed, and then implement the microservices as services in Function Compute.

Overview — Container Service for Kubernetes

Istio is an open platform that provides connection, protection, control and monitors microservices.

Related Products

Application Configuration Management

Application Configuration Management (ACM) allows you to centralize the management of application configurations. This makes for more convenient management of configurations and enhances service capabilities for such scenarios as microservices, DevOps, and big data. ACM’s predecessor was Diamond, the internal configuration center for Alibaba’s Taobao.

Enterprise Distributed Application Service

A PaaS platform for a variety of application deployment options and microservices solutions to help you monitor, diagnose, operate and maintain your applications

Original Source:

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.