Monolithic Fine-grained

42

Transcript of Monolithic Fine-grained

Page 1: Monolithic Fine-grained
Page 2: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

应用程序现代化架构及治理

杨历,AWS 解决方案架构师

分 会 场 五 : 现 代 应 用

Page 3: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

SOA

Coarse-grained

Microservices

Fine-grained

Monolithic

Single Unit

应用程序架构演变

Page 4: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS 良好架构框架

Page 5: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

现代应用的最佳实践

• 大胆实验

• 应用程序组件化

• 快速更新应用程序和基础设施

• 建模和预配应用程序资源

• 简化基础架构管理

• 提高应用程序性能

• 保护整个应用程序生命周期

Page 6: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

现代应用的最佳实践

• 大胆实验 …… 创造所有权的管理文化

• 应用程序组件化 …… 微服务化

• 快速更新应用程序和基础设施 …… 自动化发布管道

• 建模和预配应用程序资源 …… 基础设施即代码

• 简化基础架构管理 …… 无服务器技术

• 提高应用程序性能……提高可见性

• 保护整个应用程序生命周期 …… 自动化的安全手段

Page 7: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

现代应用的最佳实践

• 大胆实验 …… 创造所有权公司的文化

• 应用程序组件化 …… 微服务化

• 快速更新应用程序和基础设施 …… 自动化发布管道

• 建模和预配应用程序资源 …… “基础设施及代码”

• 简化基础架构管理 …… 无服务器技术

• 提高应用程序性能……提高可见性

• 保护整个应用程序生命周期 …… 自动化的安全手段

Page 8: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Do one

thing well独立性

去中心化

黑盒子

多种语言

独立创建,运行

微服务架构的特征

Page 9: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

核心要素 Dubbo Spring Cloud

服务注册中心 Zookeeper, Redis Spring Cloud Netflix Eureka

服务调用方式 RPC REST API

服务网关 Spring Cloud Netflix Zuul

断路器 Spring Cloud Netflix Hystrix

分布式配置 Spring Cloud Config

分布式追踪系统 Spring Cloud Sleuth

消息总线 Spring Cloud Bus

典型的微服务开发框架

Page 10: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EC2 Containers AWS LambdaOn-Premises

Weeks Minutes Seconds Milliseconds

基础架构扩展的敏捷性

Page 11: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EC2 Containers AWS LambdaOn-Premises

Low High Higher Highest

基础设施利用率

Page 12: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS 容器服务全景图

管理

容器化应用的部署、调度、扩容和管理

主机

容器在何处运行

镜像仓库

容器镜像仓库

AWS Cloud Map AWS App Mesh

Amazon Elastic Kubernetes Service

Amazon Elastic Container Service

Amazon Elastic Compute Cloud

AWS Fargate

Amazon Elastic Container Registry

应用网络

服务发现,服务网格

Page 13: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon ECS—Task & Service

EC2 INSTANCES

LOAD

BALANCER

InternetECS

AGENT

TASK

Container

TASK

Container

ECS AGENT

TASK

Container

TASK

ContainerAGENT COMMUNICATION

SERVICE

Amazon ECS

API

CLUSTER MANAGEMENT

ENGINE

KEY/VALUE STORE

ECS AGENT

TASK

Container

TASK

Container

LOAD

BALANCER

ECS Service

Page 14: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

SpringCloud On Amazon ECS

Au

to S

calin

g g

rou

p公网 ALB Inter ALB

WAF

WAF

前端应用

前端应用 Spring Cloud 平台服务

SPC-1 SPC-3SPC-2

UsersZuul 网关

Auth 鉴权 配置中心

Inter ALB

目标组: targetapp-1

目标组: targetapp-2

目标组: targetapp-3

目标组: targetapp-n

ECS 集群

库存 产品 客户

Container 1Container 2

Container 3 Container n

… …

数据服务

MongoDBMQ

Amazon RDS

ProxySql

ProxySql

RDS

RDS

Amazon

ElastiCache

AWS Direct Connect

内部应用

NAT

gateway

外部接口

Eureka 服务发现

Page 15: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EKS 获得 Kubernetes 认证

Kubernetes conformance

• 保证可移植性和互操作性

• 及时更新

• 支持企业级应用

Page 16: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EKS 于 2018 年 6 月正式发布,已经度过了 1 岁生日一年当中,新增 50 多项功能并在多个区域发布使用

全球可用

