Spring Cloud—一、微服务架构

2018-11-13  本文已影响0人  zuoqy

目前微服务是非常火的架构或者说概念,也是在构建大型互联网项目时采用得架构方式。

1.1、单体架构

单体架构,是指将开发好的项目打成war包,然后发布到tomcat等容器中的应用。

假设你正准备开发一款与Uber和Hailo竞争的出租车调度软件,经过初步会议和需求分析,你可能会手动或者使用基于Spring Boot、Play或者Maven的生成器开始这个新项目,它的六边形架构是模块化的,架构图如下: 架构图.png

1.2、单体架构存在的问题

1.3、什么是微服务

就目前来看,微服务本身并没有一个严格的定义,每个人对微服务的理解都不同。Martin Fowler在他的博客上是这样描述微服务的。
In short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.These services are built around business capabilities and independently deployable by fully automated deployment machinery.There is a bare minimum of centralized management of these services,which may be written in different programming languages and use different data storage technologies.
用中文表述就是,微服务架构风格是一种将一个单一应用程序开发为一组小型服务的方法,每个服务运行在自己的进程中,服务间通信采用轻量级通信机制(通常用HTTP资源API)。这些服务围绕业务能力构建并且可通过全自动部署机制独立部署。这些服务共用一个最小型的集中式管理,服务可用不同的语言开发,使用不同的数据存储技术。

1.4、微服务架构的特征

1.5、微服务架构示例

微服务架构.png
每一个应用功能都使用微服务完成。

Spring Cloud—一、微服务架构
Spring Cloud—二、Spring Cloud简介
Spring Cloud—三、使用Spring Cloud实现微服务
Spring Cloud—四、Spring Cloud快速入门
Spring Cloud—五、注册中心Eureka
Spring Cloud—六、使用Ribbon实现负载均衡
Spring Cloud—七、容错保护:Hystrix
Spring Cloud—八、使用Feign实现声明式的Rest调用
Spring Cloud—九、服务网关Spring Cloud Zuul
Spring Cloud—十、使用Spring Cloud Config统一管理微服务
Spring Cloud—十一、使用Spring Cloud Bus(消息总线)实现自动更新

demo源码

上一篇 下一篇

猜你喜欢

热点阅读