Let me introduce you the solution:
For Ruby developers, it’s common to switch between multiple Ruby versions for multiple projects as per the needs of the project.
Sometimes, the process of going back and forth with multiple Ruby versions could be frustrating for the developer...
This design pattern helps you change the main algorithm inside a method.
You do this by passing in a class that implements this algorithm, instead of hardcoding it into the class.
And when I say algorithm I don’t mean a fancy computer science algorithm, but any code that follows a sequence of steps to get a result.
All developers who build Rails applications use Active-Support. It extends Rails and every programmer has probably used it at one time.
But often, many do not realize when they use this gem. This article recaps some useful features that it brings to our Rails applications.
As a practice, we should always keep a tab on how we are writing the code. Following are the key learnings I’ve had while fixing the Sidekiq issues:
- We should not unnecessarily use global variables where local variables can solve the problem for you. Refer here.
- Fetching data in batches provides some breathing space for the RAM.
- Using Rails Table Includes is not a bad option at all with batch techniques.
- Do not fetch unnecessary information, use select(‘column_names’) for the same.
- Garbage Collection — Techniques mentioned in our previous article.