search
Homephp教程php手册电子商务网站比较常用的缓存策略架构,电子商务网站架构

电子商务网站比较常用的缓存策略架构,电子商务网站架构

缓存是分布式系统中的重要组件,主要解决高并发,大数据场景下,热点数据访问的性能问题。提供高性能的数据快速访问。

这次主要是分享下自己觉得比较通用的一个缓存策略的架构方案,也是比较 容易理解的.欢迎吐槽.

有更牛逼的也欢迎大家说下:

缓存是分布式系统中的重要组件,主要解决高并发,大数据场景下,热点数据访问的性能问题。提供高性能的数据快速访问。

缓存的原理

(1)       将数据写入/读取速度更快的存储(设备);

(2)       将数据缓存到离应用最近的位置;

(3)       将数据缓存到离用户最近的位置。

缓存分类

在分布式系统中,缓存的应用非常广泛,从部署角度有以下几个方面的缓存应用。

(1)       CDN缓存;

(2)       反向代理缓存;

(3)       分布式Cache;

(4)       本地应用缓存;

缓存媒介

常用中间件:Varnish,Ngnix,Squid,Memcache,Redis,Ehcache等;

缓存的内容:文件,数据,对象;

缓存的介质:CPU,内存(本地,分布式),磁盘(本地,分布式)

缓存设计

缓存设计需要解决以下几个问题:

(1)       缓存什么?

哪些数据需要缓存:1.热点数据;2.静态资源;

(2)       缓存的位置?

CDN,反向代理,分布式缓存服务器,本机(内存,硬盘)

(3)       如何缓存的问题?

  • 过期策略

1.固定时间:比如指定缓存的时间是30分钟;

2.相对时间:比如最近10分钟内没有访问的数据;

  • 同步机制

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),