Skip to content
UENISHI Kota edited this page Feb 15, 2016 · 4 revisions

This page tries to describe how buckets and users are represented and stored, in Riak CS.

  • Data structure, aka schema-ish
  • How they are updated, read and managed consistent
  • Bucket metadata
  • User metadata
  • ACLs and Policies

Users

Users are represented as a record in the big one header. It is t2b'd and stored in moss.users bucket with a key represented by access key. It contains user name, display name, access key, secret key, canonical ID, the list of all buckets.

Note that there are several indexes on this, with Email, Canonical ID to guarantee uniqueness when creating a user.

Sibling resolution of user record is implemented in riak_cs_user:from_riakc_obj/2 (not exported).

Buckets

Buckets are represented as a record in user record. It also has an entry in moss.buckets bucket with a key represented by bucket name. Note that bucket ACLs and bucket policies are stored in metadata of this entry, with metadata key X-Moss-Acl and X-Rcs-Plicy respectively.

Bucket name must be unique, RFC1355 compliant.

CRUD on users and buckets

Summary: all update requests are through Stanchion. But user update is a little bit trickey - only bucket update is serialized by Stanchion.

Bucket data

  • Body: owner id
  • Metadata: ACLs and Policies

Usermeta

Nothing special afaik

ACLs and Policies

Bucket object (r_o) is updated via Stanchion.

Clone this wiki locally