Microservices

来源:互联网 发布:java构造方法重载要素 编辑:程序博客网 时间:2024/05/21 09:21

Microservices 概览

Cost vs benefit

Microservices solve organizational problems
Microservices case technical problems

Problems solved

  • Team is too large to work effectively on shared codebase
  • Teams are blocked on other teams, can’t make progress
  • Communication overhead becomes gigantic
  • Product velocity stalled

Problems caused

  • Need well-defined business domains for stable APIs
  • No more shared DB — distributed transactions?!
  • Testing becomes really hard
  • Requires dev/ops culture: devs deploy and operate their work
  • Job (service) scheduling — manual works for a while…
  • Addressibility i.e. service discovery
  • Monitoring and instrumentation — tailing logs? Nagios and New Relic? ha!
  • Distributed tracing?
  • Build pipelines??
  • Security???

Why a microservices approach

  • Continually evolving applications
  • Faster delivery of features and capabilities to respond to customer expectations
  • Build and operate a service at scale

Why microservices

  • Build and operate a service at scale
  • Improved resource utilization to reduce costs
  • Fault isolation
  • Continuous innovation
  • Small focused teams
  • Can be written in any language and framework

What is a microservice

  • Autonomous service (服务尽量不依赖其他微服务)
    Encapsulates a scenario
    Organized around business capabilities
  • Contain code plus state (状态服务化)
    Independently versioned, deployed, and scaled
  • Interact with other microservices over well defined interfaces
    Uses protocols such as http
    Have a unique name(URL) tha can be resolved

微服务的目的是为了有效的拆分应用,实现敏捷开发和部署

原创粉丝点击