Simplifying the World of Microservices and Container Technology

With the proliferation of online applications, their architectures need to
continuously evolve to make them stand out in the multitude of similar apps.
Applications must be highly available and resilient while running on cloud
environments. To ensure a consistent user experience, organizations need to frequently
roll out updates, even multiple times in a day. However, monolithic web
applications that serve up HTML to desktop browsers cannot cope with such
regular updates and hamper developers’ productivity.

This led to the need for a new architecture: Microservices.

Let’s see what it stands for ?


Microservice Overview

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

Microservices architecture involves developing applications
as a suite of multiple independent modular services with each of them serving a
unique purpose. Each of these services runs a particular process and
communicates internally with other modules to serve a business goal.
Let’s dig deeper and understand why microservices architecture is needed.

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.

However, as the scale of an independent application increases, these benefits
soon fade away. With business expansion
and changing needs, application backend gradually becomes too complex for
developers to manually handle and scale. You need the ability to internally
restructure your application based on changing requirements by adding,
removing, or changing modules. Dead code appears and restructuring becomes more
difficult. Minor changes may often impact the entire application. In this case,
to resize or upgrade any module, you have to resize or upgrade all modules in
the application. The program's external dependencies become increasingly
complex and the scope of automated testing falls.

To address all of these shortcomings, microservice architecture was developed.
Let’s see how they bring value to your development process and application
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:

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

Needless to
say, Microservices definitely make your life easier, but there are some
drawbacks too.

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.

As microservice architecture acts a distributed system, a certain level of
complexity gets added. Also, it can lead to several issues, including network
latency, fault tolerance, message serialization, and asynchronicity.

As the number of service instances constantly changes,
data traffic fluctuations significantly increase with the complexity of
monitoring and log analysis. There are many open source monitoring and log
solutions, but it is not easy to construct and customize a set of personalized
solutions.

This demands for an all-in-one platform to address
your non-functional needs, such as high availability, monitoring, and logs to
make it easy to implement and manage a microservices architecture.
The best way to run a microservices application architecture is to use application containers. Container
technology allows you to create a standard image from an application and its
dependencies, and use this image throughout the process from development
through testing to the production environment. DevOps fills in the gap between
development and O&M.

Alibaba Cloud, with its efficient container service,
is becoming the cornerstone for innovation and enabler for microservices
architecture.

Alibaba
Cloud Container Service: Comprehensive Platform to Create and Operate
Microservices
It is a fully managed cloud container management service that
enables you to efficiently run and manage Docker applications on a distributed
cluster of Alibaba Cloud ECS instances. It replaces the need to install,
operate, and scale your container cluster infrastructure.
In this series of articles, we will explore the use of Spring Cloud in the
creation of microservice applications on the Alibaba Cloud Container Service.

Let’s firstly explore the basics of Spring Cloud and
Netflix.

Spring
Cloud and Netflix Overview

Spring Cloud is
a project in Spring framework that provides development capabilities for common
modules in distributed systems. These capabilities are configuration management
(Config Server), service discovery (Eureka), service fusion (Hystrix),
intelligent routing (Zuul), and Netflix OSS-based encapsulations.
Using annotation statements, we can easily use Netflix open source products
in Spring
Boot
applications to create microservices
applications with production-level availability.

Building Microservices Applications: Sample Code

We
are creating a complete microservices application in a virtual scenario which
can run locally on Docker or be deployed on the Alibaba Cloud container
service. View the sample code.

Comprehending
Service-oriented Applications

In our simulated scenario, we break down an
enterprise's internal applications into multiple services and enable them to
communicate with each other via API calls.

”Foo” and ”bar” are two basic services that use an
intranet to access other services via APIs, but do not provide external service
over the Internet. “Foobar” as a single application provides external services
and must call both foo and bar services during processing.

Inter-Services
Logical Architecture Diagram

Provided by discovery-server, the service discovery
mechanism is based on Eureka. As discovery server is independent of the
business, developers can simply use Docker images.