Page 17: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EKS 提供100%于上游 Kubernetes一致性

AWS团队贡献或管理着超过20个与Kubernetes相关的开源项目• /kubernetes

• /kubernetes/autoscaler

• /aws-labs/aws-service-operator

• /weaveworks/eksctl

• Amazon EBS, Amazon EFS, Amazon FSx CSI drivers

Amazon EKS 的主要模块已经开源• Amazon VPC CNI plugin

• AWS IAM authenticator

• Amazon EKS AMI

开源与 Amazon EKS

Page 18: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential

Amazon EKS 已经将产品路线图开源https://github.com/aws/containers-

roadmap/

Page 19: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS 托管的高可用性方案3 个可用区,3 个主节点

EKS Endpoint

Kubectl

AZ 1

Unhealthy Master

AZ 1

Master

AZ 1

Master

New Master

Page 20: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Availability

Zone 1

Availability

Zone 2

Availability

Zone 3

Auto scaling group for

On-Demand Instances

mycluster.eks.amazonaws.com

Kubectl

Workers Workers Workers

Workers Workers Workers

Workers Workers Workers

Auto scaling group for

m4.large Spot

Instances

Auto scaling group for

t2.medium Spot

Instances

Spot InstancesHorizontal Pod Autoscaler (HPA)

Cluster Autoscaler (CA)

Page 21: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

现代应用的最佳实践

• 大胆实验 …… 创造所有权公司的文化

• 应用程序组件化 …… 微服务化

• 快速更新应用程序和基础设施 …… 自动化发布管道

• 建模和预配应用程序资源 …… “基础设施及代码”

• 简化基础架构管理 …… 无服务器技术

• 提高应用程序性能……提高可见性

• 保护整个应用程序生命周期 …… 自动化的安全手段

Page 22: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

什么是“无服务器”?

无需管理基础设施 自动扩展

按价值付费 高可用以及安全

Page 23: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

无服务器是一种运作模型,它跨越许多不同类别的服务

AWS

Lambda

AWS

Fargate

Amazon

API Gateway

Amazon

SNS

Amazon

SQSAWS

Step Functions

计算

数据存储

集成

Amazon Aurora

Serverless

Amazon

S3

Amazon

DynamoDB

AWS

AppSync

Page 24: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

容器的无服务器

计算引擎

长时间运行

引入现有的代码

全面管理业务流程

AWS Fargate

现在让我们专注于计算

无服务器的事件驱动

的代码执行

短暂的

所有语言的运行时

数据源集成

AWS Lambda

Page 25: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

运作责任的对比

AWS Lambda无服务器函数

AWS Fargate无服务器容器

ECS/EKSContainer-management as a service

EC2Infrastructure-as-a-service

更多的依赖

更少的依赖

AWS 管理 用户管理

• 数据源集成• 物理硬件、软件、网络和设施• 供应

• 应用代码

• 容器编排、供应• 集群扩展• 物理硬件、主机 OS/内核、网络和设施

• 应用程序代码• 数据源集成• 安全配置和更新、网络配置、管理任务

• 容器编制控制平面• 物理硬件、软件、网络和设施

• 应用代码• 数据源集成• 工作集群• 安全配置和更新、网络配置、防火墙,管理任务

• 物理硬件、软件、网络和设施 • 应用代码• 数据源集成• 扩展• 安全配置和更、网络配置、管理任务• 供应、服务器的扩展管理和修补

Page 26: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS Fargate 的无服务器容器

使用现有代码 容器作为一级原语用于生产环境

不需要对现有代码进行任何更改,

可以使用基于 Amazon ECS 的现有

工作流和微服务

基于时间和事件的调度、网络集成、单

独的计量和计费,

本地服务发现

ISO、PCI、HIPAA、SOC 兼容

在全球 9 个区域 ( 2018 年新增 7 个) 以

秒为单位启动了数万个容器

Page 27: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

使用 AWS ECS + Fargate 完全托管的容器环境

已有代码 生产环境 强大的集成

现有代码无需更改,可与现有工作流程和基于 Amazon ECS 的微服务

配合使用

ISO, PCI, HIPAA, SOC 合规.

在全球 9 个地区 ( 2018 年 +7 个) 几秒内启动数万个容器(+7 in 2018)

与 AWS 的原生集成:网络、安全、CICD、监视和跟踪等

Fargate 每周为 AWS 客户运行数千万个容器

Page 28: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon EKS on Fargate

