<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Martin Kleppmann's Blog - Latest Comments</title><link>http://martinkl.disqus.com/</link><description></description><atom:link href="https://martinkl.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 18 Dec 2025 14:23:02 -0000</lastBuildDate><item><title>Re: Accounting for Computer Scientists — Martin Kleppmann‘s blog</title><link>http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html#comment-6812068429</link><description>&lt;p&gt;Really interesting and makes a solid point about how accounting concepts map to systems thinking. A lot of the same ideas — consistency, reconciliation, tracking state over time, also show up in modern data and finance tools. Seeing how they apply across disciplines helps set expectations for where AI and automation can help and where human judgment still matters. Tools like Runeleven are a good example of using automation for the repetitive parts while keeping humans in control of interpretation and decisions.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">steve gordon</dc:creator><pubDate>Thu, 18 Dec 2025 14:23:02 -0000</pubDate></item><item><title>Re: Should you put several event types in the same Kafka topic?</title><link>http://martin.kleppmann.com/2018/01/18/event-types-in-kafka-topic.html#comment-6809193754</link><description>&lt;p&gt;brilliant writeup. thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anshuman Singh</dc:creator><pubDate>Sat, 13 Dec 2025 23:12:05 -0000</pubDate></item><item><title>Re: Why the mobile web is so slow</title><link>http://martin.kleppmann.com/2007/11/23/why-the-mobile-web-is-so-slow.html#comment-6809193622</link><description>&lt;p&gt;Haha, we have too far&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anshuman Singh</dc:creator><pubDate>Sat, 13 Dec 2025 23:11:20 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6752366152</link><description>&lt;p&gt;Lock/lease expiration in this particular case is a red-herring non-problem that does &lt;i&gt;not&lt;/i&gt; cause &lt;i&gt;data &lt;/i&gt;correctness issues. To implement transactions with strict linearizability with a WAL (append only write ahead log), you just need to make sure all writes are linearized without conflict, so the fencing token at a WAL subsystem would suffice.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vicaya</dc:creator><pubDate>Thu, 14 Aug 2025 15:09:56 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6752361722</link><description>&lt;p&gt;This is a low level algorithm to actually implement transactions properly by databases/filesystems. Application developers should not be using distributed lock/lease directly.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vicaya</dc:creator><pubDate>Thu, 14 Aug 2025 15:01:12 -0000</pubDate></item><item><title>Re: Java's hashCode is not safe for distributed systems</title><link>http://martin.kleppmann.com/2012/06/18/java-hashcode-unsafe-for-distributed-systems.html#comment-6747749951</link><description>&lt;p&gt;Can you elaborate? How does making hashing inconsistent among processes prevent DDoS on a single request? It is the same process&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vaibhav Pandey</dc:creator><pubDate>Mon, 04 Aug 2025 21:41:20 -0000</pubDate></item><item><title>Re: Accounting for Computer Scientists — Martin Kleppmann‘s blog</title><link>http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html#comment-6746584316</link><description>&lt;p&gt;A clear introduction to the basic ideas. Simple things presented simply.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">borderlinesurprised </dc:creator><pubDate>Sat, 02 Aug 2025 09:05:37 -0000</pubDate></item><item><title>Re: Accounting for Computer Scientists — Martin Kleppmann‘s blog</title><link>http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html#comment-6746583756</link><description>&lt;p&gt;Expressing these ideas in the language of graphs is excellent for a mathematics student as well. Thanks. I am aware this is simplified, but having a basic idea of what is going on is also useful, and this post helped in that direction.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">borderlinesurprised </dc:creator><pubDate>Sat, 02 Aug 2025 09:03:49 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6718830549</link><description>&lt;p&gt;So basically you're proposing to use optimistic locking with a token instead of pessimistic locking.&lt;/p&gt;&lt;p&gt;The obvious question is then: why use a lock at all? It seems you could just use a token generator service + a storage service check and have same guarantees.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mariusz</dc:creator><pubDate>Sun, 08 Jun 2025 11:44:34 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6705291172</link><description>&lt;p&gt;manual&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Huu Viet</dc:creator><pubDate>Wed, 14 May 2025 07:10:38 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6705291113</link><description>&lt;p&gt;It is man page actually.  &lt;a href="https://man7.org/linux/man-pages/man2/gettimeofday.2.html" rel="nofollow noopener" target="_blank" title="https://man7.org/linux/man-pages/man2/gettimeofday.2.html"&gt;https://man7.org/linux/man-pages/man2/gettimeofday.2.html&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Huu Viet</dc:creator><pubDate>Wed, 14 May 2025 07:10:26 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6702590226</link><description>&lt;p&gt;There is a typo in 'The man page for gettimeofday explicitly says that the time '&lt;br&gt;man -&amp;gt; main&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">한성현</dc:creator><pubDate>Fri, 09 May 2025 09:16:51 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6697839553</link><description>&lt;p&gt;This is an interesting topic, incidentally, I just released an article about achieving distributed locking using Redis regular IO (read &amp;amp; set).&lt;/p&gt;&lt;p&gt;Please check it out here for details:  &lt;a href="https://www.linkedin.com/pulse/master-less-cluster-wide-resource-locking-gerardo-recinto-g4mec/?trackingId=%2FRvVnuf4TwirkXACC4TYCw%3D%3D" rel="nofollow noopener" target="_blank" title="https://www.linkedin.com/pulse/master-less-cluster-wide-resource-locking-gerardo-recinto-g4mec/?trackingId=%2FRvVnuf4TwirkXACC4TYCw%3D%3D"&gt;https://www.linkedin.com/pulse/master-less-cluster-wide-resource-locking-gerardo-recinto-g4mec/?trackingId=%2FRvVnuf4TwirkXACC4TYCw%3D%3D&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Enjoy! :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gerardo Recinto</dc:creator><pubDate>Thu, 01 May 2025 03:30:15 -0000</pubDate></item><item><title>Re: Please stop calling databases CP or AP — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2015/05/11/please-stop-calling-databases-cp-or-ap.html#comment-6611758888</link><description>&lt;p&gt;I'm really confused now.&lt;/p&gt;&lt;p&gt;The article above states: "Consistency in CAP actually means &lt;i&gt;linearizability&lt;/i&gt;."&lt;br&gt;However, the paper you shared says: "Consistency, which we can think of as &lt;i&gt;serializability&lt;/i&gt; for this discussion."&lt;/p&gt;&lt;p&gt;How can the paper reference the CAP theorem and claim that "Spanner is a CA system" (albeit "in effect") if Spanner-consistency is not the same as CAP-consistency?&lt;/p&gt;&lt;p&gt;It seems like this is exactly what the article warns against: "But if you’re using some other notion of consistency or availability, you can’t expect the CAP theorem to still apply."&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sergey Yaskov</dc:creator><pubDate>Sun, 15 Dec 2024 07:10:38 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6609917310</link><description>&lt;p&gt;Note that another commenter brought the same exact point I did (search for "What I'm saying is, it sure looks like if it's possible to implement fenced updates in the storage at all, then you don't need a separate lock service anymore."), and even got a reply from Martin.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Valentin Kovalenko</dc:creator><pubDate>Thu, 12 Dec 2024 04:01:39 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6609891058</link><description>&lt;p&gt;Sorry for the bump.&lt;/p&gt;&lt;p&gt;Main use-case I can envisage: "best-effort transaction" support, over subsets of linearizable stores (plural!) that have CAS but not transactions.&lt;/p&gt;&lt;p&gt;During client x's lease, x could issue (potentially multiple) writes to (potentially multiple) linearizable stores participating in the arrangement. x could even extend their lease for a long-running "pseudo-transaction", if the network plays nice.&lt;/p&gt;&lt;p&gt;Atomicity is the kicker, though: x might need to live with only its first i of n writes executing with serial isolation, before its lease expires (say it's unable to renew it due to packet delay) - unless the next client y is forced to begin with a compensating transaction...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">disqus_jHxIQ3HL9H</dc:creator><pubDate>Thu, 12 Dec 2024 02:11:44 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6589782543</link><description>&lt;p&gt;Hi, Martin!&lt;/p&gt;&lt;p&gt;Thanks for the article. The fencing token approach is very helpful in case of correctness, but the main problem (as for me) a storage should support tokens validation. For example, if I have S3, and I want to store a file only from leader, how vanilla S3 implementation could check the correctness of a token. There's no a conditional put in API. Seems we need some kind of proxy on top of S3 which would handle put requests with tokens?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Denis Gabaidulin</dc:creator><pubDate>Sun, 10 Nov 2024 13:08:39 -0000</pubDate></item><item><title>Re: Accounting for Computer Scientists — Martin Kleppmann‘s blog</title><link>http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html#comment-6562255381</link><description>&lt;p&gt;Glad to help this has been so long but anyway would help  &lt;a href="https://www.syncfusion.com/succinctly-free-ebooks/accounting" rel="nofollow noopener" target="_blank" title="https://www.syncfusion.com/succinctly-free-ebooks/accounting"&gt;https://www.syncfusion.com/succinctly-free-ebooks/accounting&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Timex Peachtree</dc:creator><pubDate>Wed, 02 Oct 2024 11:03:52 -0000</pubDate></item><item><title>Re: Accounting for Computer Scientists — Martin Kleppmann‘s blog</title><link>http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html#comment-6562241780</link><description>&lt;p&gt;I know the comment is so long from when you have posted.&lt;br&gt;This might help for developers. -  &lt;a href="https://www.syncfusion.com/succinctly-free-ebooks/accounting" rel="nofollow noopener" target="_blank" title="https://www.syncfusion.com/succinctly-free-ebooks/accounting"&gt;Syncfusion - Accounting Succinctly&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Timex Peachtree</dc:creator><pubDate>Wed, 02 Oct 2024 10:44:22 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6550583874</link><description>&lt;p&gt;I want to answer the two questions I asked earlier now that I have a better understanding of distributed systems.&lt;/p&gt;&lt;p&gt;"I'm interested in enforcing that the client with the expired lease is not allowed to write to storage at all even if it writes before the client holding the lease.&lt;/p&gt;&lt;p&gt;1. Are there any algorithms to enforce this?"&lt;/p&gt;&lt;p&gt;If you need to enforce this for &lt;b&gt;correctness&lt;/b&gt; then you should use your database to do it. What you want is to transactionally acquire a lock and write to the database and then release the lock. Databases already have this functionality built in! Putting the lock in another service makes everything harder because of the problems outlined in this blog post.&lt;/p&gt;&lt;p&gt;I would ask why do you have this requirement? Is it really about the client or about some other property you want to enforce. It is tempting to lock more than you need to enforce a constraint, but what is the minimum you need to lock? Can you structure your database transaction and table(s) such that the database enforces this in an efficient manner? The answer is almost always yes.&lt;/p&gt;&lt;p&gt;"2. Are there any libraries or storage solutions that implement such an algorithm?"&lt;/p&gt;&lt;p&gt;I would recommend you read about the locking strategy your database uses. The database already acquires locks by itself when you use it. It does a good job locking only what is needed&lt;/p&gt;&lt;p&gt;Postgres h  &lt;a href="https://www.postgresql.org/docs/7.1/locking-tables.html" rel="nofollow noopener" target="_blank" title="https://www.postgresql.org/docs/7.1/locking-tables.html"&gt;ttps://www.postgresql.org/docs/7.1/locking-tables.html&lt;/a&gt;  &lt;br&gt;MySQL   &lt;a href="https://dev.mysql.com/doc/refman/8.4/en/innodb-locking.html" rel="nofollow noopener" target="_blank" title="https://dev.mysql.com/doc/refman/8.4/en/innodb-locking.html"&gt;https://dev.mysql.com/doc/refman/8.4/en/innodb-locking.html&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Neil Lugovoy</dc:creator><pubDate>Sun, 15 Sep 2024 21:10:02 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6436121710</link><description>&lt;p&gt;That only works if the lock service and the storage system have perfectly synchronised clocks. However, clock sync typically runs over NTP, which is subject to the same network delays as all other packets, and that delay causes the clocks to be slightly out of sync with each other. Even if the clock drift is on the order of milliseconds, that's not close enough for this to be safe.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Martin Kleppmann</dc:creator><pubDate>Sun, 14 Apr 2024 16:01:15 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6435713236</link><description>&lt;p&gt;What if the Lock Service also responds with lock start time and expiration time to client 1. Client 1 in turn send it to storage system. Storage system just validates expiry time in future or not. Assumping absense of clock synchronization issue.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sambit Bharimalla</dc:creator><pubDate>Sun, 14 Apr 2024 02:53:57 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6416494498</link><description>&lt;p&gt;actually, validating the access token before the storage accepts the request is still not 100% reliable.  Consider the case where the lock happen to expire and then be acquired by another client just after the validation passes. due to timing issue, the storage can then take concurrent writes from two clients at the same time.&lt;/p&gt;&lt;p&gt;This is because "validate the token" and "take the write" are not atomic operations and doesn't happen instantaneously.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kobe W</dc:creator><pubDate>Mon, 18 Mar 2024 19:33:01 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6416491494</link><description>&lt;p&gt;the storage service is already validating the token somehow with lock service, so on top of that, additionally checking the TTL of current lock shouldn't be too hard. The latency is already there.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kobe W</dc:creator><pubDate>Mon, 18 Mar 2024 19:27:33 -0000</pubDate></item><item><title>Re: How to do distributed locking — Martin Kleppmann’s blog</title><link>http://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html#comment-6322288014</link><description>&lt;p&gt;Why  the heck title is &lt;b&gt; how-to-do-distributed-locking&lt;/b&gt;&lt;br&gt;When whole article is about how Redlock is not a good choice.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Raviraj</dc:creator><pubDate>Mon, 13 Nov 2023 02:49:11 -0000</pubDate></item></channel></rss>