mysql主从复制
|
@ -3,7 +3,7 @@
|
|||
### 小型电商网站的商品详情页系统架构
|
||||
小型电商网站的页面展示采用页面全量静态化的思想。数据库中存放了所有的商品信息,页面静态化系统,将数据填充进静态模板中,形成静态化页面,推入 Nginx 服务器。用户浏览网站页面时,取用一个已经静态化好的 html 页面,直接返回回去,不涉及任何的业务逻辑处理。
|
||||
|
||||
![e-commerce-website-detail-page-architecture-1](/docs/img/e-commerce-website-detail-page-architecture-1.png)
|
||||
![e-commerce-website-detail-page-architecture-1](/img/e-commerce-website-detail-page-architecture-1.png)
|
||||
|
||||
- 好处:用户每次浏览一个页面,不需要进行任何的跟数据库的交互逻辑,也不需要执行任何的代码,直接返回一个 html 页面就可以了,速度和性能非常高。
|
||||
- 坏处:仅仅适用于一些小型的网站,比如页面的规模在几十到几万不等。对于一些大型的电商网站,亿级数量的页面,你说你每次页面模板修改了,都需要将这么多页面全量静态化,靠谱吗?
|
||||
|
@ -13,7 +13,7 @@
|
|||
|
||||
用户浏览网页时,动态将 Nginx 本地数据渲染到本地 html 模板并返回给用户。
|
||||
|
||||
![e-commerce-website-detail-page-architecture-2](/docs/img/e-commerce-website-detail-page-architecture-2.png)
|
||||
![e-commerce-website-detail-page-architecture-2](/img/e-commerce-website-detail-page-architecture-2.png)
|
||||
|
||||
|
||||
虽然没有直接返回 html 页面那么快,但是因为数据在本地缓存,所以也很快,其实耗费的也就是动态渲染一个 html 页面的性能。如果 html 模板发生了变更,不需要将所有的页面重新静态化,直接将数据渲染进最新的 html 页面模板后响应即可。
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 143 KiB |
Before Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 114 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 29 KiB |