Browsed by
Author: Zardo

Working with Date and Time in Golang

Working with Date and Time in Golang

Managing dates and times is a common task in many applications, whether it’s logging events, scheduling tasks, or measuring time intervals. Go, as a modern programming language, offers a robust set of built-in tools for handling date and time efficiently. The time package in Go provides various utilities to work with time zones, parse and format dates, measure time durations, and perform operations like adding or subtracting time. In this article, we will explore the basics of working with date…

Read More Read More

Implementing counting sort with Golang

Implementing counting sort with Golang

What it is counting sort Counting Sort is an algorithm for sorting keys that are small integers and repeatable values. However, it is not recommended for large keys because the logic consists of using an array where the value serves as the index of the array to store the counts of each key. Thus, the length of this array is calculated as store = len(max – min + 1). After that, the algorithm rebuilds the order of the values according…

Read More Read More

How to adjust Replication Factor from internal topic in ka

How to adjust Replication Factor from internal topic in ka

The Kafka replication factor is a crucial mechanism that ensures the consistency and availability of data. I’ve previously covered this topic in a post, which you can read here. the internal topic __consumer_offsets plays a pivotal role in Kafka. It handles the consumers group offset, storing the last message consumed by specific consumer, along with information about broker connection. In the event of a broker failure, it facilitates rebalancing within the consumer group.. It is very important to have this…

Read More Read More

Go – goroutines and channels

Go – goroutines and channels

When you have to deal with concurrency problems, Go has a strong advantage to deal with it. goroutine it is the way that Go supports concurrency, running simultaneous function in a differently Thread from the main, cleverly managed by the runtime. From the golang documentation, this is how they explain about it. A goroutine is a lightweight thread managed by the Go runtime. In this blog post, i will try to show this, exploring why they are a game-changer for concurrent programming…

Read More Read More

Understanding Kafka Partitions

Understanding Kafka Partitions

Kafka Partitions are one of the core mechanisms for ordering produced events in your application. It is the way that Kafka distribute events thought the nodes and keeping the same events from the same entity together to guarantee the ordination of the facts for the consumers. Partitions In Kafka, event messages are essentially logs files containing all the events, separated and organized into partitions. Imagine partitions as office drawers with dividers, organizing papers related to different companies. For example, papers…

Read More Read More

Understanding Kafka Replication Factory and Partitions

Understanding Kafka Replication Factory and Partitions

Kafka is a distributed event store and event streaming platform, so it is developed to be fault-tolerant in a distributed server running in many nodes. The concept of Kafka Replication Factory is some of the main configurations to achieve this. Let’s say that we have a Kafka instance running in a 3 nodes server, as the image below. It is even more common, depending on your application, to run in more nodes, but lets keep it simple with just three…

Read More Read More