1. Blog
  2. Retail

Dreaming Bigger with Rails 2022: our recap of the event

Recap of Dreaming Bigger with Rails 2022, held in February 2022: DHH on Hotwire, Rails 7 async queries, read replicas, Hinter and the Hotwire panel.

updated on 7 min read
Podcast studio with two microphones on boom arms and two pairs of headphones on a wooden table

In February 2022, more than 250 people attended "Dreaming Bigger with Rails", confirming its place among the events that matter most in the French Rails community.

Banner for Dreaming Bigger with Rails 2022, a virtual event held on 10 February 2022, with the Wizville, Rails and Hotwire logos, the Sorare, Doctolib and Basecamp logos and photos of the speakersWizville organised the event for the second year running. The aim was to help the ecosystem learn from the best and make 2022 an even better year than 2021.

To do so, we brought together some of the most interesting people building and thinking about Rails, to find inspiration for the technical challenges we faced in 2022. First among them was the launch of recommendation algorithms based on large-scale cross-analysis of customer reviews and third-party data, designed to reinvent how companies manage customer satisfaction.

Our second goal was to show that Wizville had the means to match its (big) ambitions, and that it was the right time to join us. At the time, we planned to double our headcount in 2022 and were continuously recruiting Senior Developers.

Dreaming Bigger with Rails 2022 in figures

The 2022 edition of "DBR" drew 260 attendees for more than two hours of talks, and the figures speak for themselves, in substance as well as in form:

  • 260 attendees
  • 2 hours 20 minutes of talks
  • 10 speakers
  • 6 CTOs or equivalent among the speakers
  • 6 start-ups (SaaS, gaming and e-commerce)
  • 2 unicorns

Bonus: 7 memes, all of them memorable.

Panel 1: the fireside chat with DHH

The fireside chat with David Heinemeier Hansson focused mainly on Hotwire, along with the most significant technology developments of 2021. DHH, the creator of Ruby on Rails, co-founder of Basecamp and a New York Times best-selling author, joined us for the second year in a row.

"Lead the revolution against Node"

As usual, DHH made no secret of his dislike of the heavy use of JavaScript in modern web development. In his view, it has added a layer of complexity that has needlessly slowed teams down for several years.

Rather than sending JSON data from an API to hydrate a React component or similar, DHH proposes an alternative approach, Hotwire, in which the server sends fragments of HTML pages.

"People have hit enough walls with the traditional javascript framework"

DHH argues that splitting work between a "front-end team" and a "back-end team" is a luxury of very large companies, and that in most cases a full-stack approach with Hotwire is more than enough.

As an example, the Hey email client was built with Hotwire using only 30 KB of compressed JavaScript, against 4.8 MB for Gmail.

"Bundlers / transpilers are a regression, not a revolution"

