In this article I’ll consider two common approaches to implementing depth-first search and breadth-first search in Ruby.
Ruby has no built-in class for initializing Binary Tree data structure. Tree is just a restricted form of a Graph which have a parent-child relationship.
Here is the simplest definition for a binary…
In Container-based DevOps solutions like Kubernetes, ECS, Heroku an application must be able to stop accepting new client requests before termination, and, most importantly, it must successfully complete already running requests and processes.
By default in most systems Graceful Shutdown implements by sending
SIGTERM signal and 30 seconds delay before…
A stub is the only defined result of the method call which doesn’t care about behavior. With RSpec, you can use stub with
If you need to stub the result of the method then it’s possible with
Mock expect methods to…
When designing modern applications on microservices architecture and systems based on cloud solutions such as AWS, Azure, or Google Cloud imply the need to handle expected failures.
We can represent the simplest retry in runtime as a…
There are two most popular ways to manage secrets in your application.
In the early stages of development, it may be useful to identify slow queries in time (when you don’t have a paid APM). QueryTrack helps to get notified about slow queries with related data: duration and backtrace.
Add this line to your application’s
Gemfile and then execute
One of the tools that are rarely covered in the Ruby/Rails world are the message brokers (probably because they mostly written in Java). Everyone are familiar mostly with background jobs processing, but message brokers offer a more flexible approach to asynchronous execution. …
To use Redis as a Rails cache store, use a dedicated cache instance that’s set up as an LRU (Last Recently Used) cache instead of pointing the store at your existing Redis server, to…
Sucker Punch — a single-process Ruby asynchronous processing library that runs with your existing app’s process.
Gem is built on top of concurrent-ruby and have no dependencies with any data storage, what is both an advantage and a disadvantage.
Running in the application process really simplifies the deployment process, but…
export statements have been standardized in ES2015. They are not supported in browsers yet, but webpack does support them out of the box. But actually it’s more powerful tool which can help us build whole our front-end.