Chapter 6. Implementing a caching system

 

This chapter covers

  • Designing a simple cache system
  • Creating the basic application and supervision structure
  • Implementing the main functionality of the cache

Now that you’re familiar with the basics of Erlang/OTP, it’s time to move on to more advanced and realistic examples. Starting in this chapter, you’ll spend part 2 of this book building up a useful, distributed application in Erlang. To help you understand the motivations for what you’re doing, we couch this development within the narrative of an open source project called Erlware that is facing some fictional, but realistic, challenges that you’ll solve.

6.1. The background story

The Erlware project is focused on making Erlang applications easily accessible, so that others may run them either as end-user applications or as components in their own projects. Erlang is gaining popularity quickly, so the demand for easy access to open source applications and build tools has grown quickly as well. This has caused quite a bit of growth in the Erlware project, and the project administrators are starting to hear users complain about the responsiveness of the website. Most of the complaints are related to how quickly pages can be served. The Erlware team is naturally concerned about their users, not to mention that search engines like Google are rumored to punish sites that are slow to serve up pages.

6.2. The design of your cache

6.3. Creating the basic OTP application skeleton

6.4. From application skeleton to a working cache

6.5. Summary