Chapter 5. Storing data—the persistence layer

This chapter covers

  • Using Anorm
  • Using Squeryl
  • Caching data

The persistence layer is a crucial part of the architecture for most Play applications; unless you’re writing a trivial web application, you’ll need to store and retrieve data at some point. This chapter explains how to build a persistence layer for your application.

There are different kinds of database paradigms in active use, today. In this chapter we’ll focus on SQL databases. Figure 5.1 shows the persistence layer’s relationship to the rest of the framework.

Figure 5.1. An overview of Play’s persistence layer

If we manage to create ...

Get Play for Scala now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.