GithubHelp home page GithubHelp logo

selivandex / aerospike-client-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aerospike/aerospike-client-ruby

0.0 1.0 0.0 975 KB

Ruby client for the Aerospike database

Home Page: https://www.aerospike.com/

License: Apache License 2.0

Shell 0.46% Ruby 99.54%

aerospike-client-ruby's Introduction

Aerospike Ruby Client travis codecov gem

An Aerospike library for Ruby.

This library is compatible with Ruby 2.3+ and supports Linux, Mac OS X and various other BSDs.

Usage:

The following is a very simple example of CRUD operations in an Aerospike database.

require 'rubygems'
require 'aerospike'

include Aerospike

client = Client.new("127.0.0.1")

key = Key.new('test', 'test', 'key value')
bin_map = {
  'bin1' => 'value1',
  'bin2' => 2,
  'bin4' => ['value4', {'map1' => 'map val'}],
  'bin5' => {'value5' => [124, "string value"]},
}

client.put(key, bin_map)
record = client.get(key)
record.bins['bin1'] = 'other value'

client.put(key, record.bins)
record = client.get(key)
puts record.bins

client.delete(key)
puts client.exists(key)

client.close

More examples illustrating the use of the API are located in the examples directory.

Details about the API are available in the docs directory.

Prerequisites

Ruby version v2.3+ is required.

Aerospike Ruby client implements the wire protocol, and does not depend on the C client. It is thread friendly.

Supported operating systems:

  • Major Linux distributions (Ubuntu, Debian, Redhat)
  • Mac OS X
  • other BSDs (untested)

Installation

Installation from Ruby gems

  1. gem install aerospike

Installation from source

  1. Install Ruby 2.3+
  2. Install RubyGems
  3. Install Bundler: gem install bundler
  4. Install dependencies: bundler install
  5. Build and Install the gem locally: rake build && rake install
  6. Run the benchmark: ./tools/benchmark/benchmark.rb -u

Tests

This library is packaged with a number of tests.

To run all the test cases:

$ AEROSPIKE_HOSTS="<host:port>[,<hoist:port>]" AEROSPIKE_USER="<user>" AEROSPIKE_PASSWORD="<pass>" bundle exec rspec

Examples

A variety of example applications are provided in the examples directory.

Tools

A variety of clones of original tools are provided in the tools directory. They show how to use more advanced features of the library to reimplement the same functionality in a more concise way.

Benchmarks

Benchmark utility is provided in the tools/benchmark directory. See the tools/benchmark/README.md for details.

API Documentation

API documentation is available in the docs directory.

License

The Aerospike Ruby Client is made available under the terms of the Apache License, Version 2, as stated in the file LICENSE.

Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.

aerospike-client-ruby's People

Contributors

jhecking avatar khaf avatar wallin avatar amirrf avatar filiptepper avatar hanmd82 avatar ook avatar olegokunevych avatar oruen avatar madejejej avatar jzhua avatar prepor avatar minus10degrees avatar sullerandras avatar murphyslaw avatar kportertx avatar mtendjou avatar oleriesenberg avatar wchu-citrusleaf avatar deenbandhu-agarwal avatar jyotigithub avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.