Idempotency in Your API

Introduction Idempotency is a crucial property in the world of APIs, ensuring that operations can be applied multiple times without changing the result. In this post, we’ll explore six effective strategies to achieve idempotency in your API, drawing inspiration from real-world examples and distributed systems principles. Idempotency Explained The light switch analogy is often used to explain idempotence. Consider a light switch in a room. The operation of turning the light switch on or off is idempotent....

November 11, 2023 Â· 4 min Â· Denis Nutiu

CAP Theorem

The CAP theorem, also known as Brewer’s theorem, is a concept in distributed computing that states that it is impossible for a distributed system to simultaneously provide all three of the following guarantees: Consistency: All nodes in the system see the same data at the same time. Availability: Every request made to the system receives a response, without guarantee that it contains the most recent version of the data. Partition tolerance: The system continues to function despite arbitrary message loss or failure of part of the system....

May 9, 2023 Â· 2 min Â· Denis Nutiu, ChatGPT

Apache Cassandra Compaction

Introduction Apache Cassandra is a highly scalable and distributed NoSQL database that is designed to handle large volumes of data across multiple commodity servers. One of the key features of Cassandra is its ability to automatically manage data distribution, replication, and consistency across a cluster of nodes, providing high availability and fault tolerance. One important aspect of managing data in Cassandra is compaction. Compaction is the process of merging and removing unnecessary data from SSTables, which are the on-disk storage structures used by Cassandra....

April 13, 2023 Â· 6 min Â· Denis Nutiu, ChatGPT

Working with Volumes in Microk8s

Introduction Hello 👋, In this quick tutorial 💻 we’ll explore how to use Volumes and PersistentVolumes with hostpath storage in Microk8s. We will deploy a simple nginx instance and mount a volume inside it that points to the ~/Downloads folder. Let’s get started! Note: The following image was generated with Stable Diffusion How-To You can follow along if you want to setup a quick deployment with a host path volume....

April 13, 2023 Â· 2 min Â· Denis NuČ›iu

How to create a ServiceMonitor in Microk8s: Observability Tutorial

Hello, In this quick tutorial we will explore how to create a ServiceMonitor in microk8s when you have the observability addon enabled. When you enable the observability addon with: microk8s enable observability It will create the obserability namespace and install the Kubernetes Prometheus Stack. k get pods -n observability NAME READY STATUS RESTARTS AGE kube-prom-stack-prometheus-node-exporter-htzw9 1/1 tempo-0 2/2 Running 4 (16h ago) 27h alertmanager-kube-prom-stack-kube-prome-alertmanager-0 2/2 kube-prom-stack-kube-prome-operator-cbf896985-fb5fc 1/1 kube-prom-stack-kube-state-metrics-57c8c84df6-hflgj 1/1 kube-prom-stack-grafana-74d8979894-sjv77 3/3 prometheus-kube-prom-stack-kube-prome-prometheus-0 2/2 loki-0 1/1 loki-promtail-sg8bv 1/1 Running You will get a Grafana configured with a Prometheus data source and other data sources as well....

March 29, 2023 Â· 2 min Â· Denis NuČ›iu

Exec as root user in Kubernetes

Hi 👋, In this short tutorial I will show you a way of getting a root shell in containers running inside a modern Kubernetes cluster. Prerequisites: Root access to the cluster node in which the container is running. Problem Statement We wan’t root access into a running container, exec gives us non-root user. ➜ Downloads k get pods NAME READY STATUS RESTARTS AGE my-release-cassandra-0 1/1 Running 0 2m9s ➜ Downloads k exec -it pod/my-release-cassandra-0 -- /bin/bash I have no name!...

November 19, 2022 Â· 1 min Â· Denis NuČ›iu

Apache Flink Checkpoints on S3 and S3 compatible storage

Hello, Recently someone working at Yahoo emailed me regarding an old thread I’ve started on the Apache Flink user mailing list. I’ve replied to the e-mail but also decided to turn the reply into a blog post, because it might help other people as well. Email Hi, I was able to get it working after tinkering with it. The issue was mainly a miscommunication, we didn’t formally know which authentication method we were using in AWS....

October 28, 2022 Â· 2 min Â· Denis NuČ›iu

Container log monitoring on Microk8s with Loki, Grafana and Promtail

Hi 👋 This is a short tutorial describing how to monitor your Kubernetes cluster container logs using Loki stack. But why? Because it is easier to view, filter your logs in Grafana and to store them persistently in Loki rather than viewing them in a terminal. Let’s get started! Assuming you already have Microk8s installed, enable the following addons: You can enable an add-on by running microk8s enable. Ex: microk8s enable dns...

February 17, 2022 Â· 3 min Â· Denis NuČ›iu

Home automation with Home Assistant on Raspberry PI – Getting Started

Hi 👋 The purpose of this article is to get you started quickly with a Home Assistant on a Raspberry Pi. It’s a simple walkthrough on how to install Home Assistant and configure it so it will boot with your PI. I will use my old Raspberry PI V3 board. Flashing the Raspberry PI OS You will need a microSD card of reasonable size, I’m using a 16GB one and a USB Adapter to connect it with my PC....

December 23, 2021 Â· 3 min Â· Denis NuČ›iu

Kafka Connect MongoDB Sink Connector

Hello 👋, In this article we’re going to build a data pipeline that connects Kafka to MongoDB. In short, we’re going to add a MongoDB Sink connector to a Kafka Connect cluster and run a MongoDB instance in Docker to test the connector. By reading this article I hope that you will learn How to install the MongoDB connector in Kafka Connect How to configure the MongoDB connector How to create topics in Kafka using Confluent Tools How to monitor Kafka Connect using JConsole....

September 19, 2021 Â· 6 min Â· Denis NuČ›iu