This website uses cookies for analytics and to improve provided services. To learn more see our Privacy Policy.

Author: Jakub Cieślar

Rspec query limit matcher

Introduction

Have you ever wondered how many simultaneous queries your application sends to the database? A hundred, a thousand, or perhaps a million? Whatever your answer, we should be aware of the influence that this number has on the performance of our programme. I would like to introduce to you the rspec-query-limit gem (you can find the source code on our github in the monterail/rspec-query-limit repository): this gem is a rspec matcher that measures the numbers of queries being sent to the database in Ruby on Rails applications. The main goal of this gem is to prevent the so-called N+1 problem from occurring, and to make us realize how many different queries are subsequently being sent to the database. Rspec query limit measures queries using Active Support Instrumentation which allows us to measure certain actions in Rails.

Read more

Elixir blog in 15 minutes using Phoenix framework - Step by Step

I suppose everyone can recall blog posts about building your own blog in 15 minutes with Ruby on Rails. Building a simple blog post page with Rails was as easy as writing hello world in any other language. Nowadays, however, there are more and more articles about Elixir and it looks like the Ruby world has started to fall in love with Elixir. Because of that, I took the challenge and decided to check out how easy (or difficult ;-)) it is to write a blog using Elixir's web framework - Phoenix.

Read more