微服务预想

一、写在前面:

        本文是自己通过实际探索,拜读各位大神级的文章后的一些浅见,仅供自己参考学习使用。如有侵权请及时联系我。

现在已经是微服务2.0了,serviceMesh、lstio、k8s。我们怎么切入微服务这个浪潮呢?这是我一直探索的一个问题。

1、首先要明确微服务的条件:人员配备、现有环境成熟度

  1)人员:开发是否对微服务的工作模式有一定的了解,运维要具备相对全面的运维技术,因为微服务会提高维护成本和复杂度,要具备微服务的意识,相对完善的运维规范

  2)环境:相对完善的发布、监控、容错环境,具备相对成熟的自动化运维平台。具备拆分能力(功能能够模块化)

下面给出康威定律:

  • 第一定律

    • Communication dictates design
    • 组织沟通方式会通过系统设计表达出来
  • 第二定律

    • There is never enough time to do something right, but there is always enough time to do it over
    • 时间再多一件事情也不可能做的完美,但总有时间做完一件事情
  • 第三定律

    • There is a homomorphism from the linear graph of a system to the linear graph of its design organization
    • 线型系统和线型组织架构间有潜在的异质同态特性
  • 第四定律

    • The structures of large systems tend to disintegrate during development, qualitatively more so than with small systems
    • 大的系统组织总是比小系统更倾向于分解

2、下面贴一张图:

选择一个框架很重要,java基本主流都会选择spring-cloud,在dubbo宣布对spring-cloud提供支持,spring-cloud在微服务中的地位变得更加牢固,当然如果之前采用的是dubbo的话,也可以继续沿用dubbo,由于阿里巴巴于今年启动了dubbo3.0,所以dubbo未必不是一个选择。服务注册与发现选择使用consul,服务部署简单易扩展,配置管理中心推荐使用Apollo,是由携程开源的,API网关推荐使用kong或orange,功能强大集成了nginx、openresty。有manager web页面操作方便。链路追踪推荐使用CAT或Pinpoint,相关日志收集使用ELK来做,并结合elastalert做告警通知。

上面只是大概提了一下大概会用到的技术,下面贴出github地址,后续会拆分讲解用法。

1、https://github.com/ctripcorp/apollo

2、https://github.com/alibaba/dubbo

3、https://github.com/hashicorp/consul

4、https://github.com/Kong/kong

5、https://github.com/sumory/orange

6、https://github.com/Netflix/zuul

7、https://github.com/naver/pinpoint

8、https://github.com/dianping/cat

原文地址:https://www.cnblogs.com/cuishuai/p/8392486.html