Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Universal Binary Format 2.2 and Redis
Latest commit 576412a @norton norton Refresh edocs
Failed to load latest commit information.
ebin Initial commit
.gitignore Update rebar (2.2.0-61-g97751ec)
.travis.yml Update rebar (2.2.0-61-g97751ec)
LICENSE Update copyright

Universal Binary Format and Redis

Copyright (c) 2012-2014 by Joseph Wayne Norton

Authors: Joseph Wayne Norton (

This is UBF-REDIS, a framework for integrating UBF and the Redis Unified Format (RUF) protocol. This repository depends on the ubf open source repository.

This repository is experimental in nature - use at your own risk and please contribute if you find UBF-REDIS useful.

Quick Start Recipe

To download, build, and test the ubf_redis application in one shot, please follow this recipe:

$ mkdir working-directory-name
$ cd working-directory-name
$ git clone ubf_redis
$ cd ubf_redis
$ make deps clean compile test


Where should I start?

This README is a good first step.

The UBF User's Guide is the best next step. Check out for further detailed information.

This repository has building blocks for constructing your own Redis server clone in Erlang.

  • src/ruf.erl Redis network protocol (a.k.a. RUF) encoder/decoder

  • src/ruf_term.erl Redis raw Erlang encoder/decoder

  • src/ubf_redis_types_plugin.erl Erlang types for Redis RPC

  • src/ubf_redis_plugin.erl Erlang Redis RPC request/response pairs

The QC (a.k.a. QuickCheck, PropEr, etc.) tests underneath the "tests/qc" directory should be helpful for understanding the specification and behavior of these building blocks.

  • test/qc/ruf_tests.erl prop_ruf_requests() tests encoding and decoding of RUF requests. Test inputs are automagically generated using the above Redis RPC types.This QC test has been completed.

  • test/qc/ruf_tests.erl prop_ruf_responses() tests encoding and decoding of RUF responses. Test inputs are automagically generated using the above Redis RPC types.This QC test has been completed.

  • test/qc/redis_proxy_tests.erl tests an Erlang Redis client talking with an Erlang Redis "Proxy" server. The Redis "Proxy" server forwards all requests transparently to a "real" Redis server (using another internal Erlang Redis client). All requests and responses sent to the Redis "Proxy" server are automagically generated and checked using UBF's contract manager with the above Redis RPC types and request/response pairs.This QC test is stil in-progress.

A few "hello world" Eunit tests can also be found in the test/eunit directory.

See below for further details on how to run these tests.

What is UBF?

UBF is the "Universal Binary Format", designed and implemented by Joe Armstrong. UBF is a language for transporting and describing complex data structures across a network. It has three components:

  • UBF(a) is a "language neutral" data transport format, roughly equivalent to well-formed XML.

  • UBF(b) is a programming language for describing types in UBF(a) and protocols between clients and servers. This layer is typically called the "protocol contract". UBF(b) is roughly equivalent to Verified XML, XML-schemas, SOAP and WDSL.

  • UBF(c) is a meta-level protocol used between a UBF client and a UBF server.

See for further details.

What is Redis?

Redis is an open source, advanced key-value store. See for full details. In particular, see for a description of the Redis protocol.


For further information and help for related tools, please refer to the following links:


  • Documentation

    • Explain overall implementation and test strategy.

    • Explain relevant UBF features.

    • Explain how one can start to build their own Redis server in Erlang.

  • Testing - Black Box

    • Implement real "statem" test model for the Redis Proxy.


Something went wrong with that request. Please try again.