Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Riak: Updated Examples For "Seven Databases in Seven Weeks"

DZone's Guide to

Riak: Updated Examples For "Seven Databases in Seven Weeks"

· Java Zone
Free Resource

Just released, a free O’Reilly book on Reactive Microsystems: The Evolution of Microservices at Scale. Brought to you in partnership with Lightbend.

In my last post, I showed you how to fix an example from from the "Seven Databases in Seven Weeks" to run against Riak 1.1.4. This post shows a few more updates to the book examples to get them to run against this more current version of Riak.

  • Search Precommit: page 87 shows the command to install riak_search_kv_hook as a precommit script. Like in the last post, it must have the "language" property to work properly. Otherwise the property is not applied - and no error is returned by Riak. This is the command that works against Riak 1.1.4:
curl -i -X PUT http://localhost:8091/riak/animals -H "Content-Type: application/json" -d '{"props":{"precommit":[{"mod":"riak_search_kv_hook","fun":"precommit","language":"erlang"}]}}'
  • Server port: pages 89 and 90 show command using "localhost:8098". It should read "localhost:8091". This is actually an erratum.

  • Access secondary index: page 90 shows command how to access secondary index, but with that command, I get the error "Invalid link walk query submitted." The proper command for Riak 1.1.4 is:
curl http://localhost:8091/buckets/animals/index/mascot_bin/butler

Strategies and techniques for building scalable and resilient microservices to refactor a monolithic application step-by-step, a free O'Reilly book. Brought to you in partnership with Lightbend.

Topics:

Published at DZone with permission of Rodrigo De Castro, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}