The nice thing about first-class production sqlite support is that even if you do end up with n+1 queries, it's not as big a deal: https://www.sqlite.org/np1queryprob.html
Certainly I wouldn't care about it while prototyping. I can always go back and optimize queries with judicious `.joins()` or `.includes()` if it becomes a bottleneck.
But these sporadic elevated response times kept showing up on endpoints, where they’d be hundreds of milliseconds slower than normal, but by some extension of 100ms. Say, normally 5ms, now taking 105ms, or 505ms, or more.
Then I learned about ruby’s non parallel but concurrent model, where within a process only one thread can execute at a time. In most workloads you’ll hit IO quickly, and the threads will play nicely. But if you have a CPU crunching exercise, it’ll delay every other thread waiting to execute by 100ms before it preempts. Now consider you’re doing 10 1ms queries inter process with a greedy thread, and you’re waiting at minimum 1010ms.
Still love Ruby but the process model gave me a reason to hate N+1s.
There's also Rails' russian doll caching, which can actaully results in pages with n+1 queries running quicker than ones with preloaded queries. https://rossta.net/blog/n-1-is-a-rails-feature.html
Hopefully as Ractors mature that problem will be solved for MRI too.
Anyone can achieve n+1 issue with whatever tool they use, it's not ActiveRecord specific.
Edit: Search is nice as well.
>>Really nice to see a deployed modern Rails site.
Yes. And it is also a showcase what I want for 90-95% of the web. Useful as an example next time we have yet another MPA vs SPA or SSR vs CSR argument. It doesn't need to be a complex SPA. Although I must admit the response time isn't perfect even with Cloudflare.
Hosting is in Europe on Hetzner maybe it explains your response time. Where are you located?
what are the response time you are getting ?
It is probably good enough for 95% of people. I am what I call latency sensitive.
But I think the main culprit is surprisingly view transition isn't as good as I thought. Because the slight lag / jank I feel happens on Chrome. While I dont feel this on Firefox or Safari 17.6 which isn't supported yet.
I will check if we can prevent this default effect and only use page transition when needed
The biggest pain point was the lack of Grade A documentation for the best way to use ActionCable and Turbo – information is spread out between Rails Guides, API docs, and then the Turbo / Stimulus documentation. The actual API docs do a poor job of explaining basic concepts like "streamables", and I kept wondering if I was doing things the "right"/idiomatic way.
Still, as always, ActiveRecord is my biggest draw for Rails, and the new first-class Sqlite integrations are a huge draw for me. I've yet to find an ORM that allows me to be anywhere near as productive.