A Better Way to Search Rake Tasks

February 18th, 2016 | Conor Livingston | Development

Rake is an important part of the Ruby ecosystem. It clocks in at just over 93 million downloads on RubyGems, making it the number one most downloaded gem at the time of writing. Moreover, the Ruby community has worked together to build it—over 100 people have contributed to the project. When using Rake in a project, it is common to list rake tasks. In my experience, the typical way to do this is to use rake -T. This is the abbreviated version of the command rake --tasks. However, this is not always the right tool for the job.

Listing Tasks

Some rake tasks have long descriptions, and rake -T truncates task descriptions based on the width of the terminal window. This gives the output a clean look by avoiding line wrapping. However, if a project has tasks with long descriptions, a task’s full description is not visible using rake -T. There is a way around this. The rake -D command lists rake tasks with their full description. This is the abbreviated version of the command rake --describe. The output of this command is a formatted list of available rake tasks with their full descriptions.

Searching Tasks

At SpinDance, our Rails projects often have many custom rake tasks in addition to the standard rake tasks that come baked-in with Rails. As a part of my work, I frequently need to run rake tasks….

Read more

CouchDB Replications

February 15th, 2016 | Brian Ensink | Development

CouchDB ReplicationsA recent project required a peer-oriented distributed database and we found CouchDB 1.6.1 fit this requirement well. CouchDB is an open source no-sql document oriented database. It stores JSON documents and exposes an HTTP API for applications. CouchDB replications take an un-opinionated approach to data distribution that is partition tolerant and eventually consistent because it leaves the details of replication up to the application.

Replication Behavior

There are several important points to note about CouchDB replications.

  • Peer-to-peer. Any database can replicate to any other database without placing any restrictions on the source or destination databases and without requiring that a database cluster be configured prior to replication.
  • Uni-directional. A replication from database A to database B does not imply any kind of replication of documents form B back to A.
  • One-time or continuous. A replication from database A to database B can be done once or it can be setup as a continuous replication. The application decides and can freely mix both kinds, even for different documents within the same database.
  • Filterable. A replication can use an optional list of document IDs or provide a filter function to decide which documents should be replicated.

CouchDB gives your application the ability to decide when, where and what to replicate. This is a powerful building-block for peer-to-peer distributed applications that are struggling to work within the more opinionated replication and sharding behavior offered by other databases such as MongoDB….

Read more