微服务架构知识非完整梳理

单体架构

 

微服务架构

微服务架构是一种架构思想,架构就是为了解耦,实际的开发方式是分布式系统开发。

 

Java单体架构:三层架构

视图层

账单模块 Controller

用户模块

业务层

账单模块 Service

用户模块

数据层

账号模块 Dao

用户模块

 

SOA与微服务区别

微服务基本架构

微服务要素

三大指标

高可用=服务一可用用,N个9,6个9,允许宕机时间为31秒

高性能=尽量快一点,3秒内打开

高并发=系统承载能力

垂直拓展:升级配置

水平拓展:加机器

数据库水平拆分:分库、分表

数据库中间件:Apache Sharding-sphere

https://blog.csdn.net/qq_34808893/article/details/103993659

 

四大问题

1、客户端如何访问?

API网关

Zuul

  • Spring Cloud Gateway

2、服务与服务之间如何调用?

同步通讯

对外REST对内RPC

REST:HTTP

RPC:Dubbo、Thrift

https://dubbogo.github.io/dubbo-go-website/zh-cn/docs/user/quick-start.html

https://github.com/apache/dubbo-go/blob/master/README_CN.md

异步通讯

Kafka CP

https://baijiahao.baidu.com/s?id=1655359291726496245&wfr=spider&for=pc

3、服务如何治理?

注册中心:

Nacos(https://studygolang.com/articles/26329?fr=sidebar)、

Etcd、(https://blog.csdn.net/c_circle/article/details/98473421

Zookeeper、

Consul(https://www.jianshu.com/p/ce7c7b9dcf14

链路追踪:

ZipKin、

SkyWalking(https://blog.csdn.net/zhounixing/article/details/105815910

限流

4、服务挂了怎么办?

熔断机制:Sentinel、Hystrix

负载均衡

CAP理论

1、Redis中间件 —-> AP

2、RocketMQ中间件 —–> AP

3、分布式事务-2pc —-> CP

4、分布式事务-最大努力尝试 —> AP

5、Eureka —> AP

6、ES ---> AP

7、Kafka ---> CP

两地三活

 

 

Java的微服务架构生态

Spring Cloud 是一种编程模型,微服务的开发标准,一系列的接口。

Spring Cloud Netflix

https://github.com/spring-cloud/spring-cloud-netflix

https://www.funtl.com/zh/guide/Spring-Cloud-Netflix.html

Spring Cloud Alibaba

https://github.com/alibaba/spring-cloud-alibaba/blob/master/README-zh.md

https://www.funtl.com/zh/guide/Spring-Cloud-Alibaba.html

 

GO的微服务架构生态

Dubbo-go

https://github.com/apache/dubbo-go/blob/master/README_CN.md

go-micro

https://github.com/micro/go-micro

janus

https://github.com/hellofresh/janus

gatekeeper

https://github.com/didi/gatekeeper

 

K8S优势

 

阿里云ECS架构

k8s服务接入

 

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

e421083458

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值