Posts

Showing posts with the label logging

No More Data Transfer Objects: A Guide to Adopting CQRS 📝🔎

Image
   In the software engineering industry, the term CQRS is used quite often. It describes a pattern which allows you to handle services in your system in a vertical manner. It gives you the ability to free yourself from any other service in the same domain and allows you to focus on the service that you wish to implement. I know that there are hundreds of other resources that can explain the CQRS pattern better in terms of definition and philosophy. However, in this article I'm going to explain it in another way, a rather practical way. Imagine you have an entity named Customer . Normally if we follow clean architecture , we will have a single horizontally scaled service called CustomerService . In this CustomerService there are all types of services that perform different operations on this entity. However not all services need to operate on the whole entity model. This is why Data Transfer Objects exist. Data Transfer Objects (DTOs) are a simplified versions of entity mode...

Introduction to Beats: Collect Data from Anywhere & Level Up your Elastic Stack 📡

Image
    Logstash did a very impressive job transforming our logs into documents that allowed us to understand and visualize how our applications are behaving. But, because of that Logstash could require quite the memory and CPU to run. So, it's not the most efficient move to make Logstash collect the data from various sources. Elastic offered a solution to this concern and introduced Beats . Beats  is a lightweight shipper for forwarding and centralizing log data. It's installed as an agent on your servers to capture all sorts of operational data like logs or network packet data. Beats is great for gathering data and works efficiently with a large number of files. It can also handle back pressure (when Logstash is busy) and ensures that no data is lost during such periods. And to be clear Logstash can do most of what Beats . So, why use Beats instead? 1. Lightweight Data Shipping : Beats is designed to be lightweight and requires fewer resources than Logstash . This makes it ...

Introduction to Logstash: Transform Log Files and Unlock the Power of ELK Stack 📚

Image
 What's the first thing you imagine when you hear the word logs . I bet you pictured a huge amount of text that's hard to read and it just gives you a headache every time you try to tell the lines apart. And if you're looking for an error or something, it feels like you're looking for a needle in a haystack. So, how can you transform these logs from clunky text which is hard to read into documents in your Elasticsearch index? The answer lies in the letter L in the ELK stack. We've talked about the E , we've talked about the K , now it's time to talk about L : Logstash . Logstash is a powerful open-source data processing pipeline tool that collects data, transforms it into a common format, and sends it to a destination for storage or further analysis. And as I previously pointed out in the previous posts: the great advantage of using this stack together is the seamless integration that allows you to save the effort of integration. You can look at Logstash a...

Introduction to Kibana: Explore, Visualize and Analyze Elasticsearch Data 📊

Image
   In my previous post  Introduction to Elasticsearch: Create, Update, Delete and Search Documents 🔍  I showed you how to set up an Elasticsearch index and manage its data. But as you could see in that post the data looked very ugly on the cmd window. That's because this is not Elasticsearch 's job. Data representation and visualization is key to understanding your data and even predicting its trend. And as I previously said, the power in Elasticsearch lies in its integration with other powerful tools such as our guest of honor: Kibana . Kibana , developed by Elastic , is a powerful open-source data visualization and exploration platform. It seamlessly integrates with Elasticsearch, making it an essential component of the Elastic Stack. Whether you’re a data analyst, developer, or business user, Kibana empowers you to unlock valuable insights from your data. With its intuitive interface, you can create interactive dashboards, explore logs, analyze metrics, and visu...

Introduction to Elasticsearch: Create, Update, Delete and Search Documents 🔍

Image
    Relational databases are a little rigid. They are indeed robust, but this robustness comes with a price. Sometimes your solution requires a rather flexible set of data. Which is where NoSQL databases come in place. And document databases are a type of NoSQL databases. Unlike traditional relational databases that store data in fixed rows and columns, document databases use flexible documents. These documents are typically stored in a JSON -like format, which is both human-readable and machine-friendly. Developers can directly create and update these documents from their code, making application development more rapid and efficient. Some of the most popular document databases are Amazon DynamoDB , MongoDB , Google Firebase and others. But what really gives Elasticsearch an edge is that it excels as a search engine optimized for fast, complex search queries, especially text searches. It’s commonly used for analyzing log and event data. Elasticsearch ’s true strength lies no...