Detailed Design of Chubby: Part III

Let’s learn about caching and sessions in Chubby.

This lesson describes some more aspects of Chubby's design. The table below summarizes the goals of this lesson.

Lesson Summary

Section

Purpose

Caching

This helps Chubby to deal with excessive read traffic.

Session

This explains the relationship between the client and the primary replica and how a client can stay connected to the primary replica.

Caching

What if we have too many read requests? Chubby reduces the read traffic by letting Chubby clients cache locked file data and metadata of client-requested nodes in a consistent and write-throughThe data is updated both in the client's cache and main memory of the primary replica. cache in memory.

Consistency

The primary replica keeps a list of data that clients are caching and sends invalidations to the client to keep the cache consistent. The protocol ensures that a client can only get a consistent Chubby state or an error.

Maintenance

What if the data or metadata is to be changed, and a client is reading from the cache? The following process occurs.

  • The primary replica blocks the modifications and sends invalidations to clients with the relevant data cached.

  • When a client receives an invalidation, it flushes the invalidated state and acknowledges it by making a KeepAlive call (KeepAlives are discussed in detail in the next section).

  • The primary replica is notified that the client has flushed its cache from the client.

  • After that, the modification is started on the data or metadata.

While the invalidation is in progress, ...

Access this course and 1400+ top-rated courses and projects.