Cloud Native - A New Paradigm for Mobile App Development

 

What is a Cloud Native App

The topic of cloud native has been very hot recently, and everyone has different interpretations of its concept. From my personal point of view, cloud native represents an application building methodology: how to maximize the advantages of cloud computing service model to build an elastic application at low cost and quickly. In essence, the cloud-native R&D model aims to reduce the technical risks of the business and make developers more pure and focused:

  • All operating environments are transparent and expandable on demand;
  • All R&D processes are streamlined and delivered efficiently;
  • All infrastructure is service-oriented and pay-as-you-go;

9999

                                           云原生应用

Cloud-native applications in our usual sense refer to traditional back-end applications. Containers, Microservices, and DevOps form the iron triangle of cloud-native R&D architecture. For products such as mobile apps that focus on the front-end and light the back-end, cloud native has another interpretation. Compared with traditional back-end application research and development, mobile apps have a big difference in form. The application itself is built on a heterogeneous OS platform, has many operating environment constraints, and relies on a large number of back-end service support. The continuous delivery process of the application itself also includes Many elements specific to mobile scenarios are included, such as compilation environment (iOS), compatibility testing, internal testing distribution, channel packaging, grayscale publishing, etc. From the perspective of supporting the basic environment, several core issues that cloud computing service providers need to solve for mobile apps include:

  • Cross-platform;
    mobile apps need to face multiple OS platforms, which will bring huge challenges in R&D resources and iteration cycles. The one-stop cross-platform R&D framework will help control the pace of applications entering the market and shield the impact of different OS platforms on the application.

  • Loose coupling;
    the mobile app itself is also a very large system project. Imagine the service content carried by an aircraft carrier-level app like mobile Taobao. It is the norm for dozens of teams to collaborate on one version of the iteration concurrently, so a loose The application container/scaffold of the coupled structure is the basic base for the high-speed iteration of the application.

  • Service-oriented components;
    the functions of basic components are pure, and building elastic terminal basic capabilities through cloud-based middleware and back-end services is the most cost-effective way to build software.

  • 快速迭代;
    移动App特有的流程元素决定了开源的CI/CD服务不能完全满足移动App快速迭代的场景诉求。另一方面持续交付流程与云上的后端服务存在大量的交互,云化的持续交付/研发支撑平台将会是移动App生命周期管理的终极杀器。

  • 按需扩展;
    移动App的流量波动将更剧烈和频繁,按需扩展、弹性伸缩的基础服务支撑将有助于灵活的业务运营和成本的降低。

8888

                                         云原生App架构

我们把基于上述云计算模型构建的移动App称为云原生App。在大家比较熟悉的概念中,围绕移动App衍生的一个很典型的云计算架构即Serverless。

Serverless

Serverless是当前软件架构领域非常火热的话题。从字面上看,大家或许会比较困惑,没有服务器,如何来托管服务实体?事实上Serverless是从用户视角出发的一种应用架构范式,即基于云服务的计算模型实现对业务逻辑的抽象封装、管理,而无需关心底层资源的运维管理和扩展。我们所熟知的BaaS(Backend as a Service)以及FaaS(Function as a Service)即是Serverless架构模型的实体化服务形态。比如,当你想创建一个天气服务,方便自己的应用或第三方的应用能够很方便的获取即时的天气数据时,你就可以基于FaaS + API Gateway 快速构建一个独立的天气微服务,并对外开放,这就是一种非常典型的Serverless服务场景。
Serverless架构模型的核心价值体现在三个方面:

  • 成本
    传统的研发支出模型需要预先购置一批服务器设备,并按照使用周期内的预估业务峰值来量化预算的大小,不确定性因素较多,服务器资源的空置也会带来非常巨大的成本浪费。而Serverless的架构模型则实现了按需扩展、按量付费的弹性模型,让企业成本更高效可控。由于Serverless服务粒度的进一步打细,基于高效的bin-packing算法甚至可以获得对比弹性伸缩的虚拟机集群更高的使用效率。

  • 运维
    开发者不必再关心底层计算资源的容量与日常运维问题,所有基础设施维护将会由云计算服务商负责解决并对开发者透明。

  • 效率
    细粒度的Serverless计算模型非常适用运算密集型的场景,能够低成本地实现瞬时高强度脉冲计算能力。而传统架构为这样的脉冲计算场景则需要付出高昂成本的准备工作,环境搭建、容量压测、计算存储扩容、应用上线部署等等,这些隐性的时间资源成本更佐证了Serverless的核心价值。

Serverless意图把服务运行时封装在服务本身的交付体系中,面向开发者屏蔽与业务无关的基础环境支撑细节,是你能想象到的对应用逻辑最高等级的抽象。

云原生App对比传统研发架构的收益

基于Serverless的介绍,我们应该已经能看到云原生架构范式带来的不同,接下来我们一起系统化地对比一下云原生App与传统研发模型的核心差异点。

888_

阿里云对云原生App的支持

