Looking for more to read? Check out the Archives!

Announcing Scenic Versioned Database Views For Rails

Derek Prior, outlining the benefits of Scenic, Thoughtbot’s open-source database view implementation for Rails:

With all of that in place, our N+1 query is gone and we’ve significantly decreased garbage collection pressure. A benchmark of both methods with production data shows that the previously existing Ruby implementation is 85 times slower than our new implementation that makes use of the view.

This looks like a great way to improve query performance, by moving views to the database level. I’m definitely going to look at using this for my next Rails project.


If you enjoyed this post, you might want to subscribe, so you don't miss the next one!