The foobar service provides external service by registering
with the intelligent application routing gateway service. The gateway is based
on Zuul and because its code is independent of the business, developers can
simply use a Docker image. However, Zuul uses configuration files to describe
the URL access modes corresponding to different services, and developers will
need to change the image configuration files to actually use it or mount a
volume to implement configuration file sharing and modification.

The foo, bar, and foobar code contains Eureka and
Ribbon Client to provide Eureka self-registration and Eureka query
capabilities, while Ribbon implements client load balancing.

During operation, each service is elastically scaled
based on its load and may be composed of multiple running instances. During
startup, all service instances are automatically registered with the Eureka
Server. Inter-service discovery also uses the Eureka Server to fetch instance
information and select an instance to access based on the automatic decision of
the Ribbon Client. We do not use centralized load balancing, but discover and
balance load through the clients.

时间: 2024-10-04 13:39:35

Simplifying the World of Microservices and Container Technology的相关文章

Docker for SME's: Watch Out for these Five Traps

During the 18th TechDay of The Computing Conference, Qi Jun, CTO of Router Software Company Limited from Nanjing, made a presentation titled How Can Medium-sized and Small Enterprises Make Clever Use of Container Technology, sharing the company's exp

Changing the Way of Continuous Delivery with Docker (Part 1)

Introduction This post is the first part of the series "Changing the Way of Continuous Delivery with Docker" and discusses the background, challenges, and processes involving Docker. Docker is a service for reformed continuous delivery. In the s

dotCloud say PostgreSQL does not scale for High Availability on the dotCloud Platform

dotCloud是cloudControl提供的一个商业PaaS产品.  About the dotCloud Platform The dotCloud Platform is a service provided by cloudControl, Inc. The Platform launched in 2011 as the industry's first multi-language Platform as a Service. The Platform simplifies app

为什么Docker技术是企业成功的秘诀

本文讲的是为什么Docker技术是企业成功的秘诀[编者的话]本文介绍了Docker技术对企业创新和快速发展的关键性作用. 在当今日益增长的数字时代,快速创新是成功的关键. 以Uber.Spotify和Google三个公司为例,这些公司在尖端技术开发方面处于领先地位. Uber是近年来打破世界舞台的最具破坏性的玩家之一,它迅速成为服务行业的国王,在60多个国家每天运行一百万次,雇用了4000名员工. 同时,Spotify通过每天向超过6000万用户提供快速.可靠的流传输和下载服务来支配音乐领域,而

A Deep Insight of Alibaba Open Source Project - Pouch

By Allen Sun, Senior Engineer at Alibaba Group Pouch's vision is to advance container ecosystem and promote container standards OCI (Open Container Initiative), so that container technologies could become the foundation for application development in

2014 年关于开发者和云的15个预测

大数据独立软件开发商将越来越多的在分析层,驱动核心技术标准和认证进行创新. 大数据是迫使独立软件开发商在创新分析层加大力度的原因.但是独立软件开发商争相建立应用以支持许多无标准的变种的大数据基础设施的核心技术.这包括操作系统,存储基础设施,与核心大数据基础设施例如hadoop和新形态的数据库-相当于现在的LAMP栈.栈的行业标准和正式的认证建立将会创造更少的变种,独立软件开发商需要采用用于服务和支持的机制来支持这种变种.这将使得独立软件开发商的产品更快的被市场采用. -Ranga Rangach

Securing Spring Cloud Microservices With OAuth2

From Zero to OAuth2 in Spring cloud Today I am presenting hours of research about a (apparently) simple question: "How can I maintain security in my microservices architecture?". The task is to enable a simple but mighty possibility to secure sp

pipework let's assign static IP to docker container simple.

pipework是Docker工程师写的一个脚本, 主要用来管理container的网络.  用法参考 https://github.com/jpetazzo/pipework/blob/master/pipework 网友总结的5种定制docker网络的途径, pipework是其中之一 :  http://www.infoworld.com/article/2835222/application-virtualization/5-ways-docker-is-fixing-its-netwo

Continuous Deployment with Microservices

Introduction Over the last two years, I have been leading a microservices architecture team for overseas deliveries to enhance the finance system expansion for customers. My team comprises of three pairs of developers for pair programming. The team a