<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on Mateusz Cholewka</title><link>https://mateuszcholewka.com/post/</link><description>Recent content in Posts on Mateusz Cholewka</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://mateuszcholewka.com/post/index.xml" rel="self" type="application/rss+xml"/><item><title>Beyond the Hype: Why We Chose Redis Streams Over Kafka for Microservices Communication</title><link>https://mateuszcholewka.com/post/why-we-chose-redis-streams-over-kafka/</link><pubDate>Tue, 19 Aug 2025 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/why-we-chose-redis-streams-over-kafka/</guid><description>&lt;p>I&amp;rsquo;m writing this article based on my personal experience implementing a production-ready solution using Redis Streams with my team. This is a result of a few months working with Redis Streams, development and maintenance. If you&amp;rsquo;re not sure, which solution to choose, I hope this article helps you choose the best solution for your needs.&lt;/p>
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>The problem we were facing was quite common. The question was how to communicate between two microservices in a simple, fast, and reliable way. Our first thought was to choose between two of the most popular solutions: RabbitMQ or Kafka. We wanted something that could handle higher throughput in the future, so it seemed, that Kafka would be better choice. It met all of the above requirements, and it&amp;rsquo;s also a resume-friendly solution.&lt;/p></description></item><item><title>5 Local Environment Mistakes I See Everywhere, and How to Fix Them Properly</title><link>https://mateuszcholewka.com/post/local-environment-tips/</link><pubDate>Fri, 21 Mar 2025 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/local-environment-tips/</guid><description>&lt;p>Every new project brings fresh challenges, but the very first one is always the same: getting it to run locally.&lt;/p>
&lt;p>Every time I start working on a new project, I end up asking other developers how to launch it. Documentation is usually long, outdated, and full of manual steps, like adjusting configs, copying envs, secrets, and so on.&lt;/p>
&lt;p>Luckily, it doesn’t have to be this way. A few small practices can make your local environment clean, repeatable, and easy to work with, not just for you, but for the entire team.&lt;/p></description></item><item><title>Alpine.js modal transition in Livewire the missing manual part</title><link>https://mateuszcholewka.com/post/livewire-transitioning-modal-using-alpine/</link><pubDate>Wed, 23 Feb 2022 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/livewire-transitioning-modal-using-alpine/</guid><description>&lt;p>For the last few days, I&amp;rsquo;m learning how to use the Laravel Livewire framework. I&amp;rsquo;m really impressed with how well it works, and how fast we can develop working applications using Livewire along with Tailwind CSS. It&amp;rsquo;s a great option for someone who wants to start his own startup as a one-man army. Only you need to know is PHP or more precisely Laravel and some HTML / CSS.&lt;/p>
&lt;h2 id="not-everything-is-possible-over-the-wire">Not everything is possible over the wire&lt;/h2>
&lt;p>HTML over the wire (which is the main concept behind Livewire) is very powerful, but not everything is possible to do using only on the backend. Some UX features require to use of the frontend API.&lt;/p></description></item><item><title>Read this before you start using the multistage builds for your docker images</title><link>https://mateuszcholewka.com/post/docker-image-layers/</link><pubDate>Sun, 21 Nov 2021 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/docker-image-layers/</guid><description>&lt;p>In my &lt;a href="https://mateuszcholewka.com/post/dockerfile-refactoring/">last post&lt;/a>, I showed how to refactor the Dockerfile in your project. I didn&amp;rsquo;t want to make the previous post too long, so I didn&amp;rsquo;t touch the multistage builds. Here is the post where I will show you how to improve the Dockerfile even more, using multistage builds. Using stages in your builds is not hard to use, but there are some things where the below knowledge may help you :smiley:&lt;/p></description></item><item><title>Here are the Dockerfile tips you can use to get your builds faster and safer</title><link>https://mateuszcholewka.com/post/dockerfile-refactoring/</link><pubDate>Sat, 13 Nov 2021 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/dockerfile-refactoring/</guid><description>&lt;p>Nowadays we are using docker a lot in web development. It&amp;rsquo;s easy to use, great in scaling, and gives us an immutable environment for running your application from local development to deploy on production.
To get the best experience with docker you should apply some practices to get fast and light builds of your docker images.&lt;/p>
&lt;p>In this article, I want to show you some of those practices based on this example:&lt;/p></description></item><item><title>How to configure PHP logs for Docker</title><link>https://mateuszcholewka.com/post/php-logs-in-docker/</link><pubDate>Mon, 01 Nov 2021 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/php-logs-in-docker/</guid><description>&lt;p>If you are using docker and cloud services to run your application live, you should manage your logs.&lt;br>
The most common method to store them is to put them in the text file. It&amp;rsquo;s the default configuration for most backend frameworks. This option is ok if you run your application locally or on the VPS server for test.&lt;br>
When you run your application in a production environment, you should choose a better option to manage your logs. Almost every cloud has a tool for rotating logs or if not, you can use for example Grafana Loki or ELK stack. Those solutions are better because give you interfaces to rotate and search your logs. Also, you have easy access to them, you no need to connect to your server to review them.&lt;br>
If you are using Docker containers, and you running your application in cloud services, often they will be automatically writing the logs of your containers to tools like AWS CloudWatch or GCloud Stackdriver.&lt;/p></description></item><item><title>Use single Dockerfile for development and production</title><link>https://mateuszcholewka.com/post/single-dockerfile-dev-prod/</link><pubDate>Mon, 11 Oct 2021 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/single-dockerfile-dev-prod/</guid><description>&lt;p>I have been wondering for a really long time how to keep up to date the Dockerfiles in my project. I&amp;rsquo;ve always had two of them, one for the dev environment, and the second one for building my production container with dependencies, code build, etc. If I needed to change something I had to update both files.&lt;/p>
&lt;p>I knew that dockerfiles allow us to define multiple stages, and I had used them, but still had a problem. In my production dockerfile I had stages, like building my frontend application and installing backend dependencies and final stage. I don&amp;rsquo;t need my code inside the container for development, because I attach my code using volume, so there is no reason to increase the building time of the development environment. So for the dev environment, I was using another one dockerfile.&lt;/p></description></item><item><title>Prepare your table data to CSV/Excel exports</title><link>https://mateuszcholewka.com/post/table-data-modifier/</link><pubDate>Sun, 13 Jun 2021 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/table-data-modifier/</guid><description>&lt;p>I neglected this blog a little bit :smile: but I don&amp;rsquo;t want to abandon it.
I decided to take what Andrzej Krzywda said about blogging to my :heart:. Andrzej said that the good topic to write a blog post is to describe what you learned in your work. So today I would like to describe how I solved the problem of modifying data in tables. Yeah, I know it may sound trivial, but I created an interesting solution, and get some good feedback about it. So I decided to share it on my blog.&lt;/p></description></item><item><title>Command Bus w Laravel</title><link>https://mateuszcholewka.com/post/command-bus-w-laravel/</link><pubDate>Sun, 27 Dec 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/command-bus-w-laravel/</guid><description>&lt;p>You can read this article also in english &amp;ldquo;&lt;a href="https://mateuszcholewka.com/post/laravel-command-bus-implementation/">Restore missing Command Bus in new Laravel versions&lt;/a>&amp;rdquo;.&lt;/p>
&lt;p>Command, to prosty wzorzec, dzięki któremu możemy w łatwy sposób wydzielić w naszej aplikacji mniejsze akcje i wyzwalać je przy pomocy jednej zależności, tzw. Command Bus&amp;rsquo;a. Samo używanie komend jest dość proste, a może przynieść spore korzyści choćby w czytelności kodu. Kiedy używamy command busa, możemy w przyszłości w prosty sposób skręcić w naszym projekcie w kierunku &lt;a href="https://martinfowler.com/bliki/CommandQuerySeparation.html">CQS&lt;/a>, czyl podziału akcji na komendy i zapytania (nie mylić z &lt;a href="https://martinfowler.com/bliki/CQRS.html">CQRS&lt;/a>, które mówi o rozdzieleniu modeli zapisu i odczytu, co jest już trochę bardziej skomplikowane, ale oczywiście to ten kierunek).&lt;/p></description></item><item><title>Restore missing Command Bus in new Laravel versions</title><link>https://mateuszcholewka.com/post/laravel-command-bus-implementation/</link><pubDate>Sun, 27 Dec 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/laravel-command-bus-implementation/</guid><description>&lt;p>Command Bus is a very powerful pattern, which can help you in decoupling your application modules. You can in an easy way separate small actions, and trigger them using a single dependency called CommandBus.&lt;/p>
&lt;p>The cause why this pattern is able to decouple your modules is that actually, the module that is dispatching the command doesn’t have to care about the actual implementation of the action. No matter if that’s a simple DB query, complicated calculations, or calling another remote service. Using this pattern will help you also if you want to implement one of &lt;a href="https://martinfowler.com/bliki/CommandQuerySeparation.html">CQS&lt;/a> and &lt;a href="https://martinfowler.com/bliki/CQRS.html">CQRS&lt;/a> patterns.&lt;/p></description></item><item><title>Wzorzec repozytorium w Laravelu</title><link>https://mateuszcholewka.com/post/repository-w-laravelu/</link><pubDate>Tue, 01 Dec 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/repository-w-laravelu/</guid><description>&lt;p>Od dłuższego czasu szukam najlepszego rozwiązania, które pozwoliłoby mi w Laravelu oddzielić swój kod od warstwy bazy danych. Eloquent, czyli domyślny ORM dla Laravela, jest zbudowany na bazie wzorca &lt;a href="https://www.martinfowler.com/eaaCatalog/activeRecord.html">ActiveRecord&lt;/a>, co oznacza, że każda Encja/Model, mają zaszyty w sobie dostęp do bazy danych i nijak nie da się go z tamtąd “wytargać”.&lt;/p>
&lt;p>Nie chcę się tutaj skupiać na tym, gdzie i jak należy używać wzorca Repository, ponieważ to jest całkowicie osobny temat i może jeszcze kiedyś się tego podejmę, ale jeszcze nie dziś. W skrócie to dlaczego chcę oddzielić kod biznesowy od warstwy bazy danych, to chęć lepszego podziału odpowiedzialności w klasach, oraz możliwość testowania kodu całkowicie niezależnie od bazy danych. Oczywiście takie testowanie ma sens tam, gdzie mamy jakąś logikę biznesową, jeśli mamy prostego CRUD’a, to nie ma potrzeby ani stosować repozytorium, ani testować bez użycia bazy danych.&lt;/p></description></item><item><title>Lekki obraz dockera dla PHP</title><link>https://mateuszcholewka.com/post/lekki-docker-z-php/</link><pubDate>Mon, 23 Nov 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/lekki-docker-z-php/</guid><description>&lt;p>Docker, to bardzo użyteczne rozwiązanie, które pozwala nam na stworzenie środowiska uruchomieniowego identycznego na środowisku lokalnym testowym, jak i produkcyjnym. Myślę, że w dzisiejszych czasach jest już jednym z obowiązkowych zagadnień dla każdego programisty, niezależnie od stacku technologicznego, w którym pracuje. Użycie dockera wiąże się jednak z kilkoma problemami, jak np. to, że najlepiej jest posiadać rejestr do przechowywania obrazów dockera, czy to, że musimy odpowiednio taki obraz przygotować i skonfigurować jego budowanie. Tematowi tworzenia właśnie chcę się dziś przyjrzeć.&lt;/p></description></item><item><title>Reprezentacja wartości (ValueObject)</title><link>https://mateuszcholewka.com/post/value-object/</link><pubDate>Mon, 28 Sep 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/value-object/</guid><description>&lt;p>Domain Driven Design to popularny już od kilku lat temat w programowaniu. Wiedzy dotyczącej DDD jest bardzo dużo i zastosowanie tego podejścia w pełni jest bardzo trudne dla początkującego programisty. Istnieją jednak pewne obszary w tej metodyce, które możemy wyodrębnić i zastosować w naszej codziennej pracy, w projektach niewykorzystujących DDD. Jednym z takich obszarów są building block&amp;rsquo;i. W tym artykule przedstawię jeden z nich, a mianowicie ValueObject.&lt;/p>
&lt;h2 id="gdzie-leży-problem">Gdzie leży problem?&lt;/h2>
&lt;p>Czy 6zł to tyle samo co ocena 6 w dzienniku? No nie. A jeśli tak jest, to po pierwsze to bardzo tanio, a po drugie, to niezgodne z prawem ;). A jak takie wartości zapiszemy w kodzie, jeśli chcemy coś zaprogramować? No zapewne w obu przypadkach najlepszym typem danych do zapisu tych wartości będzie integer lub float. Ale czy napewno?&lt;br>
Dla uproszczenia przyjmijmy, że jest to integer:&lt;/p></description></item><item><title>Używanie typu Enum w PHP</title><link>https://mateuszcholewka.com/post/enum-w-php/</link><pubDate>Mon, 21 Sep 2020 00:00:00 +0000</pubDate><guid>https://mateuszcholewka.com/post/enum-w-php/</guid><description>&lt;p>W programowaniu bardzo często można trafić na sytuację, w której jakiś obiekt może istnieć w wielu stanach. W różnych stanach mogą być np. umowy (szkic, zaakceptowana, podpisana), posty (szkic, opublikowany, zaplanowany), konta (niepotwierdzone, potwierdzone). W niektórych przypadkach może wyniknąć potrzeba rozdzielenia konkretnych stanów na osobne klasy, w jeszcze innych wykorzystanie tzw. maszyny stanów, ale nie będę się na tym dziś skupiał. Chciałbym się skupić na wyrażaniu stanu przy pomocy wartości.&lt;/p></description></item></channel></rss>