Aerospike How-To's and Examples

Here you will find sample code and apps written using various Aerospike Client APIs along with other open source technologies. Take a look and learn how to leverage Aerospike’s technology in your own applications.

End-to-End Web Application

This end-to-end web application describes the design and implementation (including data modeling techniques) of a Twitter-like application called Tweetaspike and showcases effective use of Aerospike in an ecosystem of open source tech stack. It is built using — Aerospike + Express + AngularJS + Node.js and uses Socket.io for real-time notifications.

Application features: Registration, Login, Post tweets, Follow users, Unfollow users, Real-time notifications of new tweets

Code On GitHub


Step-by-Step Console Application

The purpose of this sample console application is to show that Aerospike key-value store is an effective way to write applications with Aerospike as the only database. To demonstrate, this sample app describes the design and implementation (including data modeling techniques) of a Twitter-like application. The step-by-step code is easy to follow and substantial enough to be a foundation in learning Aerospike’s technology and maybe used as a “seed” application that you can expand.

This application covers: Key-Value Operations, Queries, Secondary Indexes, Filters, User Defined Functions and Aggregations

Code In Java Code In C#


Play Framework, Java, Scala Application

Learn how to build a simple web-based To-do app using Play Framework, Java, Scala and Aerospike. The application uses a custom Play plugin to connect and disconnect from the Aerospike database once when the web server starts and stops respectively.

Application features: Create to-dos, Batch read to-dos, Delete to-dos

Code On GitHub


Node.js Starter Application

In a matter of minutes you will have built a simple web-based app using Node.js, Express and Aerospike. The application will 1) connect to the Aerospike database, 2) allow you to enter name on a web page, 3) store it, and 4) read it back from the Aerospike database and display it in the web browser.

Code In Node.js


Leaderboard

Learn how to create leaderboard of top 10 scores, or 10 most recent events, in Java using Aerospike as the data store.

Code On GitHub


Large List as a Stack, Map or Queue

Learn how to use Aerospike’s Large List (LList) to implement a stack and queue of unlimited size.

Code On GitHub


Concurrency Control Using UDFs

Learn how to leverage Aerospike’s User Defined Functions (UDFs) to control and minimize concurrency related issues in multi-user applications. To demonstrate, this sample app describes the design and implementation (including data modeling technique) of multi-user tic-tac-toe game.

Code On GitHub


Query With Multiple Filters

Learn how to leverage value-based lookups via secondary indexes along with aggregations to retrieve data based on multiple predicates.

Code On GitHub


Batch Processing

Learn how to process records in batches using Aerospike’s batch processing API.

Code On GitHub


Deleting Sets And Data

This example walks you through different options for deleting Sets and data stored in the Aerospike database.

Code On GitHub


Order By And Group By

This example walks you through code that queries a set of data stored in the Aerospike database and organizes the result using Order By and Group By clauses found in SQL.

Code On GitHub


Go Starter Application

In a matter of minutes you will have built a simple web-based app using Go and Aerospike. The application will 1) connect to the Aerospike database, 2) allow you to enter name on a web page, 3) store it, and 4) read it back from the Aerospike database and display it in the web browser.

Code On GitHub


Stock Exchange In Go

This sample application highlights features of both Go and Aerospike. It runs a simple stock exchange with multiple brokers, who can offer parcels of stock for sale and can bid on parcels.

Code On GitHub