目前国内真正能够提供云原生App完整技术栈支持的供应商并不多,绝大多数都是以BaaS形态进行服务的垂直厂商。由于缺少App研发支撑解决方案以及和IaaS层的联动,这种类型的服务无法彻底利用移动App开发强内聚的场景特性,沦为单点的工具支撑,为开发者带来的效率提升也是相对有限和独立的。
阿里巴巴在移动互联网领域有近7年的研发经验积累,在移动技术不断深化的同时,移动开发范式也在快速演进,以支撑整个阿里巴巴体系内移动App的快速迭代和品质保障。下图展示了阿里巴巴Cloud Native App的架构范式。除了端+云的硬能力栈支撑外,阿里巴巴也开放了包括Android/iOS平台研发规约,移动研发DevOps规约在内的一系列软能力栈。软、硬能力栈背后蕴含的是对移动行业的深层认知与理解,绝非一朝之功。

3

                                       阿里巴巴Cloud Native App Paradigm  

在阿里云平台上,我们很高兴通过ApsaraMobile(移动云)为大家开放阿里巴巴Cloud Native App的完整能力栈。阿里云ApsaraMobile(移动云)是阿里巴巴移动技术的开放平台,沉淀了阿里巴巴多年移动互联网系统架构积累,近期也和阿里百川进行了深度整合,是阿里生态移动技术与理念对外输出的主窗口。ApsaraMobile目前向开发者开放的能力如下图所示,已基本覆盖完整了云原生App的核心中轴。

5555555

                                             ApsaraMobile体系图  

跨平台UI开发框架:WEEX-based MADP(Mobile App Development Platform)

WEEX是阿里巴巴开源的跨平台移动UI开发框架,并于16年底正式捐赠给Apache基金会进行孵化。WEEX具备一次开发,三端(Android,iOS,H5)运行的能力,相对于H5来说,在使用相同的web化开发模式,保持较高的研发效率、较低的研发成本的同时,又具备接近Native的性能体验,非常适合需要快速迭代又对性能体验有一定要求的APP开发者。

移动App应用容器:Atlas

Atlas是阿里巴巴开源的Android端应用容器,提供解耦的组件化/插件化模块框架及动态化支持。帮助工程师解决在工程编码期、Apk运行期以及运维修复期面临的各种棘手问题。

  • 在工程期,实现工程独立开发,调试的功能,工程模块独立。
  • 在运行期,实现完整的组件生命周期的映射,类隔离等机制。
  • 在运维期,提供快速增量的更新修复能力,快速升级。

目前,Atlas在阿里巴巴体系内部的应用十分广泛,手淘自身超过60+业务组件、20个协作团队,以及百万行级别代码都在Atlas上运行,其快速迭代能力让应用的发布周期从每月到每周再到随时发布,在过去半年里就发布了446次。另外Atlas本身非常轻量,只有90多个类,支持大小型App开发,从大型的手淘到相对小型的阿里健康等都在使用该框,其稳定性也接受了考验,兼容Android 4.x以上系统版本。整体手淘的Crash率一直维持在万分之五左右,因为容器导致的crash占比小于百分之一。

研发支撑平台:MobileHub

对于企业而言,单纯的购买虚机替代传统的物理机仅仅实现了基础资源的云化,这是云计算最初阶的使用模式。企业互联网+的真正标志应该是研发体系的互联网化,如何通过敏捷、DevOps、容器、分布式、Serverless等互联网形态的思维和架构来真正影响企业内部的产品体系结构和研发的日常运转形态,这才是云计算更高阶的价值传递。

MobileHub是阿里巴巴多年移动互联网行业沉淀、打磨的移动App研发支撑平台,支撑了阿里巴巴数个亿级App的完整生命周期全流程管理,从项目管理、持续集成、持续构建到自动化测试、版本管理、灰度发布、监控运维、用户运营等环节,整个工作流融入了阿里巴巴在移动互联网领域的深层认知与理解,是移动App研发体系中软能力栈的几个关键元素(机制、流程、方法论)的重要载体。

移动中间件与BaaS服务矩阵

Mobile middleware and BaaS services are responsible for the support of mobile App infrastructure capabilities, and are decoupled from App business. They are suitable for helping businesses quickly complete infrastructure construction from 0 to 1 in the form of cloud services. Cloud-based mobile middleware and BaaS services are essentially the concrete realization of the mobile App Serverless architecture. ApsaraMobile divides mobile middleware into 5 specific functional domains according to the functional scope of components, as shown in the following figure.

44

                                        ApsaraMobile移动中间件服务矩阵  

For the vast majority of enterprises, the construction of middleware is not located on the core development path of the business, and lacks the original driving force for continuous and deep cultivation. Cloud services can spread the cost of basic technology research and development through large-scale services, and have absolute advantages in talent gathering, resource investment, product stability and performance, etc. important performance. Alibaba has accumulated a large number of scenario capabilities in the fields of mobile network, mobile high availability, messaging, and mobile data, which can effectively help enterprises avoid repetitive capacity building and heavy maintenance and evolution costs.

Epilogue

Mobile surpassing PC has become the largest traffic portal, and business mobilization has become one of the core strategies of almost all enterprises. How to seize the time window and bring products to the market as quickly as possible often becomes a key element that determines the final fate of products. The changes in the R&D model brought about by cloud computing are huge. For teams and enterprises in the fast-growing period, the cloud-native R&D paradigm will bring lower trial-and-error innovation costs and truly help entrepreneurship enter the "fast-moving era". In the natural evolutionary selection of the entire mobile development ecosystem, cloud native is bound to become a mainstream form.

 

 

Original link: https://yq.aliyun.com/articles/217376

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326354399&siteId=291194637