Concerns in Rails

Concerns allow us to include modules with methods (both instance and class) and constants into a class so that the including class can use them. Rails concerns are defined by extending ActiveSupport::Concern module. By extending this the module can define two blocks: included: Any code written inside this block is evaluated in the context of the including class. That means if we define a method in this block then that’ll be available to the class in which the concern is included....

August 6, 2023 · 2 min · Ashish Gaur

Using SQS With Rails

In this post we’re going to learn how to use SQS with Rails. What’s SQS ? SQS is a message queueing service provided by AWS. It can be used by two microservices to communicate using messages one acting as producer and the other as consumer. Using SQS, you can send, store, and receive messages between microservices while allowing them to scale horizontally. SQS stores the messages send to it thus making sure messages are not lost....

August 21, 2022 · 5 min · Ashish Gaur

What is ACID

ACID is the building blocks of a relational databases. Today we’re going to understand what it means. tldr; Just remember Atomicity relates to Transactions - All or Nothing. Consistency relates to Constraints and Triggers - All the data is consistent. Isolation relates to Locks - Concurrent operation doesn’t intefere with each other. Durability relates to Replication - Committed Transactions to be persisted in case of system failure. Atomicity - Transactions Atomicity guarantees All or Nothing....

June 14, 2022 · 3 min · Ashish Gaur

Dockerizing a Rails Application

Today we’re going to learn how to dockerize a rails application. What is Docker ? Docker helps in packaging our application and its dependencies together. Docker does that by creating containers. Ok and what’s Container ? A container is an executable which holds: our code, runtime dependencies, system libraries and settings. This allows us to run our container on any platform without worrying about setting it up from scratch everytime....

May 21, 2022 · 4 min · Ashish Gaur