An Incremental Migration from Rails Monolithic to Microservices

By on in Everything Else, Microservices, Rails, Ruby, Web

Your Rails application has become a monolith. Your test suite takes 30 minutes to run, your models grow to several hundred (or thousand!) lines, and feature development slows to a crawl. New members of your team must read through massive amounts of code before they can feel confident making changes. You’ve watched Uncle Bob’s Architecture the Lost Years, Matt Wynne’s Hexagonal Rails and read Martin Fowler’s Microservices and are convinced that the time has come to start breaking things up into smaller, simpler, faster components – but you’re unsure of where to begin.

In this article, I will demonstrate an approach to breaking a monolithic-style Rails application apart into microservices using plain Ruby classes and a simple RPC framework – all deployed to Heroku. I’ll show you how to work through this migration incrementally; you’ll be able to decompose things down as far as makes sense for your codebase. As a special bonus, I’ll show you how you can use Barrister RPC to alleviate much of the pain associated with documenting and creating API clients for the components of your now-distributed system. I’m skipping the advocacy; if you’re here it’s because you already love yourself some microservices but don’t know how to implement them yourself.

Continue reading …

New Hat Meets Old: Polyglot Distributed Systems with Barrister RPC

By on in Everything Else

Connecting the components of a distributed systems is no easy feat. Should I use REST? An RPC system like Apache Thrift? Protocol Buffers? SOAP? How do I document these components’ APIs? What’s the best way to write client bindings? The Internet offers a wide array of possible solutions, all of which I’ve found to be either incompatible with my needs (to, at minimum, work in a web browser) or heavy (XML sucks).

For the last few years, I’ve enjoyed great success using a an RPC framework called Barrister. Barrister RPC provides a variety of language bindings (Python, Ruby, browser-based JavaScript, Node.js, Go, Java, and PHP), which means that I have no problems connecting my Backbone application to a Ruby web service, or Node.js image processor to Spring MVC. Barrister separates API design from transport – so I can experiment with HTTP or SMTP or Redis queues… all without changing my API. Remote calls are encoded as JSON, so I can debug using Firefox and all the other tools I’m already familiar with. Imagine SOAP, redesigned for developers who build modern, dynamic, cloud-deployed web apps, don’t work at banks and have no stomach for enterprise service busses or XML. Continue reading …

The Junior Jump – A Retrospective

By on in Everything Else, Mentorship

One of our goals here at Carbon Five is to play a bigger part in mentoring the growing community of junior developers. Last week, we took a big step toward that goal by hosting our first ‘Junior Jump’ event in our Santa Monica office. The event, a follow up to this blog post, was centered around helping junior developers learn more about working in a professional process, and giving them tools that they would be using on day one of a real product team.


Continue reading …

A Lack of API Documentation Considered Harmful

By on in Everything Else

As someone who consumes many web service APIs – both internal and external – the recent trend in the web development community to forgo writing API documentation has got me worried. While I do understand that publishing and maintaining documentation can be a hassle, APIs with no documentation can quickly become a bottleneck in a team’s workflow, inhibiting the team’s ability to scale, outsource, or distribute themselves geographically. In this article, I’ll walk you through a partially-fictionalized version of a disastrous experience I had working on distributed system whose APIs were largely undocumented.

Continue reading …

Micromessaging: Connecting Heroku Microservices w/Redis and RabbitMQ

By on in Everything Else

While attempting to deploy a system of interconnected microservices to Heroku recently, I discovered that processes running in dynos in the same application cannot talk to each other via HTTP. I had originally planned on each microservice implementing a “REST” API – but this wasn’t going to be an option if I wanted to stick with Heroku. Much head-scratching ensued.

The solution, it turns out, is to communicate between microservices through a centralized message broker – in my case, a Redis database (but I’ll show you how do it with RabbitMQ as well, free of charge). The design of each microservice API has been decoupled from HTTP entirely: Client/server communication is achieved by enqueueing JSON-RPC 2.0-encoded messages in a list, with BRPOP and return-queues used to emulate HTTP request/response semantics. The Redis database serves as a load balancer of sorts, enabling easy horizontal scaling of each microservice (in Heroku dyno) on an as-needed basis. Redis will ensure that a message is dequeued by only a single consumer, so you can spin up a lot of dynos without worrying that they’ll clobber each other’s work. It’s pretty sa-weet.

So how’d I do it, you ask? Read on!

Continue reading …

Spring Summit Diary

By on in Everything Else

Last week all of Carbon Five converged on Santa Monica for our bi-annual Summit to talk, eat, and play together. The theme for this season’s summit was Mobile, but as expected some of the most interesting conversations ranged far afield: from the challenges and opportunities of integrating design on Agile teams, to silly employee origin stories, and a thoughtful discussion about diversity.


Following is a summary of the two-day event. If you’re curious about the presentation content, let us know and we’ll figure out a way to share the outcomes with you. More photos of the event can be found on our Facebook page.

Continue reading …

The Junior Jump – Life After Coding Bootcamps

By on in Everything Else

As a former Dev Bootcamp (DBC) student, I get a lot of inquiries from recent grads asking for tips on landing a job. I was lucky to get into the DBC early, graduating from the second cohort a year and a half ago, and the job market was quick to pick us up. However, after going through the growing pains of learning how to code in a production environment, I don’t find it too surprising that bootcamp grads now are having a harder time landing jobs.

Continue reading …

vimtronner: A Multiplayer, Command-line vim Trainer Built on Node.js and

By on in Everything Else, Web

vimtronner game play

Greetings, programs! Meet vimtronner, a multiplayer command-line game that teaches you the core vim keys. Be the last player alive by either controlling your bike safely around obstacles or building your own walls for your opponents to crash into. Just remember: you can’t do both at the same time!

You can learn how to install and play vimtronner on its Github page as well as check out its codebase. In this post we’ll walk through it’s origins and lessons learned about terminal graphics, handling input for games, efficiently routing events to interested parties and more. Continue reading …

Applying Functional Programming Principles To Your Rails Codebase

By on in Design, Everything Else, Web

All the programmers around me seem to have very strong opinions about functional programming. The Internet certainly loves to talk about it. Some of the concepts are interesting – but many of them (at first) don’t seem to apply for those of us writing database-fronting web applications. What can we apply from a world in which side effects are shunned if the majority of what our application is doing is getting stuff out of a database for display on a web page?

In this article, I’ll share some of the lessons I’ve learned writing programs in a functional style using other languages and how these lessons apply to problems of testability, predictability, and parallelism in the regular ‘ole web application code we’re writing today. I’ll show you how you can increase the quality of your existing application by introducing stateless functions that interact with the state-manipulating stuff you’re already familiar with (and have already written). This article is geared towards web application development in the real world; don’t fret, the word “monad” does not appear anywhere on this page. Continue reading …

The 6 Essential Traits of the Successful DEO (and what the heck is a DEO?)

By on in Everything Else


Rise of the DEO: Leadership by Design, an evening with Authors Maria Giudice & Christopher Ireland

On Thursday, November 14, we’re pleased to host the authors of Rise of the DEO: Leadership by Design, Maria Giudice and Christopher Ireland, in a special event discussing the role of the DEO and their place in navigating the business challenges of today.

Space is Limited: RSVP on Eventbrite

Do you have the traits of a DEO?

Continue reading …