Eight Years A Rubyist

Year 8 with Rails for me has been an unglamorous affair of maintenance upgrades (Ruby 2.3, Rails 5.x), refactors and bug fixes.

It has been discouraging to see StackOverflow characterize Ruby as shrinking and unpopular and compare Ruby on Rails with ASP.net. Nate Berkopec’s findings that vanilla Rails apps are perfectly capable of 1,000 requests/minute is cold comfort in the face of shrinking developer mindshare: this decline has real consequences in terms of open source contributions and Ruby gem maintenance.

On the other hand Ruby remains #4 on Github and developers are still very much in demand. JavaScript continues ascendant but Derek Prior of Thoughtbot has mentioned cooling enthusiasm for Elixir, and Go too has slid in popularity, at least according to TIOBE. Crystal 1.0 remains delayed. An experimental JIT has now shipped for YARV foreshadowing further performance improvements in Ruby 2.6.

On the Rails front end Basecamp continued their contrarian tradition by offering Stimulus.js as a more limited and pragmatic alternative to React’s dominant framework. The Majestic Monolith remains relevant for smaller businesses and early stage startups despite ambitious engineers everywhere (myself included) wanting to use the same tech stack as the largest, most successful companies from Apple, Salesforce and Netflix to… Twitter. At Railsconf GitHub, now owned my Microsoft, recommitted to easier scalability enhancements for Rails 6.

On the infrastructure side the Docker ecosystem has continued to mature with the embrace of Kubenetes at Dockercon EU in Oct ’17. It has also been good to see a more enlightened approach to open source by AWS with EKS and ApacheMQ.

At my employer we continue to support a somewhat modular monolith with a 50 kloc monorepo, 40 ActiveAdmin resources, 60 background jobs, 70 direct and 240 total gem dependencies. We have fully caught up with Rails 5.2 and edged forward with Ruby 2.3 for Bootsnap support and React-Apollo 1.x. Procedural code has continued to migrate to standardized Interactors. New gems used included Bootsnap, Combustion, Dalli (memcached) and AWS SDK v3 SQS, S3, SES & SNS.

What has Rails 5.x brought us? More secure controller parameters, still scarily subvertible by less experienced developers, but at least awareness has been raised. More restricted autoloading, for the best. Better callback management, though we try to avoid them as much as possible. Bootsnap with a significant improvement in startup times, yay!

Open source contributions this year have included a couple of minor ActiveAdmin releases including Rails 5.2 support and various PRs for the AuthorizeNet Ruby SDK.

AWS features I have been working more with this year have included ClassicLink, private subnets, piculet, Data Pipeline and managed SSL certs. Concerns over production container management have been mitigated with a mass of metrics collection with CloudWatch, Librato and Skylight.

What will the next year bring? A pragmatically managed evolution towards ‘mini-services’, Rails 6 with polished multi-database support, Ruby 2.6 with improving JIT support, Webpack as the default JavaScript handler and increasing adoption of Kubernetes.

PAYMENTSfn 2018

Spreedly’s first customer and partner conference was held in leafy Durham this year. First thing you notice is the new construction and the recovering economy: the city is still far from overdeveloped. The one-and-a-half day event drew more than one hundred attendees in the Carolina Theatre downtown. Spreedly’s growth has been accelerating since it pivoted away from hosted subscriptions a few years ago into a meta-gateway providing PCI compliant card vaulting and a standardized card payments API. Transaction volume last year tripled to around 90M, helped by key accounts like FattMerchant and SeatGeek, which recently won the ticketing business for the Dallas Cowboys. The first day featured lightening talks on feature prioritization, Riak, Elixir and Kafka, followed by open house at Spreedly’s offices, recently doubled to around 10,000sq.ft.

The second day was filled with a variety of presentations. Nate Talbott pitching to build a payments community. John Duff with a familiar history of payments at Shopify: integrations using active_merchant, compliance, scalability, partnering with Stripe for merchant services, leveraging data for fraud protection. Jennifer Marston on transitioning to Spreedly at Paylock. Nathan Adamson on the costs of EMV for small businesses. Stephanie Slattery on accessibility and Alex Henderson on ‘assured’ payments and learning to effectively work around gateway outages. Camille Acey providing a non-engineering perspective and Brad Powers of Passport on the challenges and benefits of working on local government projects. Unfortunately I had to skip Sandi Metz’s closing keynote but I look forward to catching it on Confreaks.