DHH also shared his enthusiasm for native support of modules and import maps in Chrome (https://chromestatus.com/feature/5315286962012160). This moves the web step by step towards a world without bundlers, which account for a good share of the complexity of today's web development. JavaScript code can be loaded dynamically (via import) without a bundler such as webpack: less time spent bundling, and no more wrestling with webpack's often temperamental configuration.

Watch the replay of the conversation with David Heinemeier Hansson (DHH)

Panel 2: "Take your Tech Stack to the Next Level", with Sorare, Doctolib and Wizville

This round table showed once again that the first bottleneck of a web app is the database: Ruby is probably not the fastest language around, but that is not where the real performance battle is fought. The panel brought together Nicolas Denayer, VP Engineering at Doctolib, Sylvain Utard, Head of Engineering at Sorare, and Clément Bruchon, CTO of Wizville.

The panel also discussed what was new in the Rails ecosystem.

Asynchronous queries since Rails 7

Rails 7 handles concurrent database queries natively, thanks to load_async. Ruby is often criticised for its lack of concurrency, which partly explains why Node.js rose to prominence.

In a web app, there are broadly two things you want to run concurrently: external API calls and database queries.

Rails 7 solves the database part by adding load_async, which runs an Active Record query in a separate thread (https://rubyonrails.org/2021/12/15/Rails-7-fulfilling-a-vision).

📓 load_async documentation

Read replicas since Rails 6

Since Rails 6, read replicas are supported natively: you can tell Active Record to read from one database and write to another.

Managing read replicas cleanly in Rails had never been easy. There were a few attempts, such as the Octopus gem, but few teams took the risk of using that kind of gem in an environment as sensitive as production.

This is particularly useful when databases are offloaded, although you still need to watch out for the few seconds of latency that can occur between a read replica and the primary database used for writes.

📓 Read replicas documentation for Active Record

The Interactor gem

Interactor offers an elegant way out of callback hell by chaining the actions that make up a business workflow, each step passing its result to the next.

Sorare had taken the concept as far as handling asynchronous workflows, and said it might open-source the work.

📓 Interactor gem documentation on GitHub

The Hinter gem

Hinter, a project led by Wizville and in particular by our CTO, Clément Bruchon, shows line by line why a block of Ruby code is slow: the number of queries generated by Active Record, the time spent executing Ruby and the time spent executing Active Record.

Unlike standard monitoring tools (Sentry, Datadog and so on), which analyse performance page by page, Hinter works in a console or debugger context and reasons in lines of code.

This is particularly useful for a workflow made up of several successive actions, when you want to understand how much time and how many queries each action consumes, line by line.

Say we want to analyse the following block of code:

Four lines of Ruby code: Log.count, puts 42, Brand.all.map(&:name) and a = 45

Hinter instruments it as follows:

The same four lines of Ruby wrapped in a Hinter.new.watch(binding) block

This produces the following analysis:

Hinter output: total time, SQL time with query count and Ruby time for each of the four lines of code

We learn that lines 1 and 3 each generate one query, that lines 2 and 4 have a negligible performance cost, and that the Ruby processing on line 3 is the heaviest. So if there is optimisation work to do, line 3 comes first. It is also handy for spotting N+1 queries :)

📓 Hinter gem documentation on GitHub

Replay of this panel

Panel 3: "Hotwire Developers Share their Journeys from 0 to 1"

To close Dreaming Bigger with Rails 2022, Adrien Siami of Ecotable, Adrien Poly of Plume and Bob Maerten of Home Ciné Solutions presented projects on which they use Hotwire.

Adrien Siami began with a demonstration of the power of Turbo Streams, the part of Turbo that lets you modify a page's DOM after an action, for example a form submission that updates a counter.

Adrien Poly then showed how to use Turbo Frames in a modal, which scopes navigation to one element of the DOM without the historical restrictions of iframes.

Finally, Bob Maerten showed how easy it is to make a form dynamic with Stimulus. It is a good alternative to importing heavy UI libraries just for form validation or simple animations.

In conclusion, Hotwire clearly sits in the "one-person framework" niche, offering a serious alternative to the classic React/API stack for small teams. However, sending HTML in responses leaves little room for mobile integration and forces the use of webviews, which is not ideal if you want to follow the device's design language. Not everyone has that need, of course, and we had no doubt that the speed gained from Hotwire's simplicity would win over more than one team.

Replay of the Hotwire panel

Memorable memes

"DBR" had become one of the Wizville team's most eagerly awaited events of the year, and the team went all out on memes every time :-)

Here is a selection of the most memorable memes of the 2022 edition. Enjoy:

Two memes: a laughing toddler captioned 'When it's time for event DHH', and Megamind captioned 'What is Hotwire?' 'DHH: It's my time to shine'

Two memes: a 'Types of headaches' chart ending with 'Sales trying to understand the webinar', and a man in a nightclub whispering 'I code on Ruby with Hotwire you know'

Thank you

A big thank you to everyone who followed the event so attentively and made the 2022 edition a success.

Thank you also to our outstanding speakers, who had the courage to share their successes and challenges, and moved the whole ecosystem forward with the richness of their experience. Special thanks go to Adrien Siami, CTO of Ecotable, who helped organise the event and led the selection of the most interesting Hotwire developers in France.

Share
Maxime Morisset

Maxime Morisset

Développeur Full Stack Senior chez Wizville. Après un diplôme d'ingénieur en robotique, Maxime embarque dans le domaine de la réalité augmentée en tant qu'ingénieur R&D au sein de start-ups parisiennes. Il s'oriente rapidement vers le développement web sur le framework Ruby On Rails, il aura successivement plusieurs casquettes, développeur, scrum-master puis chief product officer 5CPO). Il rejoint Wizville en avril 2021 en tant que Développeur Full Stack Senior. En dehors du travail, c'est un passionné de théâtre, de guitare et pratique assidument la voile.

Further reading

All articles