O'Reilly logo

Play Framework Cookbook - Second Edition by Giancarlo Inductivo, Alexander Reelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utilizing Redis

For this recipe, we will explore how Play applications integrate with Redis using Play cache. Redis is a widely used key-value database, usually utilized as an intermediary object cache for modern web applications. This recipe requires a running Redis instance that our Play 2 web application can interface with.

How to do it…

For Java, we need to take the following steps:

  1. Run the foo_java application with Hot-Reloading enabled:
        activator "~run"
    
  2. Declare Redis as a project dependency in build.sbt:
        "com.typesafe.play.plugins" %% "play-plugins-redis" % "2.3.1"
  3. Declare the repository hosting Sedis, a library dependency of play-plugins-redis in build.sbt:
     resolvers += "Sedis repository" at "http://pk11-scratch.googlecode.com/svn/trunk/" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required