Git Product home page Git Product logo

erlsdb's Introduction

ErlSDB README
-------------
This code is an overhaul of Shahzad Bhatti's original code (apparently not maintained anymore).

Summary
-----------
Amazon SimpleDB is a web service for running queries on structured data 
in real time. See aws.amazon.com/simpledb.
This erlsdb library provides interface to access SimpleDB web service using
REST APIs.

Author:  Shahzad Bhatti <[email protected]>
Author: Eric Cestari <[email protected]>
Version: 1.0
Date:    2009/02/23

Requirements
------------

- OTP-R12B (http://erlang.org/download.html)

- An Amazon Web Services account - See http://www.amazonaws.com


Features
---------
- Uses Signature V2
- Multiple servers are ran (default : 5)
- HTTP calls are asynchronous, per server.
- SSL support enabled by default (for deactivating see example usage below)
- Full support of the SimpleDB API version 2007-11-07

TODO
-----
- Update documentation
- Implement a type system as described by James Murty in his book

License
-------

Released under the GNU General Public License v2.

= BUILDING =

./rebar compile
sudo ./rebar install

= Configuration = 

You'll need to set your credentials to Amazon SDB :
- by passing them as OTP application parameters or
- by setting the AMAZON_ACCESS_KEY_ID and AMAZON_SECRET_ACCESS_KEY environment variable

= Running the incomplete test suite =
Set the AMAZON_ACCESS_KEY_ID and AMAZON_SECRET_ACCESS_KEY environment variables

erl -boot start_sasl -pa lib/erlsdb/ebin -pa lib/erlsdb/test/ -s erlsdb_test test -s init stop

Expected output (if you did not create any domains previously): 
Listing domains {ok,[],nil}
Creating test domain ["TestDomain"]
Adding attributes [{"City","Seattle"},
                   {"State","WA"},
                   {"StreetAddress","705 5th Ave"},
                   {"Zip","98101"}]
Removing attributes ok
Removing test domain []


= A FEW EXAMPLES = 

# SSL is deactivated in the following : 
erl -boot release_local/erlsdb-initial -erlsdb access '"<AWS_ACCESS_ID>"' secret '"<AWS_SECRET_KEY>"' ssl false
1> erlsdb:create_domain("fubar").
nil
2> erlsdb:list_domains().
{ok,["fubar"],[]}
3> erlsdb:put_attributes("fubar", "test", [{"foo", "bar"}]).
nil
4> erlsdb:get_attributes("fubar", "test").
{ok,[{"foo","bar"}]}
..
5> erlsdb:select("select count(*) from domain where toto = 'truc'",nil).
{ok,[{"Domain",[{"Count","2"}]}],nil}

6> erlsdb:domain_metadata("domain").
{ok,[{"Timestamp",1235403601},
     {"ItemCount",4},
     {"AttributeValueCount",8},
     {"AttributeNameCount",4},
     {"ItemNamesSizeBytes",24},
     {"AttributeValuesSizeBytes",20},
     {"AttributeNamesSizeBytes",19}]}
6> erlsdb:list_domains(nil,1). % paging works
{ok,["domain"],"ZnViYXI="}
7> erlsdb:list_domains("ZnViYXI=",1).
{ok,["fubar"],nil}

8> erlsdb:select("select count(*) from domain where toto = 'truc'",nil).
{ok,[{"Domain",[{"Count","2"}]}],nil}

9> erlsdb:select("select * from blobs where toto = 'truc'",nil).
{ok,[{"blob1",[{"toto","truc"},{"foo","bar"}]},
     {"blob2",[{"toto","truc"},{"foo","bar"}]}],
    nil}



erlsdb's People

Contributors

cstar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.