Cool tricks to do with Ruby, Rails and Pry Part 2: Binding, Awesome Print, Source Edit

10 December 2016

As helpful as George Carlin in Bill and Ted's Excellent Adventure

Part 2 is here with a few enhancements I use in my day to day development, researching and code audits for Ruby and Rails. Check out the first part as well; there’s always more to learn.



Read More...

Use Heroku Local to Maintain 12 Factor Parity for Your Rails Application

09 December 2016

12 Factor Environment Parity; keep all your application environments the same with Heroku Local.

In a few previous articles, ( Solr on Rails, Efficiently Run and Maintain Your Rails Application, Running Rails Apps Simultaneously During Development) I’ve recommended using Foreman to run your Rails applications in order to maintain the best development and production parity. However, it would appear that out of habit, I’ve been wrong on this for the last year, as Heroku has replaced Foreman in the toolbelt with Heroku Local).

So, still keep your Procfiles the same, but launch them with heroku local -fProcfile.dev rather than foreman start -fProcfile.dev.

One noticeable improvement is that Heroku Local is more verbose about your .env file on boot, which is fantastic.

Verbose .env parsing

I’ve had a few days that started out poorly because of a typo in my .env that snuck in and completely killed a few hours hunting down invisible bugs that didn’t exist. As a side note, when that happens, step back after a few minutes, take a breather and down an espresso. You’ll come back much clearer.

I noticed this deviance in my current behavior when I was about to sit down and write an article on the importance of knowing and abiding by the 12 Factors. Instead, I found a few seconds in that my own Factor X had slipped. Best to publicly remedy it in case anyone else read it in past articles of mine.

Read More...

Development Tools, SRP, Demeter, Architecture and Putting Code and Functionality Where it Belongs

05 December 2016

Dirty, but damn good at what it does.

Avoid Dirtying Your Models For Performance Improvements

A common thread I’ve seen, especially when going through older apps, are model attributes where they don’t belong. I’ve noticed the intent or reasoning behind this comes in two flavors, performance based, and convenience based. It’s important to remember that we have different tools to solve different problems. Let your relational database handle attributes on the model they belong in, and use other tools for convenience and speed. What follows are my thoughts on both refactors and greenfield designs in order to keep your data where it belongs. In the end, it all ties together and keeps things simpler, more powerful, and most importantly, quicker, both in the short and long term.

Read More...

Fix Elasticsearch 2.x to 1.7 Downgrade Issue: unexpected field in shard state index_uuid

05 December 2016

The Issue

While booting up a client’s app locally, I ran into the following from Elasticsearch:

[ERROR][gateway.local.state.shards] [Kymaera] failed to read local state (started shards), exiting...
org.elasticsearch.ElasticsearchException: unexpected field in shard state [index_uuid]
{1.7.6}: Initialization Failed ...
1) ElasticsearchException
  NullPointerException2) ElasticsearchException[unexpected field in shard state [index_uuid]]
  CorruptStateException[unexpected field in shard state [index_uuid]]

Some quick searching led me to this github issue.

Unfortunately, following their approach (simply delete your ES data), failed for me. What follows is a simple, but more complete fix which took care of my problem. This is on an OS X El Capitan install; the error came from an ES 2.1 install I had, which caused problems when I did the following:

Read More...

Bansai.io Elasticsearch 5 Capabilities, Release Date

04 December 2016

Bonsai.io logo, a One More Cloud company

So far, I’ve found my favorite challenges in development and consulting all focus on performance; whether it’s building something from scratch that scales, or taking an older system and bringing it up to speed. A common thread throughout is using a cache or search service to tremendously boost speed. My first foray was with Solr, when I used it to achieve a 1588x speed increase for a client’s reports.

A similar product is Elasticsearch, and since I favor Heroku, Bonsai is my go to provider. Elasticsearch 5 was recently released, which offers some great performance increases and new features. I wasn’t able to find any official word from Bonsai about ES 5 offerings, so I reached out to them, and quickly received a response from their team, saying they do offer it.

I’m writing this in the hopes that anyone else looking for that information is able to find a suitable answer here for availability:

  • Private Elasticsearch instances: ES 5 is available
  • Public/Shared Elasticsearch instances: ES 5 will be available in Q1

If you’re like me, and enjoy spending your time making things go fast, you’ll be happy to know that this newest release of Elasticsearch will soon be available on a fantastic provider.

Read More...

Previous Page: 4 of 10 Next