Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aerospike/aerospike-client-ruby
Ruby client for the Aerospike database
https://github.com/aerospike/aerospike-client-ruby
aerospike database-driver nosql ruby
Last synced: 3 days ago
JSON representation
Ruby client for the Aerospike database
- Host: GitHub
- URL: https://github.com/aerospike/aerospike-client-ruby
- Owner: aerospike
- License: apache-2.0
- Created: 2014-10-14T07:01:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-22T19:36:54.000Z (2 months ago)
- Last Synced: 2024-12-14T23:02:55.386Z (10 days ago)
- Topics: aerospike, database-driver, nosql, ruby
- Language: Ruby
- Homepage: https://www.aerospike.com/
- Size: 1.32 MB
- Stars: 61
- Watchers: 66
- Forks: 40
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Aerospike Ruby Client [![travis][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url] [![gem][gem-image]][gem-url]
[travis-image]: https://travis-ci.org/aerospike/aerospike-client-ruby.svg?branch=master
[travis-url]: https://travis-ci.org/aerospike/aerospike-client-ruby
[codecov-image]: https://codecov.io/gh/aerospike/aerospike-client-ruby/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/aerospike/aerospike-client-ruby
[gem-image]: https://img.shields.io/gem/v/aerospike.svg
[gem-url]: https://rubygems.org/gems/aerospikeAn Aerospike library for Ruby.
This library is compatible with Ruby 2.3+ and supports Linux, Mac OS X and various other BSDs.
- [Aerospike Ruby Client ](#aerospike-ruby-client---)
- [Usage:](#usage)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Installation from Ruby gems](#installation-from-ruby-gems)
- [Installation from source](#installation-from-source)
- [Tests](#tests)
- [Examples](#examples)
- [Tools](#tools)
- [Benchmarks](#benchmarks)
- [API Documentation](#api-documentation)
- [License](#license)## Usage:
The following is a very simple example of CRUD operations in an Aerospike database.
```ruby
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.binsclient.delete(key)
puts client.exists(key)client.close
```More examples illustrating the use of the API are located in the
[`examples`](examples) directory.Details about the API are available in the [`docs`](docs) directory.
[Ruby](https://ruby-lang.org) 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 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```This library is packaged with a number of tests.
To run all the test cases:
$ AEROSPIKE_HOSTS="[,]" AEROSPIKE_USER="" AEROSPIKE_PASSWORD="" bundle exec rspec
A variety of example applications are provided in the [`examples`](examples) directory.
A variety of clones of original tools are provided in the [`tools`](tools) directory.
They show how to use more advanced features of the library to reimplement the same functionality in a more concise way.Benchmark utility is provided in the [`tools/benchmark`](tools/benchmark) directory.
See the [`tools/benchmark/README.md`](tools/benchmark/README.md) for details.API documentation is available in the [`docs`](docs/README.md) 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.