缓冲区和缓存的区别?

2021-09-25 00:00:00 windows sql-server

任何人都可以详细说明 - 系统内存中的缓冲区和缓存有什么区别?

Can anybody detail - What is the difference between Buffer and Cache in system memory?

推荐答案

buffer 只是一个容器,用于在任何给定时间比消费者更多的数据进入时在短时间内保存数据可以使用/处理.这是一种先进先出的情况 - 数据进来,可能会被缓冲,然后在一段时间后按照进来的顺序出去.

A buffer is just a container to hold data for a short period of time when more comes in at any given time than a consumer can use / process. It's a first-in, first-out situation - the data comes in, might be buffered, and goes out in the same order it came in, after a while.

缓存是用于加速某些操作的存储.事物被放入缓存中,并且应该从其中多次、一遍又一遍地检索.没有流经缓存"的机制——数据不会以相同的顺序进出——但它只是一个保存容器.订单可能是任何东西,真的 - 项目是通过一个键来寻址的,它们不会流过"但它们被放入"并留在那里(直到它们因为不被使用而被丢弃,或者因为系统下降).

A cache is a storage for speeding up certain operations. Things get put in a cache, and should be retrieved from it multiple times, over and over again. There's no "flowing through the cache" kind of mechanism - data doesn't come in and go out in the same order - but it's just a holding container. The order might be anything, really - items are addressed via a key, they don't "flow through" but they are "put in" and stay there (until they're thrown out because of not being used, or because the system goes down).

相关文章