This repository contains a collection of short, self-contained, thoroughly commented examples of applying Rama towards a variety of use cases. All of these examples can scale to millions of reads and writes per second. Without Rama, these examples would require using and operating multiple pieces of specialized infrastructure. Each example has identical Java and Clojure implementations to demonstrate the Java API and Clojure API respectively. The examples are:
- ProfileModule: Implements account registration, profiles, and profile editing. Java implementation and Clojure implementation. See the Java tests or Clojure tests for how to interact with this module to register accounts, edit profiles, and query for profile data.
- TimeSeriesModule: Implements time-series analytics for latencies of rendering URLs on a website. Java implementation and Clojure implementation. Aggregates an index of min/max/average statistics for minute, hour, day, and monthly granularities. See the Java tests or Clojure tests for how clients perform various kinds of range queries on this index.
- TopUsersModule: Implements top-N analytics on user activity in the context of an e-commerce site. Java implementation and Clojure implementation. It tracks in realtime the top 500 users who have spent the most money on the service. See the Java tests or Clojure tests for examples of querying the module.
- RestAPIIntegrationModule: Integrates a Rama module with external REST APIs. Java implementation and Clojure implementation. See the Java tests or Clojure tests for examples of using the module.
- BankTransferModule: Implements fault-tolerant funds transfer between bank accounts with cross-partition transactionality. Java implementation and Clojure implementation. See the Java tests or Clojure tests for examples of interacting with the module.
- MusicCatalogModule: Demonstrates Rama's PState migration functionality via implementation of a music catalog. Java implementation and Clojure implementation. See the Java tests or Clojure tests for examples of deploying migrations via module update.
Java tests can be run with mvn test
, or a specific test class can be run like mvn test -Dtest=ProfileModuleTest
.
Clojure tests can be run with lein test
.