Railsconf 2018 – Pittsburgh

Tuesday 17 April. Snow. DHH poking fun at Twitter and raising alarms about Facebook. Nick Quaranto with a GraphQL intro: best for new APIs as a mobile backend. Sean Griffin trying to encourage Rails contributions by labeling it a legacy app. Fastly presenting their not yet released alternative to docker-compose for developers. Olivier Lacan talking about the life and imminent death of CodeSchool.com. Taylor Jones with an introductory overview of Webpacker. Akira Matsuda teasing with his unfinished performance hack gems. Mark Imbriaco with a stellar career from AOL to Decisiv, 37signals, Heroku, Living Social (with Chad Fowler), GitHub, Digital Ocean and Pivotal.

Wednesday. Eileen Uchitelle keynote on upcoming Rails 6 features for scalability: baked in parallel tests (minitest) and polished multi-database support. Initially skeptical but ultimately inspired by her appeal for more companies to upstream their work. Justin Searles and Ted Kaufman talking about growing their agency. Chris Hoffman reviewing Optoro’s experiences adopting services: start with new business services, not an extraction, do something large enough to be noticed but as simple as possible, establish infrastructure standards and have developers support their services. Exhibition hall with booths by BTCOTC, Procore, GitHub, Heroku, Engine Yard, Cloud 66, Shopify, Scribd and LendingHome amongst others. After lunch James Adam recounting his struggle to popularize Rails engines and the forces shaping the framework’s evolution. Leanardo Targon of Plataformatic with an introduction to Warden. Admin frameworks BOF discussing modular monoliths, TrailBlazer and CBRA. Lightening talks including Clearwater and jsonapi-suite

Thursday. Snow again and chill winds. Sarah Mei filling in a keynote for Bari Williams: application development is interior decorating, not architecture. Sam Phippen with another well presented RSpec talk with the latest fixes to support system tests. Graham Conzett reminding how much can still be done with UJS alone. After lunch Ariel Caplan introduction to Swagger (OpenAPI) and (unmaintained?) apivore, Michael Crismali giving a quick review of JavaScript strategies, followed by Ross Kaffenberger giving actionable advice on dealing with Webpack. Finally Aaron Patterson proposing to upstream easier performance tuning into Rails.

Attendance looked up (2,000+), and more diverse.  No more ‘Rails is dying’ and React/Elixir FOMO. Webpack/services/JSONAPI for sure, but not too much beyond that.  Standards of the technical talks were good, especially Akira and Eileen. I missed the talks by Vladimir Dementyev and Justin Weiss and I look forward to the inspiring videos of Ernie Miller and Nicolas Means.

TIOBE Index for March 2018: Ruby in the TIOBE index top 10

TIOBE replaces their index content each month, so I quote:

“Ruby is back in the TIOBE index top 10 and now it seems to be for a longer time. If we take a look at the chart of Ruby it follows a very common pattern for programming languages. Ruby was invented a very long time ago and it remained in obscurity till 2006. That was when the Ruby on Rails framework was released. This framework made it easy to create web applications and because Ruby was the underlying language it skyrocketed in the TIOBE index at that time from position 40 to a top 10 position. It also was awarded the TIOBE programming language of the year in 2006. All new language gurus were in ecstasy about Ruby. The language peaked in 2008, but then all hipsters moved to a new language and Ruby dropped to one third of its popularity. It remained there for a long time but is now catching up very slowly. The fact that it is getting more popular so gradually is a good sign. This means that its increase in popularity is structurally instead of being pushed by hypes. Some other interesting moves this month are that both Julia and Kotlin entered the top 40, whereas Rust and Groovy lost their positions in the top 50.”

Active Admin monthly downloads nearly doubled last year

According to this blog post Active Admin monthly downloads nearly doubled last year to almost 3,000 times a day.  Part of that can probably be attributed to increasing use of continuous integration, but more interesting is that Active Admin has outpaced the competition. Possible contributing factors include three releases, including a 1.0 release that coincided with RailsConf and was featured by Ruby Weekly, a GoRails episode by Chris Oliver at the end of 2016, and the blog post by Charlie Gleason on using Active Admin as a back end to a React application, that has been discovered and tweeted by new fans repeatedly. I’ld love to think that timely responses to GitHub issues and pull requests and StackOverflow answers have helped also, along with the curated wiki and continuing contributions by plugin authors. Also there have been Japanese blog posts and activity so more adoption there. At this point Active Admin has 7,800 GitHub stars and 2.9M downloads, it will interesting to see how things are another year from now.

