Rails Database Best Practices

By on in Development, Rails

Working on an oldish Rails project, I came across some smelly ActiveRecord code that begged for some refactoring love. I also spent some time speeding up pages with slow/many database calls. Between those two experiences, I felt the inspiration to write-up some “Back to Basics” Rails Database Best Practices.

Rule #1: Let your Database do its Job

Databases are extremely feature rich and are really freakin fast when used properly. They’re great at filtering and sorting… and many other things. If the database can do it, it will do it way faster than doing the same thing in Ruby, or any other language for that matter.

You might have to learn a little bit about how DBs work, but honestly, you don’t have to go very deep to reap a majority of the benefits.

We generally use Postgres. What you choose is less important than getting to know it and using its features to make your product awesome. If you’re curious about Postgres, there are some good resources at the end of this post. We love it.

Our first, overarching rule: Let your database do what databases are good at, instead of doing it in Ruby.

Continue reading …


Bring clarity to your monolith with Bounded Contexts

By on in Development, Microservices, Rails

Monolithic applications are great when you start building your company, but as time progresses, they become difficult to maintain. These codebases, as they grow, easily become Big Balls of Mud.

Indiana Jones Rock

When building large applications in frameworks like Rails, the very convention-over-configuration design principles that made Rails such a joy to use begin to get in the way when the application grows in scope. You may be experiencing the same pains as well if:

  • Refactoring is difficult and tedious, because methods and classes depend on too many other classes
  • You have an ever-growing list of business objects that are difficult to keep in your head. In fact, nobody seems to be able to understand the system as a cohesive whole
  • Changing code in one area of the code leads to unexpected and unintended side effects in other areas of the code, because it’s easy to call out to global services and objects

Continue reading …


Ubiquitous Language & the joy of naming

By on in Development

I want to discuss a topic near to my heart, a topic I believe to be the crux of effective software design. No, it’s not a new functional language, it’s not a fancy new framework, it’s not a how-to guide to do micro-services, nor a quantum leap in the field of machine learning.

It’s much simpler. It’s about names.

I Declare Thee the RideCommerce Service...

Names define us. They give life to abstract ideas and concepts and yet also stand in for real, physical objects. They’re language concepts, but more than that, they’re units of meaning. When used precisely, names enable shared understanding and smooth teamwork among people. Continue reading …


Setting up React Native build environments using NativeModules

By on in Development, Everything Else, JavaScript

React Native is an emerging platform in the mobile space that allows developers to write native apps in Javascript without having to learn Java or Swift. It’s great conceptually, but developers end up having to write NativeModules (for iOS and Android) anyway because it lacks the tools that other frameworks generally provide. In this blog post, we’ll show you how to pass your build environment from the native environment to your javascript environment. In the process, you should get a better idea of how to build simple NativeModules.

Continue reading …


Open Source 101: Be a Contributor

By on in Development, Open Source

If you’ve spent anytime writing software, you’ve used an open source project. Open source projects save you time and energy by leveraging other people’s experience and hard work, leaving you free to focus on the core features of your project. Often people want to contribute to these projects, but don’t know where to start. They are afraid their contributions will be ignored or, worse yet, attacked. With tools like GitHub freely available for open source projects, anyone can become a contributor. If you follow a few simple steps, you can have a positive experience. Continue reading …


Elixir in the Trenches

By on in Development, Elixir

At Carbon Five, we’ve been getting excited about Elixir and Phoenix – with its promise of the productivity of Ruby and Rails without the performance penalty. We’ve used it for a few of our internal projects with great success, but we’re always wary of any new technology’s hype cycle. We wanted a bit more experience working with Elixir on a real project.

We recently had the opportunity to do so. The project was an iOS application that made heavy use of the device’s location services; users can share where they are and what they’re doing. We needed a backend for an API, and to keep all connected clients up-to-date. From the start, Phoenix and its channels seemed like a great fit. Today, we’d like to share some of what we learned.

Continue reading …


Services and Serverless – Carbon Five LA Talk Night August 17th

By on in Announcements, Development, Docker, Events, Los Angeles, Microservices, Ops, Web

The micro-services push is on with developers writing simpler applications that interact with each other. But how do you deploy these services? Manage versions and discoverability? Learn two approaches from our August 17th Talk Night speakers as they cover using Docker or going completely server-less with Amazon Web Services’ Lambda!

First we’ll have Samuel Chow, Head of Mobile at Farmers Insurance, give an “Intro to Docker”:

Docker has become one of the hottest technologies in the industry. But what is Docker? Why do developers love it and why might you want to use it? We will cover how it works and introduce the Docker terminology and toolset.

Then Grindr’s Principal Applications Engineer Tom Bray walks us through “Going Serverless with AWS Lambda”:

Microservices got you down? Come learn how to implement Serverless architectures with AWS Lambda and API Gateway from someone who has done it in the real world. Get a glimpse of life beyond the operational overhead that Microservices require and discover the benefits of Serverless. Decrease time to market, reduce operational cost, and let AWS Lambda handle scaling for you automatically while you only pay for the compute you use.

Our doors will open at 6pm with pizza, drinks (including non-alcoholic options), and of course wi-fi provided. The talks will kick-off at 7pm, with Q&A interspersed throughout.

So sign up on Meetup and get ready to get some macro-knowledge on building micro-services!


DIY Pokemon Go: Our Experience Building an Augmented Reality Scavenger Hunt

By on in C5 Labs, Development, Everything Else

feature

 

Thanks to PokemonGO, the streets are filled with people racing around cities, stopping to interact with virtual characters they could see through their phone camera. The experience is familiar to us at Carbon Five; 6 months ago we were doing the same thing on the streets of San Francisco playing our own augmented reality game. A game our tiny, three person team conceived, built and delivered in under a month, in and around our regular client workload!

This was no simple feat. In addition to the tight timeline, most of our day to day work focuses on mobile and web applications. Working in 3D was something only some of us have tried, with little practical experience.

So how did we do it?

Continue reading …