The CRUD model is a well-known pattern in application development. In the CRUD lingo, you can Create, Read, Update, or Delete your data object. This lines up well with the Resource Access Pattern, with which many are familiar as a component of a RESTful API.
The Resource Access Pattern is very popular because of its simplicity. Writing a Resource Access Pattern on top of Riak is really simple too. Riak uses a RESTful HTTP syntax, and maps the operations to CRUD like so:
CRUD Verb | HTTP Verb | URL | Description |
---|---|---|---|
Create | PUT | /buckets/resource-type/keys/key-name | Make a new resource at the given key and store the submitted data. |
POST | /buckets/resource-type | Make a new resource and get the unique key generated for it. | |
Read | GET | /buckets/resource-type/keys/key-name | Get the resource data back for the given key. |
Update | PUT | /buckets/resource-type/keys/key-name | Store the submitted data for the given key. |