<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Pragmatic Engineering</title>
<id>urn:md2blog:Pragmatic%20Engineering</id>

<author>
<name>Pragmatic Engineering</name>
</author>
<updated>2026-05-17T14:40:47.968Z</updated>

<entry>
<title>(W.I.P) Local transactions and their tradeoffs</title>
<id>urn:md2blog:Pragmatic%20Engineering:(W.I.P)%20Local%20transactions%20and%20their%20tradeoffs</id>
<link rel="alternate" href="posts/architecture/dbtransactions-part1.html"/>
<updated>2026-04-07T00:00:00.000Z</updated>
<summary type="text">The first part of the database transactions overview series, what they are and what guarantees they can provide</summary>
<content type="html">&lt;h2 id=&quot;what-is-a-transaction&quot;&gt;What is a transaction?&lt;/h2&gt;
&lt;p&gt;The simplest definition is that it is a set of operations that must either succeed or fail as a complete unit, with no partial status to preserve the data integrity.
When dealing with traditional relational databases, transaction semantics are usually defined in terms of ACID. However, as systems scale out, we have to trade these strict guarantees for BASE model.&lt;/p&gt;
&lt;h3 id=&quot;the-acid-principles-where-consistency-is-more-important-than-availability&quot;&gt;The ACID principles (where consistency is more important than availability):&lt;/h3&gt;
&lt;h4 id=&quot;atomicity&quot;&gt;Atomicity&lt;/h4&gt;
&lt;p&gt;Ensures that all operations within a single database transaction are treated as a single, indivisible unit. They are either all fully completed or the database is reverted to its original state as if nothing happened.&lt;/p&gt;
&lt;h4 id=&quot;consistency&quot;&gt;Consistency&lt;/h4&gt;
&lt;p&gt;Guarantees that a transaction can only bring the database from one valid state to another, strictly adhering to all database schema constraints such as foreign keys, unique indexes, data types, and check constraints.
Software engineers frequently mistake database consistency for application consistency. For a deeper dive into understanding application invariants I recommend &lt;a href=&quot;https://www.milanjovanovic.tech/blog/what-invariants-are-and-why-a-domain-model-is-the-best-place-to-enforce-them&quot;&gt;this Milan Jovanovic blog post - what invariants are and why a domain model is the best place to enforce them&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&quot;isolation&quot;&gt;Isolation&lt;/h4&gt;
&lt;p&gt;Determines how visible the changes made by one ongoing transaction are to other concurrent transactions. It provides the illusion that transactions are executed serially (one after another), even though they run simultaneously. We&amp;#39;ll dig deeper into isolation levels later on.&lt;/p&gt;
&lt;h4 id=&quot;durability&quot;&gt;Durability&lt;/h4&gt;
&lt;p&gt;Guarantees that once a transaction is committed, its changes are permanent and will survive any subsequent system failure, such as a sudden power outage, an operating system crash, or a hardware reboot.&lt;/p&gt;
&lt;h3 id=&quot;the-base-principles-where-availability-has-a-higher-priority-than-availability&quot;&gt;The BASE principles (where availability has a higher priority than availability):&lt;/h3&gt;
&lt;h4 id=&quot;basically-available&quot;&gt;Basically Available&lt;/h4&gt;
&lt;p&gt;The system guarantees availability in terms of the CAP theorem. Instead of locking down the entire system and returning errors during a network partition or a node failure, the system will choose to remain functional. Some parts of the data might be temporarily stale or inaccessible, but the database as a whole does not go down.&lt;/p&gt;
&lt;h4 id=&quot;soft-state&quot;&gt;Soft State&lt;/h4&gt;
&lt;p&gt;In an ACID database, data is stable and deterministic at any given point. In a BASE system, the state of the data is &amp;quot;soft&amp;quot;—it can change over time, even without direct user interaction, as updates gradually trickle through different nodes in a distributed cluster.&lt;/p&gt;
&lt;h4 id=&quot;eventual-consistency&quot;&gt;Eventual Consistency&lt;/h4&gt;
&lt;p&gt;The system does not guarantee that everyone will see the same data at the exact same millisecond. Instead, it guarantees that if no new updates are made to a specific piece of data, all replicas across the network will eventually converge and become identical.&lt;/p&gt;
&lt;h2 id=&quot;isolation-levels&quot;&gt;Isolation levels&lt;/h2&gt;
&lt;p&gt;SERIALIZABLE - a serial execution is viable but within certain constraints:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every transaction must be fastly executed, because a slow one will stall the progress of next in line transactions.&lt;/li&gt;
&lt;li&gt;Cross partition serializability can be implemented, but pose some challanges of their own (TODO: article on that?)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;phenomenas&quot;&gt;Phenomenas&lt;/h2&gt;
&lt;h2 id=&quot;transactions-in-relational-databases-vs-nosql&quot;&gt;Transactions in relational databases vs NoSQL&lt;/h2&gt;
</content>
</entry>
<entry>
<title>6 lessons I&apos;ve learned from The Phoenix Project</title>
<id>urn:md2blog:Pragmatic%20Engineering:6%20lessons%20I&apos;ve%20learned%20from%20The%20Phoenix%20Project</id>
<link rel="alternate" href="posts/books/phoenix-project-lessons.html"/>
<updated>2024-05-28T00:00:00.000Z</updated>
<summary type="text">My take on the most important lessons I&apos;ve learned from Gene Kim&apos;s book The Phoenix Project</summary>
<content type="html">&lt;p&gt;&lt;b&gt;My take on the most important lessons I&amp;#39;ve learned from Gene Kim&amp;#39;s book The Phoenix Project&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;reading: ~3m&lt;/i&gt;&lt;/p&gt;
&lt;h2 id=&quot;1-taking-risks-must-be-part-of-the-company-culture&quot;&gt;1. Taking risks must be part of the company culture&lt;/h2&gt;
&lt;p&gt;Failing fast with new ideas, taking lessons, and improving is far more effective than following the standard way of working.
With every technical task, think of ways to improve it next time. If you know how, try to find time to make those improvements.
Delaying them for an &amp;quot;unknown later&amp;quot; will create technical debt, both for the project and yourself. Try to divide some Dev and IT time toward supporting tasks.&lt;/p&gt;
&lt;p&gt;John is a chief information security officer who goes through the biggest change in work approach over the course of the book.
His colleagues see him as a progress blocker. They blame his frequent IT security checks and following complex protocols for disturbing others.
He changes after taking the initiative to teach and trust others. So, he goes from blocking progress to being an asset.&lt;/p&gt;
&lt;h2 id=&quot;2-documenting-key-project-knowledge-is-required&quot;&gt;2. Documenting key project knowledge is required&lt;/h2&gt;
&lt;p&gt;The perfect solution would be to document every detail. Then, for a big project, like project Phoenix, we would know every step taken.
In real-life projects, there&amp;#39;s not enough time to document everything.
So, focus on the complex, repeated processes (like onboarding, VPN setup, and vendor integrations). This will save time in the future.&lt;/p&gt;
&lt;h2 id=&quot;3-slack-time-is-important&quot;&gt;3. Slack time is important&lt;/h2&gt;
&lt;p&gt;In the book, there&amp;#39;s a guy called Brent who is the &amp;quot;know-it-all&amp;quot; type.&lt;/p&gt;
&lt;p&gt;Brent is resolving different issues in many systems at a time and knows undocumented processes, so only he is able to solve them. 
Why is that? Brent is always busy, firefighting and working on projects, which means that until he&amp;#39;s done, he can&amp;#39;t take on any new work.&lt;/p&gt;
&lt;p&gt;Like in &lt;a href=&quot;https://www.tocinstitute.org/theory-of-constraints.html&quot;&gt;the theory of constraints&lt;/a&gt;, some slack time is important. You can use it for new improvements, documentation, or high-priority work.&lt;/p&gt;
&lt;h2 id=&quot;4-high-trust-and-engineering-spirit&quot;&gt;4. High trust and engineering spirit&lt;/h2&gt;
&lt;p&gt;A team does not achieve transparency, mutual trust, and vulnerability easily, but it needs them to function.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Mutual trust. It&amp;#39;s better to say you can&amp;#39;t finish the task on time due to a lack of knowledge than to lie about an unexpected issue. Next time the team takes on a similar task, they will know that it requires some nonstandard competencies and time to learn them.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vulnerability - in the book, the CEO, Steve, encourages others to share personal information about themselves. By opening up first, he gives an example for others. After getting to know each other, we form stronger relationships, have improved self-acceptance, and less ego.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transparency - Brent didn&amp;#39;t share the details of his work with his colleagues, which prevented them from offering help in many ways. Documenting the setup, architecture, and visible CI/CD processes will help organize the work.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;5-priorities&quot;&gt;5. Priorities&lt;/h2&gt;
&lt;p&gt;Brent wasn&amp;#39;t always doing the highest priority work. A lack of self-organization led him to try to pack in less important tasks, which prevented him from doing the priority work first. He often couldn&amp;#39;t finish simple tasks on time as he neglected to set aside some slack time to automate them. Another issue with his work organization was a lack of trust in others. He took on work that only he could do, but someone else should have handled it. &lt;/p&gt;
&lt;p&gt;I have a few strategies for handling tasks with efficiency. They are often high priority but boring, require neglected automation from long ago, or need rare skills. You can find them in this &lt;a href=&quot;https://devwithpiotr.eu/posts/other/blablabla.html&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;6-every-company-is-now-an-it-company&quot;&gt;6. Every company is now an IT company&lt;/h2&gt;
&lt;p&gt;At first, Steve, the company CEO, says, &amp;quot;IT is like keeping the toilets running. I should never have to think about it.&amp;quot; As technology use grows, IT is now vital to the business. Companies must advance to keep up. So, he now sees IT workers as essential, not as janitors. Many companies still resist their IT departments and overdue change. They are at a competitive disadvantage.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been planning my kitchen lately. Before using Blender to model it, I checked various companies&amp;#39; design tools. IKEA offers an excellent, user-friendly kitchen design tool that works in the browser. In contrast, many other companies either had poor tools or none at all. I believe this can greatly influence customers looking to buy a new kitchen.&lt;/p&gt;
</content>
</entry>
</feed>
