Using Objekt, the RedBridge Cloud storage

(Magnus Bengtsson)

A part of our cloud offering is a object or bucket storage service, Objekt.

As a RedBridge Cloud user you have access to this service, it's cheap, highly available and fast.

Each file is replicated to 3 separate zones in our Objekt storage cluster, access to the cluster is provided using a high availability loadbalancers.

What's an Object store?

Well it's an http based file storage service, using buckets or containers to store files. Files are accessable using plain http(s) requests, let's imagine you want to store your website media files using Objekt, then they would be accessable at:

http://media.<account-name>.objekt.rbcloud.net/image.png
or:
https://<account-name>.objekt.rbcloud.net/media/image.png

Every contaner (or folder) in Objekt, has ACL's connected to it, by default all content is private, so if you want to make a container public, you must mark it as public using ACL's.

Objekt features

Objekt has number of pretty cool features available, here's a few:

  • CORS support (for cross domain java script applications)
  • The ETag with md5 hash of the stored object, this makes it easy to verify files
  • Expiring object, set an expiration date on your files, and the will only live there as long as specified
  • Segmented Object, you can split a file (Objekt supports max 5GB files in size) and then create a meta data object that will make Objekt reassmble your TB file on download
  • Metadata, add metadata tags to your objects
  • Create pseudo file directories withein a single container.

For more info checkout this blog!

Using Objekt

Objekt is based on OpenStack's Swift project. We support both an Amazon S3 compatible protocol for accessing Object as well as the native Swift protocol.

Valid urls for accessing your files are:

http://<container>.<account-name>.objekt.rbcloud.net/file.type (Only allowed for anonymous requests for public files)

https://<account-name>.objekt.rbcloud.net/<container>/file.type

https://objekt.rbcloud.net/v1/<account-name>/<container>/file.type

Once you have a RedBridge Cloud account you can access Objekt using the account information on your Cloud Services page in portal.redbridge.se:

Your account name is your <account-name>
Your username is your email address
Your api key/password is your secretkey
If you are connecting using the S3 protocol, your access key is your api key.

There are a number of both graphcal clients, commandline clients and api's available, there is even the possibility to mount Objekt as a filesystem:

  • Cyberduck: A nice cloud storage browser for Mac & Windows. Using it is quite simple, Choose to use Swift (OpenStack Object Storage):

    image0

    Server should be: objekt.rbcloud.net

    Username should be: <account.name>:emailaddress (redbridge-ab:user@domain.se)

    When asked for password or key, use your RedBridge Cloud secret key.**

    You can also choose to use the S3 compatible mode to access Objekt with Cyberduck, just supply your appikey and secretkey and point Cyberduck to objekt.rbcloud.net.

  • Commandline clients, you can use s3curl or the nice python-swiftclient:

Get stats on your account:
> swift -v -A https://objekt.rbcloud.net/auth/v1.0 -U <account-name>:user@domain.se -K <secret key> stat
StorageURL: https://objekt.rbcloud.net/v1/<account-name>
Auth Token: XXXXXXXX
   Account: XXXXXX-eb82-4194-bc8b-XXXXXX
Containers: 3
   Objects: 10
     Bytes: 96602715
Accept-Ranges: bytes
Connection: close
X-Timestamp: 1375430645.53113
X-Trans-Id: tx7c1bfa7b92e04a45ac51b6472913356b
Content-Type: text/plain; charset=utf-8

Create a new container:
> swift -v -A https://objekt.rbcloud.net/auth/v1.0 -U <account-name>:name@domain.se -K <secret key> post public

List containers:
> swift -v -A https://objekt.rbcloud.net/auth/v1.0 -U <account-name>:name@domain.se -K <secret key> list
public

Set acl's so that the container is public:
> swift -v -A https://objekt.rbcloud.net/auth/v1.0 -U <account-name>:name@domain.se -K <secret key> post -r .r:* public

Upload a file:
> swift -v -A https://objekt.rbcloud.net/auth/v1.0 -U <account-name>:name@domain.se -K <secret key> upload public ~/Downloads/PostgresApp-9-2-4-1.zip
Download the file without auth:
> wget https://<account-name>.objekt.rbcloud.net/public/Users/magnus/Downloads/PostgresApp-9-2-4-1.zip # Note that the file has a "pseudo path" set using "/" as a delimiter!

...

100%[===========================================================================================================================================>] 72,642,433  11.2MB/s   in 6.2s
2013-08-02 16:55:26 (11.2 MB/s) - ‘PostgresApp-9-2-4-1.zip’ saved [72642433/72642433]
  • API's, there is a number of api's you can use, most of the Amazon S3 api's will work (as long as the support "old style" requests, not using bucket subdomain uri's), Since we love Python here at RedBridge, here's a simple example using boto:

    In [1]: from boto.s3.connection import S3Connection
    In [2]: from boto.s3.connection import OrdinaryCallingFormat
    In [3]: conn = S3Connection(aws_access_key_id='<api key>',aws_secret_access_key='<secret key>',host='objekt.rbcloud.net',calling_format=OrdinaryCallingFormat())
    In [4]: conn.get_all_buckets()
    Out[4]: [<Bucket: Test>, <Bucket: filesystem>, <Bucket: testing>]