RubyConf 2017

Rubyconf 2017 was held this year in New Orleans.  There were nearly 60 keynotes and presentations from four tracks over three days.
Wednesday 15 November. Opening keynote from Matz, cautious of making any divisive changes to Ruby now that it is nearly 25 years old.  Significant progress this year on a register based VM rewrite that should result in ambitious performance improvements.  Unicode 10 support due this year in Ruby 2.5, but features such as frozen strings by default, tail recursion optimization, guilds and type support are still on hold pending more community feedback.
Minqi Pan with an wildly innovative approach to packaging application binaries using a custom Ruby integrated with a virtual file system.
Triptych of presentations on the future of Ruby by Justin Searls, Jason Charnes and Eric Weinstein.  First Justin with a retrospective of influential Ruby conference presentations, then Jason with a bedtime story exhorting rubyists to study other ecosystems, maintain gems and teach; finally Eric touching on Crystal, Opal, WebAssembly and Guilds.
Closing keynote by Chad Fowler as entertaining as ever, drawing on his polyglot experience at Wunderlist to suggest that to build systems that will last use cells that can easily be replaced.
Thursday. Kevin Deisz exploring the Ruby 2.3 API underpinning BootSnap compilation caching, writing his own compiler macros and a math macro language targeting YARV.  Daniel Azuma of Google demonstrating how surprisingly simple it is to build a command line Ruby debugger with the TracePoint API. Andrew Metcalfe of Stripe discussing the challenges of performing static analysis on a 1M lines of Ruby spaghetti and how to leverage Ruby autoload without Rails. Evening lightning talks including Cameron Dutro, Noah Gibbs and Akira Matsuda.
Friday. Another inspring keynote by Sandi Matz: teamwork requires being your best self.  Aaron Patterson’s ‘impossible’ compacting garbage compiler with savings unknown. Yusuke Endo demonstrating his obfuscated quines. Tekashi Kokubun trying to explain the many complexities and tradeoffs of YARV-MJIT.
In summary Ruby is a mature and constrained language: performance improvements will continue but new feature adoption will be conservative. Ruby will continue to face increased competition, but its focus on programmer productivity keeps it relevant.

Arbre vs React

Arbre is a component based server side DOM rendering library written in Ruby.  Arbre was extracted from Active Admin from 2011-2012  but has not gained widespread use elsewhere.  As of September 2017 there were around 4M downloads to date from RubyGems and barely 450 stars on GitHub.

class Panel < Arbre::Component
  builder_method :panel

  def build(title, attributes = {})
    super(attributes)

    h3(title, class: "panel-title")
  end
end

React is a component based isomorphic DOM rendering library written in Javascript.  npm downloads have reached 40M in the past couple of years and the project has 75,000 stars on GitHub: it’s no contest really.  If you prefer Ruby over ES6 an Opal wrapper is available as hyper-react .

class App < Hyperloop::Component
  render(DIV) do 
    MainNavigation {} 
    PageContents {} 
    Footer {} 
  end
end

The APIs for both are relatively simple.

Arbre has builder_method to register components.  Each component has a build method which adds tags to an Arbre::Context that is eventually output using to_s.

React components have a render method that adds elements to a virtual DOM that is synchronized with the browser DOM as needed.

The most obvious difference is that Arbre does not integrate Javascript event handlers: it uses an unobtrusive approach that leaves registering event handlers to accompanying ES6/Coffeescript/Opal files.

Being exclusively server-side means that Arbre can and has been used with ActionView helpers and templates.  There are bugs but it mostly works.  Arbre is relatively simple and provides what Active Admin needs without further dependencies.

React components are careful about maintaining state and re-render when state is changed.  Arbre components get re-instantiated for each request and are more ad hoc.

Is anything to be learned from this comparison?  The prospects of widespread adoption of Arbre are slim to none.  An increasing number of developers are going to be looking to use a Rails admin framework with React, and that is where opportunity lies.

TIOBE Index for August 2017: A new set of languages is gaining ground…

