您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

构建可缩放的电子商务 Web 应用Architect scalable e-commerce web app

解决方案构想 Solution Idea

如果你想要查看我们展开本文的详细信息(实现细节、定价指南、代码示例等),请向我们提供GitHub 反馈If you'd like to see us expand this article with more information (implementation details, pricing guidance, code examples, etc), let us know with GitHub Feedback!

体系结构Architecture

2 1 7 8 9 6 5 4 3 2 1 7 8 9 6 5 4 3

用户在浏览器中访问并登录 Web 应用。User accesses the web app in browser and signs in.

浏览器从 Azure 内容分发网络中拉取静态资源(例如图像)。Browser pulls static resources such as images from Azure Content Delivery Network.

用户搜索产品并查询 SQL 数据库。User searches for products and queries SQL database.

网站从数据库中拉取产品目录。Web site pulls product catalog from database.

Web 应用从 Blob 存储中拉取产品图像。Web app pulls product images from Blob Storage.

系统将页面输出缓存在用于 Redis 的 Azure 缓存中,以实现更好的性能。Page output is cached in Azure Cache for Redis for better performance.

用户提交订单,系统将订单放入队列中。User submits order and order is placed in the queue.

Azure Functions 处理订单付款。Azure Functions processes order payment.

Azure Functions 向第三方支付并在 SQL 数据库中记录付款。Azure Functions makes payment to third party and records payment in SQL database.

数据流Data Flow

  1. 用户在浏览器中访问并登录 Web 应用。User accesses the web app in browser and signs in.
  2. 浏览器从 Azure 内容分发网络中拉取静态资源(例如图像)。Browser pulls static resources such as images from Azure Content Delivery Network.
  3. 用户搜索产品并查询 SQL 数据库。User searches for products and queries SQL database.
  4. 网站从数据库中拉取产品目录。Web site pulls product catalog from database.
  5. Web 应用从 Blob 存储中拉取产品图像。Web app pulls product images from Blob Storage.
  6. 系统将页面输出缓存在用于 Redis 的 Azure 缓存中,以实现更好的性能。Page output is cached in Azure Cache for Redis for better performance.
  7. 用户提交订单,系统将订单放入队列中。User submits order and order is placed in the queue.
  8. Azure Functions 处理订单付款。Azure Functions processes order payment.
  9. Azure Functions 向第三方支付并在 SQL 数据库中记录付款。Azure Functions makes payment to third party and records payment in SQL database.

组件Components

  • Web 应用:应用服务 web 应用在单个区域中运行,可供 Web 和移动浏览器访问Web Apps: An App Service Web App runs in a single region, accessible to web and mobile browsers
  • AZURE SQL 数据库:在云中托管的智能 SQLAzure SQL Database: Managed, intelligent SQL in the cloud
  • Azure Functions:处理包含无服务器代码的事件Azure Functions: Process events with serverless code
  • Application Insights:检测、会审和诊断 web 应用和服务中的问题Application Insights: Detect, triage, and diagnose issues in your web apps and services

后续步骤Next Steps