<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Canvas on Rustam Garifulin</title>
    <link>https://n69.in/blog/canvas/</link>
    <description>Recent content in Canvas on Rustam Garifulin</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Copyright © 2025, Rustam Garifulin.</copyright>
    <lastBuildDate>Mon, 20 Apr 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://n69.in/blog/canvas/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Fractional Indexing: Ordering Items in Collaborative Lists</title>
      <link>https://n69.in/blog/fractional-indexing/</link>
      <pubDate>Mon, 20 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://n69.in/blog/fractional-indexing/</guid>
      <description>&lt;h2 id=&#34;the-problem&#34;&gt;The problem&lt;/h2&gt;&#xA;&lt;p&gt;Canvas editor, 500 layers, the user drags layer #200 onto position #450. If the order is stored as plain integers &lt;code&gt;1, 2, 3, ..., 500&lt;/code&gt;, moving a single element means renumbering every element after the insertion point.&lt;/p&gt;&#xA;&lt;p&gt;Tolerable for a local app. In a collaborative setting it&amp;rsquo;s a nightmare:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Every index update is a separate operation that can conflict with other users&amp;rsquo; actions.&lt;/li&gt;&#xA;&lt;li&gt;Moving one layer means 250 index mutations, one per element between the old and new position.&lt;/li&gt;&#xA;&lt;li&gt;If two people drag different layers at the same moment, merging becomes a problem of reconstructing order rather than applying two patches.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What you want: &lt;strong&gt;O(1)&lt;/strong&gt; insert, and &lt;strong&gt;existing elements stay untouched&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
