Technical

Spotting and Fixing Monitoring Smells: A Guide to Reliable Systems

Keeping production systems healthy and reliable is a challenge. Are your services running well? During high-traffic periods, can your system handle the load without bottlenecks or failures? What about dependencies? Is everything working fine with third-party depencies or is there an outage on cloud service provider? These are everyday challenges for DevOps and SRE teams alike.

Just like messy code gives clues about deeper issues (code smells), monitoring systems can have “monitoring smells.” when something isn’t right. These are signs that your monitoring setup isn’t as good as it should be. While I won’t be diving into how to build the perfect monitoring system. This article will explain what these smells are, how to notice them, and how to fix them.

Saga Design Pattern: Choreography and Orchestration

In this article, I will discuss the Saga design pattern. First, we’ll address some technical challenges of creating ACID transactions. Then, we’ll explore the Saga design pattern and how to implement it.

Database Per Service Pattern

First, let’s talk about microservice architecture and the database per service pattern. Basically, each microservice in an application has its own dedicated database. This allows each microservice to manage its data independently, making it easier to develop, deploy, and scale each service without affecting the others. For instance, in an online store, the user service, order service, and inventory service each have their own databases. This isolation improves flexibility, as each service can choose the best database type for its needs and makes the system more resilient to failures.

Dependency Injection

At my company, we hold a weekly “Lunch and Learn” event that I really like. It lets us share our experiences and expertise. Recently, during a chat with my colleagues, I got some basic questions about dependency injection (DI). This made me think that it would be a good idea to use one of these sessions to go over DI with the team. Also, I plan to write an article about dependency injection and its best practices. In the article, I’ll explain what DI is, how to use it effectively, and what the best practices are.

Understanding .NET Dependency Injection Lifetimes

In the last article, we discussed how dependency injection (DI) helps keep our app’s parts separate, making them easier to handle and test. This time, I’ll focus on an important part of DI in .NET: lifetimes.

I’ll explain the different lifetimes in .NET: Transient, Scoped, and Singleton, and how to pick and use them for your app.

Understanding DI Lifetime Scopes

Dependency injection (DI) lifetime scope refers to how long a dependency is used and stored in an application. Managing these lifetimes is important for efficient resource use, good performance, and clean code. DI frameworks offer several lifetime options for different needs and situations.

Cloud Design Patterns: Circuit Breaker Pattern

The circuit breaker pattern stops a service from trying again to call another service when the previous attempts have failed multiple times. It’s similar to electrical circuit breakers that automatically cut off the current when there’s abnormal activity.

In a distributed environment, calls to remote resources may fail due to reasons such as application exceptions, timeouts, authentication issues, or overloaded systems. Usually, resilient cloud applications automatically fix these issues over time, and the calling application manages these errors using a retry pattern.

Cloud Design Patterns

The cloud is vast. Azure docs have around a hundred thousand pages, and AWS is just as big. Other cloud providers are out there too. Each gives you lots of apps, different rules, and dozens of integrations, so creating cloud-native ones has its challenges.

They’re not identical, but big providers offer similar solutions. For example, Google Cloud Storage is like AWS S3 and Azure’s durable function is similar to AWS step functions. Details and rules can differ, but the main idea of the tech is similar, along with the challenges.

Azure Durable Functions

Azure Functions and Azure Durable Functions

Microsoft Azure is a constantly expanding collection of cloud services. Among these services, Azure Functions and Azure Durable Functions are critical in enabling serverless computing. In this article, we will look at Azure Functions and Azure Durable Functions, distinguish between the two, and learn about the key concepts surrounding Azure Durable Functions.

What is an Azure Function?

Azure Functions is a serverless computing service designed to effortlessly run small code snippets (functions) without any concern about the underlying infrastructure. This cloud-based solution empowers developers to focus solely on their code while leaving the infrastructure management worries behind.

Automating Script Execution with Systemd on Linux

In my previous blog post, I created a script that controls the fan speed on my Raspberry Pi. However, I encountered a problem – every time I restarted my Raspberry Pi, I had to manually run the script again, which was not ideal.

In this blog post, I will demonstrate how to automate the execution of any script using Systemd. Systemd is a system and service manager for Linux operating systems.

How to control Raspberry Pi Fan

Last week, I did something unplanned: I bought a Raspberry Pi without any specific project in mind. I came across a Mastodon account (@rpilocator@mastodon.social) that helps people locate Raspberry Pis and I decided to get one. And now, here it is! I’m writing my first blog post about the Raspberry Pi Fan Control.

Along with the Raspberry Pi, I purchased a case, some heatsinks, and a fan. My first blog post is about controlling the fan using your own software. I’ll be honest, I didn’t plan on developing anything at first but decided to give it a try.

Arrays: Prefix Sum Technique

Hello there! The prefix sum technique involves creating an array where the prefix[i] is the sum of all elements up to index i. This technique can also be referred to as the cumulative sum, inclusive scan, or simply scan.

prefix[0] = nums[0]
prefix[1] = nums[0] + nums[1]
prefix[2] = nums[0] + nums[1] + nums[2]
prefix[i] = nums[0] + nums[1]+ nums[2] + .. + nums[i]

For example, if the original array is [1, 2, 3, 4], the prefix sum array would be [1, 3, 6, 10].