How to build a search engine with Ruby on Rails: Introducing the Whereable design pattern

16-Sep-2021 1884
You don’t hear this one every day: I just made a critical database query 10x faster by moving the bulk of the complexity out of SQL and back into Ruby. This post will explain how I did it, plus how you can apply a similar approach to rethinking search in your own application. (In a hurry? Jump straight to the codey bits.)I maintain an app for studying Japanese called KameSame that’s built with Rails and Postgres (I talked about it in The Selfish Programmer). Last weekend I rewrote its Japanese-English dictionary search feature for at least the third time and I finally managed to strike the right balance between flexibility and speed.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle