one part peopleware, one part software

Kris Leech

Software Engineer, Open source contributor, Occasional blogger, Remote worker, Father.

Found on

Avro in Ruby

- - posted in ruby | Comments

This is a short example showing the use of Avro, a data serialization format, based on JSON.

The schema is stored in the payload along with the data. This means we turn a Ruby Hash in to JSON and when deseriaized back to a Hash we get back the same value types as where in the original Hash. Unlike with the Ruby Marshall format the same can happen in other languages too.

Rescuing RecordNotFound Is Too Broad

- - posted in ruby | Comments

Because rescuing ActiveRecord::RecordNotFound rescues missing records from all models it can produce unexpected behaviour which is hard to trace.

I recommend doing yourself a favour and logging any exceptions which are rescued by not re-raised and being explicit about the model from which you want to rescue RecordNotFound using the NotFound gem.

Kafka for Ruby

- - posted in ruby kafka events | Comments

Kafka is “publish-subscribe messaging rethought as a distributed commit log”.

We are exploring Kafka for doing something which looks like Event Sourcing from Domain Driven Design.

Kafka’s performance is pretty much constant with respect to data size so retaining events forever should not present a problem.

The Little Schemer

- - posted in clojure | Comments

I’ve started reading The Little Schemer, it is a book about LISP, with a unique approach. It is presented in a question / answer format, a topic is presented in a sentence or two and then hit homne with small code examples to which you need to figure out the answer.

I already have Clojure installed so I decided to use that to try out some of the code example.

However some Clojure functions are named differently than in Scheme. Here I will record the differences as I find them.

Clojure - Arrow

- - posted in clojure | Comments

The arrow is used as a more readable way of piping a value through a number of forms, usually a function, in Clojure.