<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Flash into the future]]></title><description><![CDATA[Latest research and projects around data infra and ML]]></description><link>https://blog.essence.dev</link><image><url>https://blog.essence.dev/img/substack.png</url><title>Flash into the future</title><link>https://blog.essence.dev</link></image><generator>Substack</generator><lastBuildDate>Sat, 18 Apr 2026 04:37:45 GMT</lastBuildDate><atom:link href="https://blog.essence.dev/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Timothy Chen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[flashintothefuture@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[flashintothefuture@substack.com]]></itunes:email><itunes:name><![CDATA[Timothy Chen]]></itunes:name></itunes:owner><itunes:author><![CDATA[Timothy Chen]]></itunes:author><googleplay:owner><![CDATA[flashintothefuture@substack.com]]></googleplay:owner><googleplay:email><![CDATA[flashintothefuture@substack.com]]></googleplay:email><googleplay:author><![CDATA[Timothy Chen]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Self-organizing Data Containers]]></title><description><![CDATA[CIDR 2022 #5]]></description><link>https://blog.essence.dev/p/self-organizing-data-containers</link><guid isPermaLink="false">https://blog.essence.dev/p/self-organizing-data-containers</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Tue, 09 Aug 2022 07:12:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!loWU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi all! We&#8217;re onto the <a href="https://www.cidrdb.org/cidr2022/papers/p44-madden.pdf">5th paper</a> in the CIDR 2022 series, which is from the MIT CSAIL group, proposing a new data storage format for data systems to be stored in the cloud.</p><p>This is a paper that I have a strong interest in as I&#8217;ve seen how the industry evolved in creating file formats (Avro, Parquet, Arrow) and also invested in companies like Tabular and Eto Labs that are also building new systems that include new data formats like <a href="https://github.com/apache/iceberg">Apache Iceberg</a> and <a href="https://github.com/eto-ai/rikai">Rikai</a>.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.essence.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Flash into the future! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2><strong>Disaggregated Data Services </strong></h2><p>Like the Data Lakehouse paper, I covered previously, we&#8217;re seeing systems are going on step beyond the separation of storage and compute, but also having storage layer leveraging Cloud storage like S3 that&#8217;s shared among multiple compute frameworks. </p><p>One of the challenges with this architecture was maintaining data consistency, which is what Apache Iceberg and Databricks&#8217;s Delta lake aim to solve. </p><p>However, one particular challenge that isn&#8217;t solved is performance. The example used in the paper was Redshift vs <a href="https://docs.aws.amazon.com/redshift/latest/dg/c-using-spectrum.html">Redshift Spectrum</a> (loads external data on query time), which performs 8x slower due to the slower I/O to S3 and inefficiency of not being able to load and structure the data in an optimal way as the data is serialized into a standard format (e.g: Parquet, Arrow) without any additional data structures (index, etc) that is typically maintained in memory in the database engine itself.</p><h2><strong>Self-Organizing Data Containers</strong></h2><p>The core idea of the paper is to augment the data format that&#8217;s being stored in the cloud, into what the author calls <em>self-organizing data containers (SDC)</em>. Modern high performance data systems usually able to achieve high performance by storing and building additional metadata such as indexes, determine and change efficient compression based on data, also applying physical data layout changes such as clustering and partitioning based on data stored and also materialized views against the data.</p><p>Instead of having a single data systems such as Redshift or Snowflake create and maintain these data in a silo, data containers is meant to bundle these data in the data format so all systems accessing the same data can leverage these performance metadata and optimizations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!loWU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!loWU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 424w, https://substackcdn.com/image/fetch/$s_!loWU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 848w, https://substackcdn.com/image/fetch/$s_!loWU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 1272w, https://substackcdn.com/image/fetch/$s_!loWU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!loWU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png" width="660" height="518.1818181818181" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1140,&quot;width&quot;:1452,&quot;resizeWidth&quot;:660,&quot;bytes&quot;:264508,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!loWU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 424w, https://substackcdn.com/image/fetch/$s_!loWU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 848w, https://substackcdn.com/image/fetch/$s_!loWU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 1272w, https://substackcdn.com/image/fetch/$s_!loWU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F9f6fcce8-eced-4de5-8824-5a4e688eb8ab_1452x1140.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>SDC includes client libraries that directly access storage or in-memory to read SDC files without any intermediate services. The client libraries is able to publish metadata about the SDC and also make optimizations to the SDC based on its read patterns. These optimizations can include creating materialized views, replicating part of the SDC for frequently accessed data, creating and updating indexes or storage layout, etc.</p><p>The challenge is to be able allow clients concurrently access and modify SDC without performing conflicting operations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oosY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oosY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 424w, https://substackcdn.com/image/fetch/$s_!oosY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 848w, https://substackcdn.com/image/fetch/$s_!oosY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 1272w, https://substackcdn.com/image/fetch/$s_!oosY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oosY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png" width="1386" height="756" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:756,&quot;width&quot;:1386,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:161486,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oosY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 424w, https://substackcdn.com/image/fetch/$s_!oosY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 848w, https://substackcdn.com/image/fetch/$s_!oosY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 1272w, https://substackcdn.com/image/fetch/$s_!oosY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F383bc21a-f49b-41f3-91d7-7a1107be55fd_1386x756.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A SDC besides storing data blocks like Arrow or Parquet in columnar fashion, also includes index blocks and metadata blocks. All SDC must include one Index block that contains a sparse row index that maps row id ranges to blocks. </p><p>However, additional index blocks can be created for more efficient access. The paper uses the example of creating a quad-tree index that allows efficient lookup for finding range of two attributes. Clients can further create more splits of a quad-tree quadrant when it finds frequent access in a region, by creating more data blocks and creating a new index block. By evolving the indexes and the data blocks, the SDC becomes self-evolving over time through the clients.</p><h2><strong>SDC vs Delta Lake</strong></h2><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8tUB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8tUB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 424w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 848w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 1272w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8tUB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png" width="1456" height="418" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:418,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:309921,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8tUB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 424w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 848w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 1272w, https://substackcdn.com/image/fetch/$s_!8tUB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8514c8fe-46fd-4f0a-a5a4-467881d11b8d_2948x846.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Comparing SDC and Delta Lake both stored on disk, SDC can perform up to 10x speedup through optimal range partitioning using the mentioned quad-tree index, while Delta Lake only optimizes 1.25x using z-ordering. The biggest reason Delta Lake isn&#8217;t able to perform efficiently in this use case is that the z-order isn&#8217;t optimized to the workload access that is observed, while SDC can based on the access pattern evolve to have more efficient indexes.</p><h2><strong>Last Thoughts</strong></h2><p>The paper has left a lot more research directions and questions to be answered, such as how to coordinate optimizations being done among different clients to perform optimal outcomes with the same goal, or how to create incremental changes to the data layout and what policy to apply this for.</p><p>Nonetheless, I do find this research direction really interesting as I think we are going to see more efficient data access and performance optimizations into the data format layers that is designed for particular workload patterns. </p><p>This creates a new interesting paradigm where we see the decoupled database systems continue to evolve where query, compute, storage are being unbundled and shared among systems. We&#8217;re already seeing projects and companies moving towards this direction and excited to see how this unfolds.</p><p></p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.essence.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Flash into the future! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Mach: A Pluggable Metrics Storage Engine for the Age of Observability]]></title><description><![CDATA[The #4 paper I&#8217;m covering from CIDR 2022 is this paper that covers a new Pluggable storage engine for storing metrics, with collaboration from Slack, Intel, Brown, CMU, and MIT.]]></description><link>https://blog.essence.dev/p/mach-a-pluggable-metrics-storage</link><guid isPermaLink="false">https://blog.essence.dev/p/mach-a-pluggable-metrics-storage</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Sun, 19 Jun 2022 02:04:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oHyl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The #4 paper I&#8217;m covering from <a href="https://www.cidrdb.org/cidr2022/">CIDR 2022</a> is <a href="https://www.cidrdb.org/cidr2022/papers/p12-solleza.pdf">this paper</a> that covers a new Pluggable storage engine for storing metrics, with collaboration from Slack, Intel, Brown, CMU, and MIT.</p><p>This is an interesting paper as it is a great example of how a specifically designed storage engine for a use case such as monitoring can yield quite a big difference in performance compared to existing time-series databases.</p><h3><strong>What&#8217;s in Observability Data?</strong></h3><p>Today all production systems store monitoring metrics from services either sent to external products like Datadog or stored in monitoring systems that are usually backed by time-series databases such as Influx or metrics storage systems like Prometheus. </p><p>Peeking into what monitoring data looks like, each service or instance (aka source) usually emits a fixed set of labels with a series of values with a timestamp.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oHyl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oHyl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 424w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 848w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 1272w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oHyl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png" width="699" height="315" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:699,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:175766,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oHyl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 424w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 848w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 1272w, https://substackcdn.com/image/fetch/$s_!oHyl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F61a0c58a-1e5e-403c-84ec-f6abd37054b7_699x315.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The challenge of storing this data is that it can be huge. The paper specifically talked about Slack, which collects metrics from 4 billion unique sources per day at a rate of 12 million samples per second, generating up to 12 TB of compressed data every day.</p><p>Also, each source emits data with variable time delay and can start and stop at various times.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mn9u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mn9u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 424w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 848w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 1272w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mn9u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png" width="497" height="242.4390243902439" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:340,&quot;width&quot;:697,&quot;resizeWidth&quot;:497,&quot;bytes&quot;:80889,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Mn9u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 424w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 848w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 1272w, https://substackcdn.com/image/fetch/$s_!Mn9u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0fdf6dfa-0cef-4348-8fa6-d73392ae610d_697x340.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Challenge of using existing systems</strong></h3><p>Current systems that are commonly being used such as time-series databases (Influx, Timescale, Clickhouse, etc) are built for good support for analytical queries but don&#8217;t have great ingestion performance. </p><p>Monitoring storage systems such as Prometheus do have better ingestion performances. However, it still has scalability problems when hitting a certain scale threshold as it&#8217;s designed to ensure multiple writers to the same data source are in order with a mutex per source, which contributes to 25% of the write performance overhead.</p><p>More scalable versions of Prometheus such as M3 and Thanos alleviate these problems by running a sharded Prometheus with a coordination layer on top. This helps scale the existing Prometheus design but each shard still performs the same way.</p><h3><strong>How MACH works</strong></h3><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-t7D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-t7D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 424w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 848w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 1272w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-t7D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png" width="629" height="466.9710564399421" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:513,&quot;width&quot;:691,&quot;resizeWidth&quot;:629,&quot;bytes&quot;:117439,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-t7D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 424w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 848w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 1272w, https://substackcdn.com/image/fetch/$s_!-t7D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F58a3a0d9-ca7e-471c-b2db-83f19f449e50_691x513.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Mach is designed to be able to handle ingesting large amounts of sources and metrics data with a variable rate (multivariate) while having low latency reads in real-time.</p><p>The key design to improve ingestion is to have an architecture with minimal locking and global state and to have loosely coupled components with minimum locking and coordination. This allows Mach to scale to a larger scale of writers and readers with better performance. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BRO9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BRO9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 424w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 848w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 1272w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BRO9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png" width="1441" height="600" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/affa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1441,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:214702,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BRO9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 424w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 848w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 1272w, https://substackcdn.com/image/fetch/$s_!BRO9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faffa09d3-4bdd-4f34-a7f8-44aebfe11ae4_1441x600.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Time-series databases allow updates and out-of-order writes which requires them to store and organize data with B+ trees or similar, which slows down the ingestion performance. Mach assumes data is mostly in order and no updates are allowed, which allows writers to directly be appended and have optionally an out-of-order in-memory buffer that gets merged later.</p><p>Each Mach writer thread holds its own state and writes to a single segment in memory, whereas the global hash table only holds which source write should be routed to which writer thread. </p><p>Each writer has three levels of data per writer:</p><ol><li><p><strong>Active Segment</strong>: It first appends to the active segment in memory up until a certain configured size</p></li><li><p><strong>Active Block</strong>: Once the segment is full, it moves to compress the full segment in memory in batch, instead of compressing on each write in TSDBs. This becomes part of an active block in memory</p></li><li><p><strong>Persistent Block</strong>: Once the active block is full, the full block is appended to a dedicated file for the writer thread on disk. Once the file size exceeds the limit, the writer acquires a new file to write.</p></li></ol><p>On the read side, Mach serves read requests by creating snapshots based on the source and time of the request, which records the block metadata written in all three levels of writer data without blocking any writes. The requestor can then request to read blocks that are within the time range requested, which is also efficient given most already appended data are immutable and only requires fast locking.</p><h3>How fast is Mach?</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cNIS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cNIS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 424w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 848w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 1272w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cNIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png" width="1456" height="450" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:227972,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cNIS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 424w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 848w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 1272w, https://substackcdn.com/image/fetch/$s_!cNIS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F47f22c8c-8fda-442f-b065-3cd9346bab6f_2228x688.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Using data coming from 700 data sources each with 18 metrics and 32 samples each, Mach outperforms the 2nd fastest system in terms of ingestion by 2-4x (depending on the rate of data), which also outperforms InfluxDB by 20x and RocksDB by 60x. Running with 1 million data sources, Mach consistently performs 4x over Prometheus, while InfluxDB and RocksDB both timed out.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mD73!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mD73!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 424w, https://substackcdn.com/image/fetch/$s_!mD73!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 848w, https://substackcdn.com/image/fetch/$s_!mD73!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 1272w, https://substackcdn.com/image/fetch/$s_!mD73!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mD73!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png" width="534" height="277.8979591836735" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:357,&quot;width&quot;:686,&quot;resizeWidth&quot;:534,&quot;bytes&quot;:75995,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mD73!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 424w, https://substackcdn.com/image/fetch/$s_!mD73!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 848w, https://substackcdn.com/image/fetch/$s_!mD73!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 1272w, https://substackcdn.com/image/fetch/$s_!mD73!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F12b32fd0-d894-4d1a-bb00-4ef1c14b5799_686x357.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>On read performance, while reading data that are within the recent 1 hour, Mach and Prometheus both perform 5x better than InfluxDB as they&#8217;re both designed to serve recent data faster. However, when reading data within the last 24 hours, InfluxDB is on par with Mach, but cannot scale once concurrent reads start to increase. </p><h3>Final thoughts</h3><p>It&#8217;s interesting to see the tradeoff when it comes to designing a storage system, between balancing both write/read performance and also the range of queries and the temporal characteristics. </p><p>It&#8217;s also another case where a share-nothing design leads to much scalable performance on a single node, which is similar to how newer systems like Scyalladb and Redpanda (leveraging Seastar) also help reduce bottlenecks when it comes to performance.</p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Append is Near: Log-based Data Management on ZNS SSDs]]></title><description><![CDATA[The third paper from CIDR 2022 that I&#8217;m covering is the paper that talks about ideas to improve log-based data management on Zoned Namespace (ZNS) SSDs.]]></description><link>https://blog.essence.dev/p/append-is-near-log-based-data-management</link><guid isPermaLink="false">https://blog.essence.dev/p/append-is-near-log-based-data-management</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Sun, 05 Jun 2022 07:43:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!l3ZR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The <a href="http://www.cidrdb.org/cidr2022/papers/p93-purandare.pdf">third paper</a> from CIDR 2022 that I&#8217;m covering is the paper that talks about ideas to improve log-based data management on Zoned Namespace (ZNS) SSDs.</p><h3><strong>Zoned Namespaces in SSD</strong></h3><p>Zoned namespaces are a new NVM SSD interface that was introduced around 2020, instead of every application writing blocks interleaved in SSDs, ZNS can divide an SSD into fixed-sized zones, and allow the application to decide which SSD zone to write data from.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l3ZR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l3ZR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 424w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 848w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 1272w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l3ZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png" width="1456" height="787" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/e7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:787,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:705182,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!l3ZR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 424w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 848w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 1272w, https://substackcdn.com/image/fetch/$s_!l3ZR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7fcd3dc-15f5-4e65-8dae-c555fee28dc4_1661x898.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Having fixed zones in SSDs, allows each zone to be garbage collected together and helps reduce a lot of the write amplification issues with SSDs.</p><p>This also creates more opportunities for data applications to utilize the new commands that are introduced with ZNS, such as Zone Append which directly appends data into each zone without keeping track of which block / tail the zone has written to. Using Zone Append, data applications no longer have to keep track of pointers and perform locking, which also improves performance as SSD can write data on better hardware alignment as well.  </p><p><a href="https://www.usenix.org/system/files/vault20_slides_bjorling.pdf">(For more details can also refer to this material from Vault 2020)</a></p><h3>Group Append</h3><p>The paper proposed a new command to be introduced into ZNS, which is an even simpler version of Zone Append. Zone Append requires each writer to write out a block size of data, which essentially means the application has to keep a buffer internally and do the bookkeeping necessary to flush. Group Append allows the SSD controller to take any arbitrary size of writes and can buffer data on the device level. </p><h3>How software / hardware codesign improves data management</h3><p>The paper went on to discuss how various data management systems (log-based file systems, RocksDB, Databases, and Event logs) can leverage ZNS SSD and new commands like Group Append can change how the software is designed, also further possible research directions for each as well.</p><p>I won&#8217;t cover every improvement proposal, so I'm just picking a few to highlight.</p><p><strong>RocksDB</strong> is a key-value store that uses an LSM (Log-structured merge) tree to store data, which internally keeps an append-only key-value pair structure called SSTables (Sorted String Tables).</p><p>With normal SSDs, RocksDB will be writing out SSTables to disk which blocks will be interleaved with other IO writes. Since the design of LSM is to store multiple levels of SSTable cache, each time an SSTable with a particular level is merged to write out to the upper level, data needs to be both removed and written to the new level. This causes write-amplification on the SSD that reduces the lifetime of the disk, and also performance wise isn&#8217;t the most optimal. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XhBJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XhBJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 424w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 848w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 1272w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XhBJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png" width="623" height="470" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/cb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:470,&quot;width&quot;:623,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:81635,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XhBJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 424w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 848w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 1272w, https://substackcdn.com/image/fetch/$s_!XhBJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb10ad2e-34b3-4113-8d75-c1fb24c6ae25_623x470.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Using ZNS SSD, we can now map the SSTable data blocks that have the same lifetime into each zone. This allows the LSM tree to instruct the SSD to remove the entire zone in one command, which greatly reduces write amplification and improves efficiency. </p><p>However, this also brings more research directions and questions with this approach, listing a few here:</p><ul><li><p>What is the most optimal way to distribute the data blocks with zones given the data blocks will vary in size?</p></li><li><p>How do we store the metadata associated with the SSTables, as it could involve a lot of random writes? </p></li></ul><p><strong>Relational Databases </strong>such as MySQL currently write all the transactions into a write-ahead log (WAL) which allows the databases to recover their state in restarts. With normal SSDs, it&#8217;s up to the DBMS to understand how and when to flush the WAL files among multiple log writer threads into different files concurrently.</p><p>With ZNS SSD and Group Append, we can move each file write to each zone, and each writer can send Group Append with data to the SSD device controller without buffering on the DBMS side. This allows a lot more frequent commits and more efficient implementations, trading off more activities and buffering on the controller side. This also allows the DBMS to efficiently remove WAL by erasing zones directly.</p><p>Similarly, this brings more research directions. One example is how can we redesign the DBMS implementation even further, assuming all the incoming changes can be stored effectively to WAL with Group Append, DBMS should be able to just track these appends commit IDs with additional metadata and simplify what it needs to record in its own database persistent logs.</p><h2>Last words</h2><p>It&#8217;s exciting to see the continuous improvements that happen on the hardware side, and how software can be redesigned that brings a lot more efficiency. </p><p>Seeing changes like this also is a reminder that improvements to the disk storage are not just about the cost and performance of IO, but also additional software commands that controllers can bring that can perform operations a lot more efficiently.</p><p></p><p></p><p></p><p></p><p> </p><p></p>]]></content:encoded></item><item><title><![CDATA[Data Management Opportunities For Foundation Models]]></title><description><![CDATA[CIDR 2022 Series #2]]></description><link>https://blog.essence.dev/p/data-management-opportunities-for</link><guid isPermaLink="false">https://blog.essence.dev/p/data-management-opportunities-for</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Tue, 17 May 2022 07:17:29 GMT</pubDate><content:encoded><![CDATA[<p>The following <a href="https://www.cidrdb.org/cidr2022/papers/p51-orr.pdf">paper</a> <a href="https://www.youtube.com/watch?v=8u7bwW4h4io">(video)</a> from CIDR 2022 came from the Stanford AI Group, a short paper addressing the list of foundation model data management opportunities. It doesn&#8217;t offer any solutions but it&#8217;s worth going through the list of challenges.</p><p><strong>What is a foundation model</strong>?</p><p>AI models have been starting to shift from a model-centric world where data scientists have to carefully engineer and label features in each domain to train a model, to a data-centric model that&#8217;s bringing in a mass amount of unlabeled and variety of data to train large models that can be applied to multiple tasks (e.g: GPT-3). </p><p><strong>New Challenges with foundation models</strong></p><p>This brings in several new challenges, the first is solving the <strong>data integration </strong>challenge of bringing large volumes (petabytes) of multi-modal (text, images, etc) unstructured and structured data that&#8217;s repeatable to continue to train these models. Tracking the data provenance is a challenge to </p><p>The second is <strong>data monitoring, </strong>which given the large amounts of unlabeled data being used to train these models, it becomes hard to understand how to correlate unlabeled data into model performance drifts, and help engineers know how to pinpoint areas of data that is relevant for the performance problems.</p><p>The last is <strong>model patching,</strong> as comparing to have lots of individual models, engineers now are patching a larger model to fix undesirable behaviors while not creating more problems for other tasks. There is work needed for suggestions on how to fix the data rather the model architecture given that it&#8217;s fixed in these models. </p><p><strong>Conclusion</strong></p><p>Overall this is a pretty short paper which doesn&#8217;t really need a summary, but I think it&#8217;s a good reminder that the ML industry is still early where a lot of work is still evolving, and the engineering and research that is ongoing is continuing to make more improvements of how the industry evolves.</p><p>There is more work that&#8217;s really interesting of how foundational models will not just impact the data management, but also applications and related toolings which we will hopefully cover in other work.</p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Are You Sure You Want to Use MMAP in Your Database Management System?]]></title><description><![CDATA[I&#8217;m starting on a series to cover papers from CIDR 2022, and the first one I&#8217;m covering is the paper coming out of CMU (video) that talks about why using mmap in databases are more challenging than you think.]]></description><link>https://blog.essence.dev/p/are-you-sure-you-want-to-use-mmap</link><guid isPermaLink="false">https://blog.essence.dev/p/are-you-sure-you-want-to-use-mmap</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Tue, 03 May 2022 02:28:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9FuZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;m starting on a series to cover papers from CIDR 2022, and the first one I&#8217;m covering is the <a href="http://cidrdb.org/cidr2022/papers/p13-crotty.pdf">paper coming out of CMU</a> <a href="https://www.youtube.com/watch?v=1BRGU_AS25c&amp;t=1s">(video)</a> that talks about why using mmap in databases are more challenging than you think. </p><p>Covering this paper is quite interesting to me for two reasons:</p><ul><li><p>I look at quite a few databases or related startups from an investor POV, and quite often you see mmap being used in some part of the systems. It&#8217;s usually part of the discussion I have with founders, especially that who haven&#8217;t built datastores in production at scale, who usually underestimate by a few orders of magnitude how difficult it is to implement a new one. </p></li><li><p>One of my typical system design interview questions, when I was hiring engineers, was also discussing how to design a key-value store with specific constraints, and it&#8217;s quite often you see mmap being part of the solution as well. </p></li></ul><p>Quoting directly from the paper, &#8220;mmap and DBMSs are like coffee and spicy food: an unfortunate combination that becomes obvious after the fact.&#8221;</p><p><strong>What is MMAP?</strong></p><p>For those that are unfamiliar with mmap, it&#8217;s a <a href="https://en.wikipedia.org/wiki/Mmap">system call</a> in Linux systems that allows you to map file content on disk into memory without having to spend I/O up front to load them. This allows programmers to very simply write data in memory, and let OS handles the I/O as needed in the background. There is also some potential performance benefits since having the OS accessing content can leverage the OS page cache directly without a user-space copy.</p><p>Many databases has started their v1 implementation using mmap for it&#8217;s main storage implementation, like Influx, Singlestore, QuestDB, etc, while a lot of them has moved away after hitting various problems.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9FuZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9FuZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 424w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 848w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 1272w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9FuZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png" width="1456" height="962" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1273834,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9FuZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 424w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 848w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 1272w, https://substackcdn.com/image/fetch/$s_!9FuZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55ba771c-72d5-44d1-ba7f-de936843864f_1820x1202.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>(Source: <a href="https://www.youtube.com/watch?v=1BRGU_AS25c&amp;t=1s">CIDR 2022 video</a>)</p><p><strong>What&#8217;s wrong with mmap?</strong></p><p>If you choose to use mmap for your database, you will hit the following four problems:</p><ul><li><p>Transactional safety</p></li></ul><p>Because the OS can choose to flush data from memory mapped from mmap to disk any time based on memory pressure, means the database could be writing dirty or in-progress data to disk before it&#8217;s fully committed. </p><p>Developers hitting this problem with mmap has to implement a WAL (write ahead log) with multiple copies of data either in user space or another mmaped file, which causes duplicated data with a lot more complex logic. </p><ul><li><p>I/O stalls</p></li></ul><p>Another related problem from the OS evicting data from memory, is that the database no longer knows which part of the memory mapped file is actually in memory. This causes unpredictable stalls when reading from a mmaped memory, and none of the solutions on top (mlock, madvise) is an easy fix.</p><ul><li><p>Error handling</p></li></ul><p>Databases typically do checksum matching to ensure data integrity, and this becomes hard with a mmaped file as the OS might have evict and sync to disk at any point. This essentially means the database need to validate the checksum on each access.</p><p>It&#8217;s also harder to do error handling with mmaped memory calls as instead of having generic I/O errors when reading from disk, the OS can produce signals that is harder to manage. </p><ul><li><p>Performance issues</p></li></ul><p>The most significant problem is actually performance. Even though calling a mmaped file can avoid system calls like open/close and use the page cache, typically OS like Linux isn&#8217;t designed with multiple threads/cores attempting to access the same mmap region which causes issues like TLB shootdowns. In evaluation we can see that performance gets worse (2-20x) especially at the point when memory is full. </p><p></p><p><strong>Closing thoughts</strong></p><p>The following is the advice the paper parted with &#8594;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wshd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wshd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 424w, https://substackcdn.com/image/fetch/$s_!wshd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 848w, https://substackcdn.com/image/fetch/$s_!wshd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 1272w, https://substackcdn.com/image/fetch/$s_!wshd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wshd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png" width="1456" height="863" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:312200,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wshd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 424w, https://substackcdn.com/image/fetch/$s_!wshd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 848w, https://substackcdn.com/image/fetch/$s_!wshd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 1272w, https://substackcdn.com/image/fetch/$s_!wshd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75eee03f-b517-4788-9476-12cadf7ac219_1498x888.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Which in my simpler laymen terms, use mmap if you want to hack a v0/v1 product or a small in-memory db, but otherwise stay away from it.</p><p>This is also a good illustration of why building a production ready database is hard, there are lots of details in hand to make a database not lose data but also have the performance or features to be able to stand out.</p><p></p>]]></content:encoded></item><item><title><![CDATA[OSS System Breakdown #2 - Faasm: Serverless runtime for stateful high-performance jobs ]]></title><description><![CDATA[Hi all!]]></description><link>https://blog.essence.dev/p/oss-system-breakdown-2-faasm-serverless</link><guid isPermaLink="false">https://blog.essence.dev/p/oss-system-breakdown-2-faasm-serverless</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Mon, 28 Mar 2022 16:00:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/uRtkAOb1yrk" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div id="youtube2-uRtkAOb1yrk" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;uRtkAOb1yrk&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/uRtkAOb1yrk?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Hi all!</p><p>Just recorded our 2nd OSS System Breakdown, where I interviewed <a href="https://www.simonshillaker.com/">Simon Shillaker</a> who is a researcher at Imperial College of London working in the Large Scale Data Systems group.</p><p>We talked about his latest publication and project <a href="http://github.com/faasm/faasm">Faasm</a>, that is a new Wasm runtime that is designed for more flexibility in isolation and resource sharing, so it can provide much higher performance for stateful applications.</p><p>There is a whole realm of research that is happening on Wasm / Serverless runtime and I learned a lot through this interview about some of the interesting exploration and results Simon was able to get.</p><p>Please check it out and will appreciate sharing with others interested in serverless and wasm runtimes as well!</p><p></p><p>Tim </p>]]></content:encoded></item><item><title><![CDATA[New Directions in Cloud Programming]]></title><description><![CDATA[New Directions in Cloud Programming (CIDR 2021)]]></description><link>https://blog.essence.dev/p/new-directions-in-cloud-programming</link><guid isPermaLink="false">https://blog.essence.dev/p/new-directions-in-cloud-programming</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Fri, 25 Mar 2022 07:50:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Y9M9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://arxiv.org/abs/2101.01159">New Directions in Cloud Programming (CIDR 2021)</a></p><p></p><p>Today as a developer, developing applications to run in the cloud in a highly available and performant manner isn&#8217;t straightforward at all. There are many factors that can </p><p>cause downtimes (VM crashing or slowing down, underlying infra degrades, outages, etc). This has led to where we are today which is what we all know as the &#8220;cloud-native&#8221; application way. Even though we see the rise of Docker, Kubernetes making some level complexity easier, the whole toolchain is really hard to learn and a normal application developer needs to know a lot of knowledge to be able to leverage all of these frameworks well. </p><p>What if, there can be a new programming model and language, that can understand the intent of the application, and create a compiler that can generate the full application internals that understands how to be &#8220;cloud-native&#8221;? We&#8217;re seeing commercial languages that have been going down this path like <a href="https://darklang.com/">Dark</a> or <a href="https://www.unison-lang.org/">Unison</a>.</p><p>What the &#8220;New Directions in Cloud Programming&#8221; paper is attempting is not to specify a complete solution in detail, but to propose a high-level programming stack and further work needed to complete the puzzle.</p><p><strong>Moving towards a declarative model with a gradual approach</strong></p><p>Today&#8217;s programming languages are most <a href="https://en.wikipedia.org/wiki/Imperative_programming">imperative</a>, which leads to a lot more control to the developers but also means each developer needs to handle a lot of the details of the service themselves.</p><p>Just like how we moved database querying to a declarative language (SQL), we should also move as much as possible to a declarative fashion when it comes to programming the cloud. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y9M9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y9M9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 424w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 848w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 1272w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y9M9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png" width="378" height="322" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/75723f59-98ac-4068-b55e-c79918518802_378x322.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:322,&quot;width&quot;:378,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45955,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Y9M9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 424w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 848w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 1272w, https://substackcdn.com/image/fetch/$s_!Y9M9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F75723f59-98ac-4068-b55e-c79918518802_378x322.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The paper described a new compiler/language stack called the Hydro, that is designed to bring on a staged approach of generating Hydroflow programs that is ultimately able to orchestrate various cloud resources to deploy the application.</p><p>At a high level, Hydro first accepts various kinds of existing DSLs such as Spark, Actor frameworks like Orleans, or Futures like Ray, which are existing programming frameworks and languages. This creates a Hydralogic IR output that is human readable like the following:  </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LKkH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LKkH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 424w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 848w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 1272w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LKkH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png" width="364" height="686" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:686,&quot;width&quot;:364,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:182307,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LKkH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 424w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 848w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 1272w, https://substackcdn.com/image/fetch/$s_!LKkH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997521d8-2fb6-487d-95a9-40f0314bd14c_364x686.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This allows developers to fine-tune or configure different aspects of a cloud application, which we will touch on the various areas of configurations that Hydrologic supports in the next section.</p><p>After the IR program is generated and configured, then it gets compiled into actual implementation. </p><p><strong>PACT: Program semantics, Availability, Consistency, Targets For Optimization</strong></p><p>Diving a bit deeper into the design spaces, there are four facets that it allows developers to configure in isolation. This is a pretty interesting paradigm as typically in a program a developer needs to consider multiple facets when writing each line of code.</p><p>In the Hydrologic model, it breaks down the declarative sections into these different facets so developers can declare what is level of optimization or configuration it needs for its application. Each facet has its own syntax and code generator, that performs a search-based approach when generating optimized code and not a typical rule-based approach.</p><p>The first facet which is the <em>Program Semantics </em>is basically moving the actual business logic of your application into declarative syntax, so the compiler can automatically optimize a lot of distributed / parallel aspects. However, most programs aren&#8217;t implemented in a declarative way, and learning a declarative distributed programming language (e.g: CALM) isn&#8217;t as simple for developers. The paper proposes to use <em><a href="https://metalift.github.io/">Verified Lifting</a>, </em>that in summary is a way to translate a sequential language (Java, etc) or framework (Spark, etc) into a target language (which is Hydrologic in this case), by searching over possible candidate code instead of the traditional rule-based approach.  </p><p>The second facet is <em>Availability, </em>which allows each API to describe the availability factor, such as &#8220;This API should tolerate 1 availability zone being unavailable&#8221;. One example of how the compiler uses this is it can translate this into deploying the backend into two availability zones and create a load-balancer in front that can automatically failover. It also can replicate the backend state automatically to be stored across two AZs as well.</p><p>The third facet is <em>Consistency</em>, which touches the consistency level (ACID isolation, invariances on a property, etc) of your application state that&#8217;s configured also on a per API basis. By lifting the consistency specification on the API level, allows code generator to be able to holistically optimize both client and server to optimally <a href="http://www.bailis.org/papers/ca-vldb2015.pdf">avoid coordination</a> and improve performance. This also allows code generators to explore the various possible implementation to enforce consistency based on the data analysis, for example, exploring either leveraging CRDTs or choosing a more consensus-based approach.</p><p>The last facet is <em>Target For Optimization, </em>which simply states what are the cost and performance targets that the application should optimize for. This allows the code generator to consider how to target instance types choices, number of machines, and other factors that are able to both optimize for cost and performance.</p><p>The output of the code generators from these facets is another IR that can be generate a full implementation / deployments that leverages various existing Cloud resources or managed services to fulfill this goal. </p><p><strong>Conclusion</strong></p><p>While this paper has proposed a lot more future research areas and questions, it is really interesting to see what a possible high-level path can look like when we can move the developer&#8217;s concern into a much more high-level language.</p><p>I think moving away from all the proposed research areas, it&#8217;s also interesting to ask what is a declarative abstraction that developers will like to leverage in today&#8217;s development and infra stack. The rise of IaaC (Terraform, Pulumi, etc) has brought in a higher declarative language to be able to repeatable deploy and maintain infrastructure state. </p><p>I believe there will also be innovation that happens on the application level that also allows you to declare application logic and entities in a more declarative way. <a href="http://www.chiselstrike.com">Chiselstrike</a> (Essence VC portfolio) is one step in that direction, that allows front-end developers to declare the entities / schema and logic around the entities in a typescript library, which in turn gets compiled into a backend API and more.</p><p>It&#8217;s exciting to see how research and also today&#8217;s developer stack will continue to evolve, and also how the move to serverless will continue to happen as well.</p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Pylive: On-the-Fly Code Change for Python-based Online Services]]></title><description><![CDATA[Pylive: On-the-Fly Code Change for Python-based Online Services (ATC 2021), From Haochen Huang, Chengcheng Xiang, Li Zhong, and Yuanyuan Zhou, University of California, San Diego]]></description><link>https://blog.essence.dev/p/pylive-on-the-fly-code-change-for</link><guid isPermaLink="false">https://blog.essence.dev/p/pylive-on-the-fly-code-change-for</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Thu, 03 Feb 2022 08:00:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!L2Y3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://www.usenix.org/system/files/atc21-huang-haochen.pdf">Pylive: On-the-Fly Code Change for Python-based Online Services (ATC 2021)</a>, From Haochen Huang, Chengcheng Xiang, Li Zhong, and Yuanyuan Zhou, <em>University of California, San Diego</em></p><p>Running a high availability online service is still challenging today, as there are many factors that can cause a service to fail, especially when trying to keep your code shipping velocity at a decent pace (aka &#8220;Move fast and break things&#8221;). <a href="https://blog.roblox.com/2022/01/roblox-return-to-service-10-28-10-31-2021/">And it&#8217;s extremely painful to debug and find root causes in online services.</a></p><p>Most infra teams today rely on monitoring metrics and logs, and when there isn&#8217;t enough information then making code changes to add logs or instrumentation and redeploy the online services to get more clues.</p><p>The problem with this approach is that redeploying and restarting services is usually not a straightforward process, depending on how much infrastructure is set up to do blue/green deployments, traffic steering, etc. Therefore, it&#8217;s usually very hard to make changes to acquire more data to debug in a production environment.</p><p>Another problem is when a service is restarted, all the in-memory state is lost which makes warming up the service and debugging extra hard especially when the issue only occurs in particular load conditions.</p><p>Pylive is looking to change this by allowing engineers to make code changes on the fly without the need to restart a service, and we will go over some of the important elements of how this is done.</p><h2><strong>What is Pylive?</strong></h2><p><a href="https://github.com/devopspp/pyliveupdate">Pylive </a>is a library that developers can import into their code and runs a separate server that allows requests to be made to the current running python program.  </p><p>Developers can then add more instrumentation or profiling to existing code by adding callbacks wrapped around functions or patching whole python functions without restarting the service.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L2Y3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L2Y3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 424w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 848w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 1272w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L2Y3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png" width="671" height="365" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/f09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:365,&quot;width&quot;:671,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:77349,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L2Y3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 424w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 848w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 1272w, https://substackcdn.com/image/fetch/$s_!L2Y3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff09cdea6-0f71-4605-95e5-5b5199dc0c3c_671x365.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Challenges of updating code live</strong></p><p>There are several challenges when it comes to implementing Pylive:</p><ol><li><p><strong>How do we modify the running code?</strong></p></li><li><p><strong>When can we modify the code?</strong></p></li><li><p><strong>How do we handle multi-threaded / processes updates?</strong></p></li></ol><p></p><p><strong>To address the first problem</strong>, Pylive leverages the dynamic typing and object model in Python, since each variable type in Python can be changed dynamically, changing an existing argument or variable&#8217;s type is just a local change and doesn&#8217;t require program-wide modification. Comparing this to statically typed languages like Java or C++, modifying an existing function type often means modifying the underlying VM or binary which is very tricky. Therefore, leveraging the ability to replace code (obj.__code__) and functions dynamically without any underlying changes is a very convenient way of fully leveraging the power of dynamic languages like Python.</p><p><strong>The more tricky problem is when it is safe to modify code</strong>, as changing code in the middle of execution can be really tricky. Using the following as an example, modifying code in a critical section in between locks can lead to undefined outcomes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Ig1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Ig1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 424w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 848w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Ig1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png" width="1002" height="722" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:722,&quot;width&quot;:1002,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:173056,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Ig1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 424w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 848w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 1272w, https://substackcdn.com/image/fetch/$s_!2Ig1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2498f5fb-8ec7-4ec2-8cf3-a912ecffb7a5_1002x722.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>There is no guaranteed automated way to detect what section is safe to modify, so this relies on developers specifically stating which section is safe to change and when which is also referred to as a safe point.</p><p>One safepoint that Pylive supports is to replace a function when there is no active caller, which Pylive supports by scanning all thread stacks for any active reference of that section.</p><p>Another safepoint is to call a user-provided function to check if it&#8217;s safe to modify the code, which in the previous example allows the developer to write code to check if the previous lock is still being held. </p><p><strong>The last problem to handle is multi-threaded and processes update. </strong>Multi-threading is easier to support in Python given there is a single global lock (GIL), therefore if the Pylive thread is able to hold on to the GIL then it is safe to evaluate safepoints and modify. In a multi-process situation, each subprocess is spawned with a Pylive listener that is able to receive requests, and a single controller dispatches code change requests to all subprocesses.</p><h2><strong>Why this is useful &amp; Implications</strong></h2><p>The most obvious value this brings is the ability to add logging and instrumentation, or even add patches to live running production code without waiting for this loop: </p><p>                    code &#8594; build &#8594; verify &#8594; deploy &#8594; wait until conditions hit</p><p>Although in practice, in larger organizations allowing developers to change production on the fly without any verification is a dangerous step as it can make existing problems even worse.</p><p>However, I do think that there is a new paradigm of development that is changing how developers develop, build, test and deploy and debug code. </p><p>The current state of the art of ensuring production systems&#8217; quality is still mostly about storing and reacting to information from monitoring systems. This includes watching what metrics and logs have been produced (e.g: Datadog), piecing together how services/requests work (e.g: Lightstep), managing and triaging incidents together (e.g: Jelli), etc. </p><p>One new wave of startups is moving towards ensuring software quality by shifting left quality checking, either by faster integration tests (e.g: Signadot), replaying API traffic (e.g: Speedscale), or automated quality, and security scanning (e.g: Levo.ai, Optic).</p><p>Now there are also a new set of companies tackling the idea of capturing more detailed information at a code level (e.g: Polar Signals) and also replay code executions (e.g: Replay.io) also debug in production (e.g: Rookout, Thundra).</p><p>Pylive or similar research is helping to move to build this new development and debug experiences in a more feasible way, as tools get deeper into a language level, it provides a richer set of interactions that developers can be able to interact with services.</p><p>Getting into the language object model not just allows you to change code on the fly, but also captures a lot richer information that helps potentially replay production incidents on your laptops, or capture live state capturing in prod from your IDE, to collaboratively modify code in production with a sign off process, etc.</p><p>With more powerful tools certainly comes with greater responsibility, but I believe the flexibility and agility that teams can unlock will continue to push the tools towards this direction overall.</p><p></p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[First OSS System Breakdown! Interviewing Paul Khuong from Backtrace Labs to talk about Verneuil]]></title><description><![CDATA[Hey&#8217;ll!]]></description><link>https://blog.essence.dev/p/first-oss-system-breakdown-interviewing</link><guid isPermaLink="false">https://blog.essence.dev/p/first-oss-system-breakdown-interviewing</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Tue, 18 Jan 2022 05:23:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/3dIS2f0PC7g" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey&#8217;ll! </p><p>Hope you all have a great start of the year :)</p><p>This year I&#8217;m looking to experiment with different kinds of content, and the first content series I&#8217;m trying out is called the <strong>OSS System Breakdown.</strong></p><p>As the name suggests, we&#8217;re looking to breakdown interesting open source projects on the technical design and implementation side, walk through some difficult problems and design choices that people need to navigate in these projects or features.</p><p>Our very first guest is Paul Khuong, who is an engineer at Backtrace Labs and released an open source project called <a href="https://engineering.backtrace.io/2021-12-02-verneuil-s3-backed-asynchronous-replication-for-sqlite/">Verneuil</a>, that is a S3-backed async data replication layer for SQLite. <a href="https://asciinema.org/a/457886">(Demo here</a>)</p><div id="youtube2-3dIS2f0PC7g" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;3dIS2f0PC7g&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/3dIS2f0PC7g?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>There are interesting tidbits about how to extend the virtual filesystem layer in SQLite, how to design for backoff in replication, and tradeoffs of cost and performance.</p><p>Would appreciate any feedback if this is useful content, and thanks again for Paul willing to do this!</p><p>Tim</p>]]></content:encoded></item><item><title><![CDATA[From Cloud Computing to Sky Computing]]></title><description><![CDATA[Today I&#8217;m going to cover a paper that was mentioned in the Twitter thread from Erik Bernhardsson&#8217;s blog post, @sh_reya mentioned that Berkeley RISELab is turning into Sky Lab &#8594;]]></description><link>https://blog.essence.dev/p/from-cloud-computing-to-sky-computing</link><guid isPermaLink="false">https://blog.essence.dev/p/from-cloud-computing-to-sky-computing</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Fri, 24 Dec 2021 17:00:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!v_-9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today I&#8217;m going to cover a paper that was mentioned in the Twitter thread from Erik Bernhardsson&#8217;s blog post, @sh_reya mentioned that Berkeley RISELab is turning into Sky Lab &#8594;</p><p></p><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://twitter.com/sh_reya/status/1465738012612915204?s=21&quot;,&quot;full_text&quot;:&quot;<span class=\&quot;tweet-fake-link\&quot;>@bernhardsson</span> Nice read. I love reading posts that corroborate the bets I've subscribed to &#9786;&#65039; I'm sure you are already aware about RISE Lab turning into Sky Lab: &quot;,&quot;username&quot;:&quot;sh_reya&quot;,&quot;name&quot;:&quot;Shreya Shankar&quot;,&quot;profile_image_url&quot;:&quot;&quot;,&quot;date&quot;:&quot;Tue Nov 30 17:42:28 +0000 2021&quot;,&quot;photos&quot;:[],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:0,&quot;retweet_count&quot;:0,&quot;like_count&quot;:6,&quot;impression_count&quot;:0,&quot;expanded_url&quot;:{&quot;url&quot;:&quot;https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s02-stoica.pdf&quot;,&quot;title&quot;:null,&quot;description&quot;:null,&quot;domain&quot;:&quot;sigops.org&quot;},&quot;video_url&quot;:null,&quot;belowTheFold&quot;:false}" data-component-name="Twitter2ToDOM"></div><p></p><p>I was intrigued to check out this <a href="https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s02-stoica.pdf">paper</a> and decided to cover the major points of this paper with my own color.</p><h2><strong>Driving towards a commodity service</strong></h2><p>We have seen technologies that started with limited and proprietary access slowly become a commodity. The technologies or communication products we use today such as the phone, internet, PC hardware and more have once was only manufactured by a very few vendors with proprietary interfaces and no open standard.</p><p>We have now evolved into having all of these becoming a commodity, where we can use any phone from any service, access a website from any part of the world, because of open standards and shared agreements between vendors and government to be able to enforce a level of uniformity. </p><p>As all enterprises and software are all moving to the Cloud, the Cloud infrastructure layer becomes the defacto platform where all applications and developers run on. <a href="https://www.economist.com/business/the-battle-of-the-computing-clouds-is-intensifying/21806813">Some companies are spending 80% of their revenue on the Cloud alone, which for many the Cloud is as electricity</a>.</p><p>Now looking at Cloud providers, each cloud IaaS provider even though provides a large number of similar services, has opted to implement completely different API interfaces, identity systems, pricing models, and data patterns which leads to porting from one cloud to another very difficult. </p><p>This means each developer needs to carefully choose the specific Cloud provider it wants to deploy on, as it gets increasingly difficult to port to another Cloud when desired. </p><h2>Why should we abstract away from a single Cloud?</h2><p>The paper argues that this inherent difficulty to move simply from one Cloud to another is inhibiting the ability for users to choose the best services and prices for their specific needs.</p><p>Taking training an ML model on Imagenet, <a href="https://app.mosaicml.com/explorer/imagenet">the price and performance tradeoff differs depending on the type of instance you run in different clouds on a factor of sometimes 2-10x</a>. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!v_-9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v_-9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 424w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 848w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 1272w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v_-9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png" width="1100" height="629" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:629,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:791753,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!v_-9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 424w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 848w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 1272w, https://substackcdn.com/image/fetch/$s_!v_-9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F386e16af-69ae-4839-b1cc-3e9900e726be_2118x1212.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>(credit from MosaicML)</p><p>Some large companies are also setting up multi-cloud deployments to also reduce catastrophic failure from a single provider (<a href="https://twitter.com/cloudpundit/status/1448713618321723400?s=20">though not everyone thinks this is worthwhile)</a>.</p><p>Another interesting argument in the paper is that having each &#8220;monolith cloud&#8221; being not interoperable with each other stiffens innovation outside of those clouds. For example, for hardware accelerators (GPU, FPGA, AI accelerators) to be able to offer their devices as a cloud service, would either need to partner and convince a large cloud provider to offer them, or create their own managed cloud solution.</p><p>If there is a way to create an open standard that provides an abstraction layer for Cloud computing, then it could create a &#8220;Big Clouds&#8221; vs &#8220;The Rest&#8221;, where the Big Clouds given their size continue to offer their proprietary interfaces and all other long-tail Cloud players can become the open interconnected cloud and offer lower margins given its ability to interoperable with each other.</p><h2>Moving from the Clouds, into the Sky</h2><p>To move away from applications written and deployed into a single cloud, can we come up with a &#8220;Sky Computing&#8221; abstraction that allows apps to move from any cloud to another seamlessly? Or in classic Marc Benioff marketing, bringing on &#8220;No Cloud&#8221; that your software never feels like it&#8217;s locked into a Cloud&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OHid!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OHid!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OHid!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OHid!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OHid!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OHid!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg" width="237" height="212" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:212,&quot;width&quot;:237,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Display No Clouds - Utility Mod by Ocgineer - Trovesaurus&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Display No Clouds - Utility Mod by Ocgineer - Trovesaurus" title="Display No Clouds - Utility Mod by Ocgineer - Trovesaurus" srcset="https://substackcdn.com/image/fetch/$s_!OHid!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OHid!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OHid!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OHid!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3d649a5d-d1fe-4a90-868a-ad9da314ccea_237x212.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LJTj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LJTj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 424w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 848w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 1272w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LJTj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png" width="1100" height="517" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/aebedf17-441e-436e-a003-ede289eb3271_1174x552.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:517,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124429,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LJTj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 424w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 848w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 1272w, https://substackcdn.com/image/fetch/$s_!LJTj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faebedf17-441e-436e-a003-ede289eb3271_1174x552.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Similar to how the internet is a fully interoperable layer between several networks, the paper proposes two major components to enable &#8220;Sky Computing&#8221; to have applications fully interoperable between Clouds (write-once, run-anywhere). </p><p>The components are a Compatibility Layer and an Intercloud Layer.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Py67!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Py67!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 424w, https://substackcdn.com/image/fetch/$s_!Py67!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 848w, https://substackcdn.com/image/fetch/$s_!Py67!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 1272w, https://substackcdn.com/image/fetch/$s_!Py67!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Py67!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png" width="1100" height="628" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:184262,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Py67!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 424w, https://substackcdn.com/image/fetch/$s_!Py67!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 848w, https://substackcdn.com/image/fetch/$s_!Py67!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 1272w, https://substackcdn.com/image/fetch/$s_!Py67!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F10f42247-7e44-4ed8-adaa-31a911603a49_1258x718.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Cloud Compatibility Layer</h3><p>The Cloud Compatibility Layer is an abstraction layer that abstracts away the interfaces and APIs the cloud provider provides, so applications can be built in a way that&#8217;s not directly dependent on the Cloud APIs.</p><p>Most open-source data and infrastructure and libraries projects today are already abstracted away from the Cloud specifics, so users can run these projects on any of the Cloud providers. However, each of these bespoke data applications each undergone its own significant effort to make its library portable, and there isn&#8217;t a standard stack underneath given the huge amount of possible services and APIs to integrate with. Cloud storage is a more common library that OSS libraries integrate, that understands how to read/write data from each Cloud provided blob storage.</p><p>There are certainly vendors looking to abstract away Cloud differences and expose general SDKs or APIs. Backend frameworks like <a href="http://encore.dev">Encore</a>, <a href="https://appwrite.io/">Appwrite</a> allow users to write their backend that&#8217;s Cloud agnostic when they deploy. <a href="https://www.upbound.io/">Upbound</a> abstracts the multi-Cloud operation and development into a single unified interface. <a href="https://localstack.cloud/">Localstack </a>abstracts the Cloud integrations from a developer perspective and allows users to test Cloud integrations from their laptops.</p><p>All of these are different takes on moving the Cloud specifics away from the user so they can focus on their applications instead. However, all of these are early efforts and not a well-recognized standard, where there are still many missing pieces to make a full compatibility layer work.</p><h3>Intercloud Layer</h3><p>Once we have a compatibility layer that can allow the application to move to any Cloud, the user still need to decide which Cloud to run on themselves. The Intercloud Layer automatically unlocks this choice, by transparently moving the applications to the best provider to run a particular workload, just like how internet users aren&#8217;t tracking how the packets are routed among network zones through BGP. </p><p>The Intercloud layer should allow the user to specify how they should run the workload in terms of performance/cost/availability, but not the specific implementation details. For example, &#8220;this is a Tensorflow job, it involves data that cannot leave Germany, and must be finished within the next two hours for under a certain cost.&#8221;</p><p>The intercloud layer can be composed of three services: 1) Service Naming Scheme 2) Directory Service 3) Accounting and Charging.</p><p><strong>The Service Naming Scheme</strong> is a similar concept to DNS, but each identity is a particular Cloud Service that can be invoked, with metadata about pricing, availability, provider name, etc. </p><p><strong>The Directory Service</strong> is an aggregated list of Services provided by each Cloud provider that&#8217;s dynamically updated. A new application request specifying its performance, price, and availability requirements will be submitted to the Directory Service, where the Service will automatically resolve and return the best option to launch and run.</p><p><strong>The Accounting &amp; Charging</strong> layer aggregates the billing from each Cloud provider and understands how to collect and distribute payment for each service used.</p><p>Although there is no technical limitation around building this Intercloud abstraction layer, this hasn&#8217;t been any meaningful motivation to drive the major Cloud providers to come up with an intercloud standard, given the strong drive to differentiate themselves.</p><h2>More Speculation about the Sky</h2><p>Now we understand what Sky computing is, which essentially is the ability for a developer to deploy an app or workload into the &#8220;Sky&#8221;, where it decides which cloud(s) to run this on and the services and configurations it should consume.</p><p>There are a few questions that are worth asking about:</p><ul><li><p><strong>Will the Sky exists in the next few years?</strong></p></li></ul><p>It&#8217;s very hard to believe that we will have a full abstraction layer like this available in the next few years, as there are so much coverage to cover and ongoing changes on each provider. For the Sky to exist, we need everyone to be able to agree and adopt a set of standards across many layers and services, which the major cloud providers at this point have no incentive to.</p><p>IMO the closest standard we have for the Sky today is <strong>Kubernetes, </strong>which most companies today when building a multi-cloud product or service builds on, as it&#8217;s the fastest-growing infrastructure piece that all cloud providers have their own distribution. In theory, a Kubernetes pod that runs on AWS could just run on Google without any changes. Though in reality, there are many leaky abstractions that prevent Applications to be truly portable, from different kinds of authentication, Cloud config plugins, storage configurations, and more. Therefore, there is still a significant amount of work on top of Kubernetes to allow complex applications to be ported from one cloud to another.</p><ul><li><p><strong>What are further implications once the Sky exists?</strong></p></li></ul><p>The paper mentioned that one future effect if the Sky computing layers exist, is that smaller providers and vendors will choose to embrace this commodity layer to compete as a whole with the larger &#8220;stand-alone&#8221; providers. These large providers will be priced higher and innovate across the board to retain an advantage, while the Sky computing providers will offer a lower margin but differentiated and focused offerings in the catalog of services. </p><h2><strong>Final thoughts</strong></h2><p>The interesting dynamics we see today is that most infra companies are offering multi-cloud solutions, but none of the solutions are truly embraced as the standard. </p><p>What will be the new standards in the infra stack that can continue to bring more consolidation? Docker and Kubernetes certainly brought the standard up the stack from VMs and machines, and Wasm has an opportunity to bring a new standard coming from the language and beyond.</p><p>There is an opportunity to continue to explore this new design space as we see more paradigms appear like Lakehouse that we covered, and see how this space continue to evolve.</p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Lakehouse: A New Generation of Open Platforms that Unify Data Warehousing and Advanced Analytics]]></title><description><![CDATA[Hi all!]]></description><link>https://blog.essence.dev/p/lakehouse-a-new-generation-of-open</link><guid isPermaLink="false">https://blog.essence.dev/p/lakehouse-a-new-generation-of-open</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Sun, 05 Dec 2021 08:39:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!eWXM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi all!</p><p>I&#8217;ve been wanting to continue to write about papers that I think is interesting and relevant to infrastructure in general, and I want to start off with this paper from Databricks that has been creating a new buzz / marketing around how data management of the future looks like. It&#8217;s even more fun given there is a war between Snowflake and Databricks <a href="https://databricks.com/blog/2021/11/02/databricks-sets-official-data-warehousing-performance-record.html">fighting</a> <a href="https://www.snowflake.com/blog/industry-benchmarks-and-competing-with-integrity/">back</a> and <a href="https://databricks.com/blog/2021/11/15/snowflake-claims-similar-price-performance-to-databricks-but-not-so-fast.html">forth</a> on who&#8217;s faster and cheaper, looking to reiterate the Lakehouse shift.</p><p>In this post I&#8217;ll walk through some major points about the <a href="https://cs.stanford.edu/~matei/papers/2021/cidr_lakehouse.pdf">paper</a> and talk about some my own observations about this space as well.</p><h2>The world of lakes + warehouses</h2><p></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eWXM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eWXM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 424w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 848w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 1272w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eWXM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png" width="1456" height="573" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:573,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:514265,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eWXM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 424w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 848w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 1272w, https://substackcdn.com/image/fetch/$s_!eWXM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7d2f841c-fb06-471e-8801-55bb737842ab_2414x950.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let&#8217;s talk about what&#8217;s being described in the paper as three generations of data warehouses.</p><p>The <strong>first generation</strong> is what we knew as the run your own data warehouse software era, which means enterprises buying appliances that coupled storage and compute and leads to hard to manage cost and inability to handle various data formats.</p><p>The <strong>second generation</strong> is the Hadoop era, which we all knew inspired by the Google Bigtable and led to the great Hortonworks vs Cloudera times, which essentially leads to what we all know as the &#8220;Data Lake&#8221;, that compute and storage is decoupled and data is mostly stored in HDFS (and now cloud storage), and ETL pipelines will be writing data from storage into specific BI solutions and warehouses to serve specific needs. This also leads to the spawn (and big debate) around <a href="https://en.wikipedia.org/wiki/Lambda_architecture">Lambda architecture</a>, and the rise of Kafka.</p><p>So, what&#8217;s wrong with the current generation then?</p><p>Here&#8217;s what&#8217;s the main problems the paper states about the current architecture:</p><p><strong>Reliability</strong> &#8594; The ETL layer that needs to run to keep the Data Lake in sync with the warehouse is introducing more potential quality issues and also engineering cost to maintain.</p><p><strong>Data Staleness</strong> &#8594; Another effect of requiring ETL is essential your data is out of sync of what&#8217;s the source of truth that&#8217;s stored in your Data lake.</p><p><strong>Limited Support for advanced analytics</strong> &#8594; With the rise of ML, data science teams increasingly want to run arbitrary frameworks on top of their data to answer more complex questions or power user facing features. However, data in data warehouse after being ETL is usually locked in a proprietary format and also data scientists don&#8217;t have direct access to the source, which requires another ETL from the warehouse into files that can be loaded into frameworks like Pytorch. </p><p><strong>Total cost of ownership &#8594; </strong>Besides paying for more engineering costs and ETL operation cost, the amount of storage requires given the duplication data also increases.</p><p>In summary, having to copy data with a ETL system creates operational burden with additional data staleness and cost challenges.</p><p></p><h2>Data lake + warehouse = Lakehouse</h2><p></p><p>So is there a way to avoid having a extra ETL to serve all the warehouse + ML + reporting need?</p><p>This is where the Lakehouse architecture comes in, which in the paper is defined as providing a data management system directly on top of low cost and directly-accessible storage, that combines the benefits of a Data lake and a Data Warehouse.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3hNf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3hNf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 424w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 848w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 1272w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3hNf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png" width="1262" height="998" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:998,&quot;width&quot;:1262,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:294411,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3hNf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 424w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 848w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 1272w, https://substackcdn.com/image/fetch/$s_!3hNf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4689be92-eaa0-4cb0-89e7-39f3189454d1_1262x998.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>The first problem to solve without having a &#8220;closed-world&#8221; data warehouse</strong>, is to have the ability to have various warehouse and ingestion systems able to write to Data Lake safely. To solve this problem, the first layer at the bottom of the stack is to introduce a shared Metadata layer that sits below all the writers, which provides additional metadata on next to the raw data stored in the Data Lake. This additional metadata file helps provide a consistent state that allows arbitrary and multiple data frameworks to concurrently write with strong transaction guarantees (aka ACID), also governance and auditing, etc. There are several implementations of this layer that designed a new metadata file format, such as Apache Iceberg (commercially Tabular) which was born out of Netflix, Delta Lake built by Databricks</p><p><strong>The second problem to solve is to solve the SQL performance problem</strong>. Data warehouse systems today like Redshift, Snowflake and others requires ETL to ingest data because it transforms the data into a internal format that optimizes for its own engine execution for faster and better performance, and also builds up internal indexes for faster random access and filtering. Now without an ETL layer, we essentially need to decouple this process and have a open standard format and index that also provides similar optimizations that is format independent and other query engines can understand and leverage.</p><p>Here&#8217;s the list of optimizations mentioned in the paper:</p><p><em><strong>Caching</strong></em><strong>:</strong></p><p>One optimization that data warehouses typically do serving queries from cloud object storage is to cache data in local SSD or memory. Creating a caching layer with data format that can be natively understood by open ecosystem warehouses can potential improve the performance of the processing nodes, and also potentially benefit multiple frameworks. The paper specifically listed Delta Engine&#8217;s example of how it can store its cached data with partially decompressed parquet data, so it can have a faster loading time without extra work. </p><p>There is an opportunity here to also see how a general in-memory format like Apache Arrow can become a universal caching data format for multiple query engines. Similar projects has exist in the past such as <a href="https://www2.eecs.berkeley.edu/Pubs/TechRpts/2018/EECS-2018-29.pdf">Alluxio</a> which focuses more on supporting heterogeneous storage systems but also provides a caching layer to speed up performance.</p><p><em><strong>Auxiliary Data</strong></em><strong>:</strong></p><p>Auxiliary data such as statistics (e.g: column1 has min value X and max value Y) stored in the open data formats like Parquet, or metadata files like Iceberg or Delta Lake Transaction log can be leveraged to help query optimizers know how to skip over data that isn&#8217;t necessary to load and process. </p><p>Additionally, indexes can be created that&#8217;s stored in object storage to facilitate more efficient data skipping such as <a href="https://docs.microsoft.com/en-us/azure/databricks/delta/optimizations/bloom-filters">Bloom filter</a> in Delta engine.</p><p><em><strong>Data layout</strong></em><strong>:</strong></p><p>Another optimization is to decide how to group rows that&#8217;s stored in object storage, since each parquet file can contain multiple rows. To improve performance, the query engine ideally wants to skip as much files without needing to read them from storage. Delta engine implemented using <a href="https://databricks.com/blog/2018/07/31/processing-petabytes-of-data-in-seconds-with-databricks-delta.html">z-order</a> on specific columns to help provide less value overlap and more evenly distribute the <a href="https://engineering.salesforce.com/boost-delta-lake-performance-with-data-skipping-and-z-order-75c7e6c59133">grouping</a>, so the query engine can more effectively skip files. More future work can be determining compression strategies based on data stored / accessed at runtime, etc.</p><p></p><p><strong>The last problem is to provide efficient access to other analytic frameworks like ML. </strong></p><p>Frameworks like scikit-learn or tensorflow doesn&#8217;t run SQL, yet can potentially access large amounts of data, especially using scalable data science frameworks like Dask. </p><p>The approach that the paper specifies is to expose a Dataframe API / SDK that translates Dataframe operations into Spark SQL executions so it leverages all the optimizations mentioned before like caching and data skipping. Some examples are <a href="https://github.com/databricks/koalas/blob/master/databricks/koalas/frame.py">Koalas</a> from Databricks or <a href="https://github.com/modin-project/modin/blob/master/modin/core/dataframe/pandas/dataframe/dataframe.py">Modin</a> or <a href="https://github.com/dask/dask">Dask</a> are all wrappers around existing Dataframe APIs but implements a different backend. </p><p>The biggest downsides of this approach is 1) ML users need to adopt the library 2) Only supports dataframes, which limits the support to projects like Pytorch or Tensorflow 3) Each implementation around the Dataframe API is engine and framework specific.</p><p>There is a lot more room to grow and explore in this side, as ML / AI isn&#8217;t all bottlenecked from data loading and execution, but more data transfer and general &#8220;AI tax&#8221; work. Also optimizations like pushing ML logic into SQL query optimization (aka factorized ML) are still continuing to eliminate redundant work on the ML side. </p><p></p><p><strong>Closing thoughts</strong></p><p>As mentioned in the paper, the Lakehouse architecture or direction will have different implementations and still many open questions and opportunities to continue to innovate. </p><p>It&#8217;s also an open question how would enterprise adopt a Lakehouse architecture which uses framework beyond one single vendor, as a lot of the trend today is moving towards a open data ecosystem, which starts from the file formats but also moving upwards into the compute stack and frameworks.</p><p>There are also open source projects like Apache Arrow that isn&#8217;t mentioned in the paper, that could also provide another level of standardization for cross tools optimization and access.</p><p>We&#8217;re also seeing standards being created from the <a href="https://data-apis.org/blog/announcing_the_consortium/">dataframe</a> level, <a href="https://substrait.io/">SQL execution</a> that further facilitates some newer cross stack optimizations opportunities.</p><p>It&#8217;s an interesting time in the data infrastructure space to watch how the ecosystem evolves.</p><p></p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Coming soon]]></title><description><![CDATA[This is Flash into the future, a newsletter about Latest research and projects around data infra and ML.]]></description><link>https://blog.essence.dev/p/coming-soon</link><guid isPermaLink="false">https://blog.essence.dev/p/coming-soon</guid><dc:creator><![CDATA[Timothy Chen]]></dc:creator><pubDate>Sat, 16 Oct 2021 05:58:16 GMT</pubDate><content:encoded><![CDATA[<p><strong>This is Flash into the future</strong>, a newsletter about Latest research and projects around data infra and ML.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.essence.dev/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.essence.dev/subscribe?"><span>Subscribe now</span></a></p>]]></content:encoded></item></channel></rss>