See our books for programmers (Rails, React.js, blogging, remote)

Tomasz Rybczyński


CQRS example in the Rails app

Recently I have worked in a new project for some time. We implement an application where one functionality is to show an organization’s (tree-like) structure. The structure contains information about relations between employees. I have been thinking how to build this feature. I was wondering if I should go typical way implementing all CRUD actions. In this case I would have to generate the structure for each call. I thought It will be faster. It is a startup. So until the project is young performance is not a problem. Although after few syncs we decided to go an another way.

continue reading →

Building a React.js event log in a Rails admin panel

Recently I talked with some awesome Rails developers about the Event Sourcing. We talked about introducing ES concept in a legacy Rails applications. That conversation inspired me to write a post about our experiences with the Event Sourcing. The most important thing to remember is that we don’t have to implement all blocks related to ES at the beginning (Aggregates, Read models, Denormalizers and so on). You can implement only one pattern and improve it slowly to full an Event Sourcing implementation. This strategy will involve small steps down a long road. This is how we work in the Arkency.

continue reading →

The Event Store for Rails developers

We have experimented for some time with an Event Sourcing in our projects. This is why we released a free HTTP connector to the Greg’s Event Store written in Ruby. On the basis of earlier experiences from the one of our projects we decided to create own implementation of an Event Store. I would like to announce the first release of the Rails Event Store gem.

continue reading →

How to use Greg's Event Store from ruby

I one of a previous blog’s post I mentioned that we have to create a some tool to communicate with Greg’s ES. We did it. We created HttpEventstore gem which is a HTTP connector to the Greg’s Event Store. The reason of creating such tool was that in our projects we already use Event Sourcing and we experiment with Greg’s tool.

continue reading →

Stream pagination in Greg's Event Store

Every stream in Event Store is represented as a paged feed. This is because reading from streams based on an AtomPub protocol. A paged feed is a set of feed documents where each document contains some part of a whole data. This is very useful solution when the number of information is very large. So basically in the ES reading a stream is a process of collecting events in small portions. You can find some information about this feature in main Event Store’s documentation but in my opinion It is described very briefly. So this is why I decided to write this blog post.

continue reading →

Explaining Greg's Event Store

Event Store is a domain specific database for people who use the Event Sourcing pattern in their apps. It is a functional database which based on a publish-subscribe messages pattern. Why functional? It uses a functional language as its query language. In ES It is the Javascript. I will say something more about this later. The lead architect and designer of Event Store is Greg Young who provides commercial support for the database. I decided to create this two-part tutorial to bring the idea closer to you. I will describe issues related to Event Store in the first part and I will present some simple examples of the ES usage in the second one.

continue reading →

Fast introduction to Event Sourcing for Ruby programmers

Many applications store a current state in these days. Although there are situations where we want to see something more than a current information about our domain model. If you feel that need Event Sourcing will help you here.

The Event Sourcing is an architectural pattern which allows us to keep information about object’s state as a collection of events. These events represent modifications of our model. If we want to recreate current state we have to apply events on our „clean” object.

continue reading →

How to split routes.rb into smaller parts?

Each application created using Ruby on Rails framework has a routing engine and config/routes.rb file where we define routes paths. That file very often becomes very large in the proces of development. Each additional line makes the routing file harder to maintain. Also, searching for specific paths during the development phase becomes increasingly difficult. Currently, I work on an application in which the routing file contains about 500LOC. Quite a lot, isn’t it? The solution is very simple. All you need to do is split the file into a couple of smaller ones.

continue reading →