Skip to main content

Redis for Java Developers

RU102J teaches students how to build robust Redis client application in Java using the Jedis client library. RU102J focus on writing idiomatic Java applications with the Jedis API, including how to work with language specific patterns for managing Redis database connections, handling errors and using standard clases from the JDK. The course material use the Jedis API directly and not any additional frameworks, so students learn the basic principles of working Redis.

  • Course Number

    RU102J
  • Classes Start

    Winter 2018/19
  • Classes End

  • Estimated Effort

    4:00/week

What you will learn

RU102J teaches students how to build robust Redis client application in Java using the Jedis client library. RU102J focus on writing idiomatic Java applications with the Jedis API, including how to work with language specific patterns for managing Redis database connections, handling errors and using standard clases from the JDK. The course material use the Jedis API directly and not any additional frameworks, so students learn the basic principles of working Redis.

What you will build

In order to get practical experience with Jedis development, as part of this course you will develop an online Java application to make bike sharing data available to end users. This project consists of three components:

  • Command-line data loading application
  • Google Map overlay generator
  • Web application for querying data

All of these components will load and query data from Redis using a data model that will be developed as part of the course. The project will involving developing with several Jedis APIs:

  • Hashes
  • Sets
  • Geospatial data
  • Transactions
  • PubSub

...and demonstrate best-practices like proper Exception/Error handling and recovery, try-with-resource blocks, and proper connection management practices.

Data Loader application

The data loading application is a Java command line application which uses Jedis to load data about the bike sharing stations from flat-files (in JSON format). The application will be designed to load the data into an empty database as well as do in-place updates of the data.

Map Overlay Generator

To help visualize and debug the data set, a second Java command line application will be developed to read station data from Redis and generate a Google map overlay file. This overlay file will generate a map overlay containing all of the bike sharing sites within a specific metro area and can be loaded into Google Maps (free account) for display.

Web Application

The third component of the system that will be built is a web application using the HttpServer class provided by the JDK. The server will implement a query API to:

  • Query metadata about a bike sharing station
  • Find sharing stations within a city
  • Find sharing stations by location (latitude and longitude)
  • Find the number of available bikes at a given station

The server will also use Redis to implement a rate-limiting system on calls (either through Lua code or the Rate-limiter module).

Course Outline

Week 1

Week 2

Week 3

  • Overview and Introduction
  • Hello Redis
  • Jedis Interface
  • Transactions, Pipelines and Concurrency Control
  • Error Handling and Robust Code
  • Development project - Part 1

Week 4

Week 5

Week 6

  • Development project - Part 2
  • Development project - Part 3
  • Modules

Week 7

  • Final Exam

Course Requirements

There are no course prerequisites for RU102J, but the course assumes the student already understands:

  • Java programming language
  • How build build and compile Java software in a shell environment
  • Redis and Redis Data Structures

The course assumes that the student is familiar with Java programming and the standard tools like Ant, Maven, Gradle used in building Java software. Students should already be familiar with Redis and Redis data structures to the level covered in RU101.

Software Requirements

  • Web Browser: Firefox 39.0+ or Chrome 43+ (Internet Explorer is currently not supported)
  • Operating System: Mac OS X 10.7+ 64-bit, Ubuntu 14.04+ 64-bit, or Windows 8+ (64-bit)
  • Access to www.youtube.com and university.redislabs.com (i.e. non-blocked access)

Course Instructor

Course Staff Image #1

Tague Griffith

Tague Griffith is the Head of Developer Advocacy at Redis Labs. At Redis Labs, he focuses on developer education, community growth, and support for the Redis community. Prior to joining Redis Labs, he worked in infrastructure engineering building several high performant Redis Systems. He holds degrees in Computer Science from Stanford University.

Enroll