TIOBE replaces their index content each month, so I quote:

“The top programming languages are in a long term decline: both Java and C have all time low scores in the TIOBE index. And almost all of the other top 10 languages are going down as well year to year. So what languages are taking advantage of this? It is all happening down in the charts around position 40. A new set of languages is gaining ground, notably Crystal (#32), Kotlin (#41), Clojure (#42), Hack (#43) and Julia (#46). Especially Crystal with its jump from position 60 to 32 in one month is doing very well. The Crystal programming language is a statically typed Ruby variant. Since it is compiled it is superfast and has a small memory footprint without losing the feeling of being easy to use. It seems worthwhile to give it a try.”

Year 7 with Rails

In my seventh year with Rails I started allocating ’20% time’ to maintenance of Active Admin and related open source gems.  As the universe of web technologies continues to expand and fragment there has been increasing acknowledgement at GitHub and elsewhere of the stresses on volunteer contributors and the consequent rise in the number of projects falling into disrepair.  Active Admin at least now has an official 1.0 release and timely support for Rails 5.1.
On the plus side competition and the exodus from Rails has brought back innovation, most notably Rails 5.1’s integration of NPM, Yarn and Webpack.  Beyond Rails in the wider Ruby community an object-functional style of programming is gaining popularity, championed by dry-rb and embraced by Hanami and Trailblazer.
This year has been one of considerable progress (and hype) around containers and microservices.  Microservices are not without tradeoffs but Docker containers have proven themselves useful in both development/CI and production.
At my employer our codebase has reached 50kloc, now 60% componetized into gems, but a new joint venture has doubled our infrastructure and provided incentive to switch to Docker (and Elastic Beanstalk).  Containerizing legacy applications is not always trivial, however, as adopting a 12-factor approach means simplifying and standardizing sometimes disparate logging and configuration solutions, as well as changing to process supervision in a stripped down POSIX environment instead of a full blown Linux host.  Our monitoring stack now includes Pingdom, Airbrake, Loggly, PagerDuty, Skylight, (CloudWatch) and Librato.  Moving CI to Docker has been challenging, with initially only CodeShip providing a SaaS solution with parallel tests each with multiple sets of containers.
Looking forward Rubyconf last November continued to raise hopes that performance and concurrency will be improved… eventually.  Meanwhile there are numerous projects working on integration with compiled languages: helix with Rust, swig with C/C++, Loren Segal’s gorb with Go, and rubex.  Crystal has gained attention as a Ruby-ish experiment on LLVM with its own MVC frameworks.
On the front end React may now be a ‘safe’ choice for front end development but possibly disruptive innovation continues with VueJS, CycleJS and Elm.  The next twelve months will see either our further adoption of React on Rails or a shift to a different approach.

RailsConf 2017, Phoenix, AZ

Tuesday. Day 1. Keynote by DHH on belief systems. Fascinating talk by Lance Ivy on JSON Web Tokens, Justin Weiss on sessions, Dave Tapley with an entertaining exploration of VueJS, ActionCable and image processing. Eileen Uchitelle with a much anticitpated presentation on adding a significant feature (SystemTestCases) to Rails. Alex Kitchens with a great primer on using Git to explore the history of the Rails codebase. Finally Sam Phippen, now with Digital Ocean, in much better health than last year, giving an upbeat tour of fixing some RSpec issues.

Wednesday. Day 2. Justin Searles keynote with a tongue-in-cheek programmer personality test inspired by Myers Biggs. Back to back presentations on Elm, Phoenix, React and Helix highlighting various Rails related technologies. Nate Berkopec with clear and practical guidance on configuring app servers on Heroku or elsewhere. Evening lightening talks, most notably Isaac Sloan building a Crystal Kemal blog in five minutes.

Thursday. Three talks on distributed teams, including Maria Gutierrez, Glenn Vanderburg, formerly of Living Social, and David Copeland of Stich Fix. Simon Enskilden on the decision at Shopify to embrace flash sales and scale from MySQL sharding to multi-datacenter ‘pods’. Tony Drake pitching his active_reporting gem, then Nate Berkopec and Eilieen Uchitelle again with Rafael Franca and Richard Schneeman on a performance panel before the final keynote from Aaron Patterson with his traditional trolling of DHH and, eventually, h2o with Rack 3.0.

Posts navigation

1 2 3 4 10 11 12