Supporting capabilities of microservice 微服务的支持能力

Supporting capabilities are not directly linked to microservices, but they are essential for large scale microservices development:
Software defined load balancer: The load balancer should be smart enough to understand the changes in the deployment topology, and respond accordingly. This moves away from the traditional approach of configuring static IP addresses, domain aliases, or cluster addresses in the load balancer. When new servers are added to the environment, it should automatically detect this, and include them in the logical cluster by avoiding any manual interactions. Similarly, if a service instance is unavailable, it should take it out from the load balancer. A combination of Ribbon, Eureka, and Zuul provide this capability in Spring Cloud Netflix.
Central log management: As explored earlier in this chapter, a capability is required to centralize all logs emitted by service instances with the correlation IDs. This helps in debugging, identifying performance bottlenecks, and predictive analysis. The result of this is fed back into the life cycle manager to take corrective actions.
Service registry: A service registry provides a runtime environment for services to automatically publish their availability at runtime. A registry will be a good source of information to understand the services topology at any point. Eureka from Spring Cloud, Zookeeper, and Etcd are some of the service registry tools available.
Security service: A distributed microservices ecosystem requires a central server for managing service security. This includes service authentication and token services. OAuth2-based services are widely used for microservices security. Spring Security and Spring Security OAuth are good candidates for building this capability.
Service configuration: All service configurations should be externalized as discussed in the Twelve-Factor application principles. A central service for all configurations is a good choice. Spring Cloud Config server, and Archaius are out-of-the-box configuration servers.
Testing tools (anti-fragile, RUM, and so on): Netflix uses Simian Army for anti-fragile testing. Matured services need consistent challenges to see the reliability of the services, and how good fallback mechanisms are. Simian Army components create various error scenarios to explore the behavior of the system under failure scenarios.
Monitoring and dashboards: Microservices also require a strong monitoring mechanism. This is not just at the infrastructure-level monitoring but also at the service level. Spring Cloud Netflix Turbine, Hysterix Dashboard, and the like provide service level information. End-to-end monitoring tools like AppDynamic, New Relic, Dynatrace, and other tools like statd, Sensu, and Spigo could add value to microservices monitoring.
Dependency and CI management: We also need tools to discover runtime topologies, service dependencies, and to manage configurable items. A graph-based CMDB is the most obvious tool to manage these scenarios.
Data lake: As discussed earlier in this chapter, we need a mechanism to combine data stored in different microservices, and perform near real-time analytics. A data lake is a good choice for achieving this. Data ingestion tools like Spring Cloud Data Flow, Flume, and Kafka are used to consume data. HDFS, Cassandra, and the like are used for storing data.
Reliable messaging: If the communication is asynchronous, we may need a reliable messaging infrastructure service such as RabbitMQ or any other reliable messaging service. Cloud messaging or messaging as a service is a popular choice in Internet scale message-based service endpoints.

支持功能并不直接与微服务相关联,但它们对于大规模微服务开发至关重要:
软件定义的负载均衡器:负载均衡器应足够智能,以了解部署拓扑中的更改,并做出相应的响应。这背离了在负载均衡器中配置静态IP地址,域别名或群集地址的传统方法。当新服务器添加到环境中时,它应自动检测到这一点,并通过避免任何手动交互将它们包含在逻辑集群中。同样,如果服务实例不可用,则应将其从负载均衡器中取出。 Ribbon,Eureka和Zuul的组合在Spring Cloud Netflix中提供了这种功能。
中心日志管理:正如本章前面所述,需要一种功能来集中服务实例发出的所有日志和相关ID。这有助于调试,识别性能瓶颈和预测分析。其结果将反馈给生命周期管理器以采取纠正措施。
服务注册表:服务注册表为服务提供运行时环境,以便在运行时自动发布其可用性。注册表将是在任何时候理解服务拓扑的良好信息源。来自Spring Cloud,Zookeeper和Etcd的Eureka是一些可用的服务注册工具。
安全服务:分布式微服务生态系统需要一个中央服务器来管理服务安全性。这包括服务身份验证和令牌服务。基于OAuth2的服务广泛用于微服务安全性。 Spring Security和Spring Security OAuth是构建此功能的理想选择。
服务配置:所有服务配置都应该外部化,如Twelve-Factor应用原则中所述。所有配置的中央服务都是不错的选择。 Spring Cloud Config服务器和Archaius是开箱即用的配置服务器。
测试工具(反脆弱,RUM等):Netflix使用Simian Army进行抗脆弱测试。成熟的服务需要一致的挑战才能看到服务的可靠性,以及良好的后备机制。 Simian Army组件创建了各种错误场景,以探索故障情况下系统的行为。
监控和仪表板:微服务还需要强大的监控机制。这不仅适用于基础架构级别的监控,也适用于服务级别。 Spring Cloud Netflix Turbine,Hysterix Dashboard等提供服务级别信息。 AppDynamic,New Relic,Dynatrace等端到端监控工具以及statd,Sensu和Spigo等其他工具可以为微服务监控增加价值。
依赖性和CI管理:我们还需要工具来发现运行时拓扑,服务依赖性以及管理可配置项。基于图形的CMDB是管理这些场景的最明显的工具。
数据湖:正如本章前面所讨论的,我们需要一种机制来组合存储在不同微服务中的数据,并执行接近实时的分析。数据湖是实现这一目标的不错选择。 Spring Cloud Data Flow,Flume和Kafka等数据提取工具用于使用数据。 HDFS,Cassandra等用于存储数据。
可靠的消息传递:如果通信是异步的,我们可能需要可靠的消息传递基础结构服务,例如RabbitMQ或任何其他可靠的消息传递服务。云消息传递或消息传递即服务是基于Internet规模的基于消息的服务端点的流行选择。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值