写点什么

The Micro-service design of E-commerce System

作者:David
  • 2022-11-26
    澳大利亚
  • 本文字数:1134 字

    阅读完需:约 4 分钟

Background

Suppose you are the CTO of a start-up company. The engineering team is about 30 people, including 5 front-ends and 25 back-ends. All the back-end are Java developers. Now you are going to start a small program e-commerce business from scratch.


Microservice

E-commerce is a very well-developed industry. There are so many successful patterns we can learn and borrow. We can start on the shoulders of giants. Since e-commerce is a well-developed industry and we already have a good understanding of the business domains, we can decompose our services by business domains.


Microservices Decomposition Pattern — Decompose by Subdomain



This is what the business subdomains look like. We would have:

  • Product Catalog

  • Orders

  • Inventory

  • Payment

  • Customers

  • External Forecasting


Each business subdomain will be a microservice.

Infrastructure

Core elements of a microservices architecture

For infrastructure, such as service registry, service discovery, and routing, there are different approaches.

  • Embed SDK

  • Service Proxy

  • Service Mesh


Since we are a small start-up company, we don't have many DevOps resources and a unique language small team (all use Java), Embedded SDK is the best fit.


Framework

Since we are using Java and the embedded SDK approach, we will choose Spring Cloud.

What is Spring Cloud

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer’s own laptop, bare metal data centres, and managed platforms such as Cloud Foundry.


Spring Cloud focuses on providing good out of box experience for typical use cases and extensibility mechanism to cover others.

  • Distributed/versioned configuration

  • Service registration and discovery

  • Routing

  • Service-to-service calls

  • Load balancing

  • Circuit Breakers

  • Global locks

  • Leadership election and cluster state

  • Distributed messaging

发布于: 刚刚阅读数: 4
用户头像

David

关注

还未添加个人签名 2018-03-18 加入

还未添加个人简介

评论

发布
暂无评论
The Micro-service design of E-commerce System_架构实战营_David_InfoQ写作社区