-2
$\begingroup$

In what king of application, in which we insert or delete objects, we always delete the oldest one (the least recently stored, more precisely which was the first object stored) ?

$\endgroup$
2
  • 1
    $\begingroup$ What research have you done? Where did you look? Can you be more specific about what you consider an application, since you used the databases tag only. One obvious example is the LRU (for Least recently used) page replacement algorithm. This is also used in cache systems in general, and specifically for databases. $\endgroup$
    – babou
    Commented Aug 8, 2015 at 15:06
  • $\begingroup$ In any application that uses a queue. $\endgroup$
    – babou
    Commented Aug 8, 2015 at 15:11

2 Answers 2

3
$\begingroup$

There are plenty such applications. To give some examples:

  • (windowed) data streams: Assume a sensor that sends new data every second. You want to know the average of the last minute. You keep the latest 60 elements. Every time you get a new element, the 61-st old element belongs to the previous minute, and you then delete it.

  • queue: when each elements is a task, and you service them in a FIFO manner, then each time you service a task you delete it. The FIFO ordering guarantees you always deletes the oldest task.

  • staleness: when space is limited (e.g., in cache memory), when you wish to remove old items in order to make room for a new one, a good heuristic is to remove the oldest accessed element, as it got "stale" and has low probability to be accessed again.

I'm sure there are plenty other examples, but your question is too general to answer. Feel free to edit it if you wish a more specific answer.

$\endgroup$
1
  • $\begingroup$ Thanks for your answer. Your first example is OK for me. I'm looking for an application in which we delete the oldest object stored. $\endgroup$
    – user7060
    Commented Aug 9, 2015 at 18:38
2
$\begingroup$

You do not define what you mean by oldest. In a cache system, the oldest object may be the one that was first to be introduced in the cache, or the the least recently updated, or the least recently used. This is a fair interpretation since an item that is used is to be loaded when used, if not already in.

So a possible answer would be a cache operating under the LRU strategy, for "Least recently used". It may be a virtual memory cache, or a web cache for example.

Obvious answers are all systems using a FIFO memory, i.e. a queue.

An other example could be a running average on some function, for example when you control the noise bandwidth by averaging the $n$ last measurements, according to some formula.

Another possible example, though probably not best, is a backup systems where you keep only the most recent version.

$\endgroup$
1
  • $\begingroup$ Thanks. This is your first example " the oldest object may be the one that was first to be introduced in the cache" which interests me ! $\endgroup$
    – user7060
    Commented Aug 9, 2015 at 18:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.