与现有 K8s Pod 兼容 可用于生产环境 恰当的资源与集成

You don’t need to change your

existing pods.

Fargate works with existing

workflows and services that run

on Kubernetes.

Launch pods quickly. Easily run pods

across multiple AZs for high availability.

Each pod runs in an isolated compute

environment.

Only pay for the resources you need to run

your pods.

Includes native AWS integrations for

networking and security.

Page 29: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

EKS on Fargate 架构Your EKS Cluster

running Kubernetes

Kubernetes API Server1. Create

Pod

2. Evaluate Fargate

criteria

3. Set scheduler

name on PodEKS

Fargate

Profileetcd

4. Persist

intent

Default Scheduler

Based on Scheduler

NameYour VPC

EC2 instances

Fargate VPC

Fargate EKS Agents

5. Acquire

Capacity

7. Report

Pod as

Running

EC2 instances

6. Launch Pod

containers

Page 30: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS App Mesh

一致的微服务通信

可观察性和传输控制

容器编排的兼容性

全面管理

适用于所有资源的应用级别的网络

- 现已发布

Page 31: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS X-Ray 专为现代应用程序而构建

识别对客户的影响 支持无服务器映射所有服务和临时的资源

遵循端到端交互

Page 32: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

现代应用的最佳实践

• 大胆实验 …… 创造所有权的管理文化

• 应用程序组件化 …… 微服务化

• 快速更新应用程序和基础设施 …… 自动化发布管道

• 建模和预配应用程序资源 …… 基础设施即代码

• 简化基础架构管理 …… 无服务器技术

• 提高应用程序性能…… 提高可见性

• 保护整个应用程序生命周期 …… 自动化的安全手段

Page 33: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 34: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

单体架构的开发周期

监控发布测试构建

开发者

交付管道

服务

Page 35: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

无服务器架构的开发周期开发者 服务

监控发布测试构建

交付管道

监控发布测试构建

监控发布测试构建

监控发布测试构建

监控发布测试构建

监控发布测试构建

Page 36: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Amazon 如何进行 DevOps?

让每件事都自动化

为敏捷性而分解(微服务, 2 张披萨团队)

工具标准化

基础设施即代码

确保可靠 (Belts and suspenders)

(管理, 模版)

Page 37: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

微服务 @ Amazon

面向服务的体系结构(SOA)单一目的仅通过 API 连接通过 HTTPS 连接

微服务

来源:https://twitter.com/werner/status/741673514567143424

Page 38: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

用于无服务器 CI/CD 的 AWS 开发工具

AWS CodeBuild +第三方工具

AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS X-Ray

源代码 构建 测试 部署 监控

AWS CodePipeline

Page 39: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS Developer Tools 目的是支持无服务器与微服务

支持带有 CodePipline

和 AWS

CloudFormation 的Lambda 部署

使用 AWS

CodeDeploy 支持滚动和蓝/绿Lambda 部署

支持 AWS

CodePipeline 中的Fargate 和Amazon ECS 部署

CodePipeline

支持 AWS

Config 以改进治理

CodePipeline

支持 Amazon

ECR 作为源

支持 AWS

Toolkit for

PyCharm 中的无服务器python 应用程序

使用CodeDeploy

支持 Fargate

和 ECS 的蓝/

绿部署

2016 20182017

十一月 十一月 十二月 十月 十一月 十一月

Page 40: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 41: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

提升用户的价值

构建更好的产品

更多的创新

更快速的发布功能

专注于业务逻辑

解耦软件系统

我们的目标是尽可能自动化和抽象,这样客户就可以专注于为他们的业务应用构建

我们正在见证一种范式的转变

Page 42: Monolithic Fine-grained

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.

我们希望您在这里找到感兴趣的内容!

也请帮助我们完成投票打分和反馈问卷。

欲获取关于 AWS 的更多信息和技术内容,可以通过以下方式找到我们:

感谢参加 AWS INNOVATE 2020 在线技术大会

微信订阅号:AWS 云计算(awschina)

新浪微博:https://www.weibo.com/amazonaws/

视频中心:http://aws.amazon.bokecc.com/

更多线上活动 :https://aws.amazon.com/cn/about-aws/events/webinar/

微信服务号:AWS Builder 俱乐部(amazonaws)

抖音:亚马逊云计算(抖音号:266052872)

博客:https://aws.amazon.com/cn/blogs/china/

AWS 中国账户注册

AWS 全球账户注册