提交修改
19
docs/e-commerce-website-detail-page-architecture.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
## 电商网站的商品详情页系统架构
|
||||||
|
|
||||||
|
### 小型电商网站的商品详情页系统架构
|
||||||
|
小型电商网站的页面展示采用页面全量静态化的思想。数据库中存放了所有的商品信息,页面静态化系统,将数据填充进静态模板中,形成静态化页面,推入 Nginx 服务器。用户浏览网站页面时,取用一个已经静态化好的 html 页面,直接返回回去,不涉及任何的业务逻辑处理。
|
||||||
|
|
||||||
|
![e-commerce-website-detail-page-architecture-1](/docs/img/e-commerce-website-detail-page-architecture-1.png)
|
||||||
|
|
||||||
|
- 好处:用户每次浏览一个页面,不需要进行任何的跟数据库的交互逻辑,也不需要执行任何的代码,直接返回一个 html 页面就可以了,速度和性能非常高。
|
||||||
|
- 坏处:仅仅适用于一些小型的网站,比如页面的规模在几十到几万不等。对于一些大型的电商网站,亿级数量的页面,你说你每次页面模板修改了,都需要将这么多页面全量静态化,靠谱吗?
|
||||||
|
|
||||||
|
### 大型电商网站的商品详情页系统架构
|
||||||
|
大型电商网站商品详情页的系统设计中,当商品信息发生变更时,会将变更消息压入消息队列中。**缓存服务**从消息队列中消费此消息时,发现有信息发生变更,便通过调用接口,获取变更后的数据。将整合好的数据推送至 redis 中。Nginx 获取到最新的缓存数据,并且缓存到 Nginx 自己本地中。
|
||||||
|
|
||||||
|
用户浏览网页时,动态将 Nginx 本地数据渲染到本地 html 模板并返回给用户。
|
||||||
|
|
||||||
|
![e-commerce-website-detail-page-architecture-2](/docs/img/e-commerce-website-detail-page-architecture-2.png)
|
||||||
|
|
||||||
|
|
||||||
|
虽然没有直接返回 html 页面那么快,但是因为数据在本地缓存,所以也很快,其实耗费的也就是动态渲染一个 html 页面的性能。如果 html 模板发生了变更,不需要将所有的页面重新静态化,直接将数据渲染进最新的 html 页面模板后响应即可。
|
BIN
docs/img/async-replication-data-lose-case.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/img/consistent-hashing-algorithm.png
Normal file
After Width: | Height: | Size: 143 KiB |
BIN
docs/img/database-shard-method-1.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/img/database-shard-method-2.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/img/database-split-horizon.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
docs/img/database-split-vertically.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
docs/img/distributed-system-request-sequence.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
docs/img/distributed-transaction-TCC.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/img/distributed-transaction-XA.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/img/distributed-transaction-local-message-table.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/img/distributed-transaction-reliable-message.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
docs/img/dubbo-operating-principle.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
docs/img/dubbo-service-invoke-road.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/img/dubbo-spi.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/e-commerce-website-detail-page-architecture-1.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
docs/img/e-commerce-website-detail-page-architecture-2.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
docs/img/es-cluster-0.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
docs/img/es-cluster.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/img/es-index-type-mapping-document-field.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
docs/img/es-search-process.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/img/es-write-detail.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
docs/img/es-write.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
docs/img/hash-slot.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
docs/img/hash.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
docs/img/high-concurrency-system-design.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
docs/img/kafka-order-1.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
docs/img/kafka-order-2.png
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
docs/img/mq-1.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
docs/img/mq-10.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/img/mq-11.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/img/mq-2.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/img/mq-3.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/img/mq-4.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/mq-5.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
docs/img/mq-6.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/img/mq-7.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
docs/img/mq-8.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/img/mq-9.png
Normal file
After Width: | Height: | Size: 114 KiB |
BIN
docs/img/mysql-master-slave.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/img/rabbitmq-message-lose-solution.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/img/rabbitmq-message-lose.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/img/rabbitmq-order-1.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/img/rabbitmq-order-2.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/img/redis-caching-avalanche-solution.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/img/redis-caching-avalanche.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
docs/img/redis-caching-penetration.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/redis-cluster-split-brain.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/img/redis-gossip.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
docs/img/redis-junior-inconsistent.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/img/redis-master-slave-replication-detail.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
docs/img/redis-master-slave-replication.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/img/redis-master-slave.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/img/redis-redlock.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
docs/img/redis-single-thread-model.png
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
docs/img/service-invoke-road.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
docs/img/simple-distributed-system-oa.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/img/zookeeper-active-standby.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/img/zookeeper-centralized-storage.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
docs/img/zookeeper-distributed-coordination.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/img/zookeeper-distributed-lock-demo.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/img/zookeeper-distributed-lock.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/img/zookeeper-meta-data-manage.png
Normal file
After Width: | Height: | Size: 29 KiB |