<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[lakeFS - Medium]]></title>
        <description><![CDATA[LakeFS is an open-source data lake tool deliversingresilience and manageability to object-storage based data lakes. Check out our Github: https://github.com/treeverse/lakeFS - Medium]]></description>
        <link>https://medium.com/lakefs?source=rss----29af6db94071---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>lakeFS - Medium</title>
            <link>https://medium.com/lakefs?source=rss----29af6db94071---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:57:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/lakefs" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Boost Your Data Engineering Toolkit In 2023 With Data Version Control]]></title>
            <link>https://medium.com/lakefs/boost-your-data-engineering-toolkit-in-2023-with-data-version-control-407935ed2a8b?source=rss----29af6db94071---4</link>
            <guid isPermaLink="false">https://medium.com/p/407935ed2a8b</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-management]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-engineering]]></category>
            <dc:creator><![CDATA[Hiccups]]></dc:creator>
            <pubDate>Tue, 07 Mar 2023 15:45:05 GMT</pubDate>
            <atom:updated>2023-03-07T15:53:10.386Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aw49pQ4MVQ6doJXpra1lvA.png" /></figure><p>Can you imagine what building new software was like before distributed version control systems like Git became the industry standard? 😱It’s a miracle that teams managed to ship things and roll out updates.</p><p>Now get this: this is exactly where the data world is currently at. 🤯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*OkWJVoaxF0MQ4izN" /></figure><p>As companies started generating more data than ever, engineers moved from relational databases and embraced object storage. This brought new manageability challenges every data engineer knows firsthand.</p><p>💡But here’s some good news: more and more teams are busy developing data versioning solutions to increase velocity and slash the cost of errors.</p><p>I rounded up the data version control tools making their mark on the industry right now to help you pick the best one for your project.</p><p><strong>TL;DR</strong></p><p>Overview of data version control tools Dolt, DVC, Git LFS, lakeFS + their key advantages and drawbacks.</p><p><em>Table of contents:</em></p><p><a href="#ed15">What is data version control?</a></p><p><a href="#41ef">The central pain point data versioning solves</a></p><p><a href="#2a56">4 data version control systems you should know</a>:</p><ol><li><a href="#fa41">Dolt</a></li><li><a href="#d280">Git LFS</a></li><li><a href="#aafa">DVC</a></li><li><a href="#de6b">lakeFS</a></li></ol><p><a href="#1b4e">Wrap up</a></p><h3>What is data version control?</h3><p>Here’s a no-brainer for anyone who has ever developed software in a team:</p><p>When you’re working on a project, it is important to keep track of all the changes your teammates make.</p><p>Scratch that, you actually need to track all the changes you make!</p><p>Git lets you commit changes, create different branches from a source, and merge back the branches to the original.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*rl63IeAUSSRo9YOC" /></figure><p>Source: lakeFS</p><p><strong>Data version control</strong> uses the same idea and applies it to datasets, not source code.</p><p>Live data systems ingest new data all the time. At the same time, various users keep experimenting with the same datasets.</p><p>This can easily become a nightmare filled with multiple versions of the same dataset. You can’t exactly call this a single source of truth, right?</p><p>In machine learning environments, you might end up with a tangled web of datasets and experiments if the models are not properly audited and versioned.</p><p><strong>This is where data versioning comes in to save the day!</strong></p><p>By implementing data version control, you can track datasets and register changes on a particular dataset.</p><p>That way, you can easily check how the project developed over time — seeing everything that was added, modified, and removed.</p><p>Plus, you can always switch to an older version if you face an unexpected issue in the current version. Or if you accidentally delete data. You’ll quickly pinpoint the culprit because you’ll have a detailed document in front of you describing the differences between versions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/0*khzp8AE1q6JjzMY2" /></figure><h3>The central pain point data versioning solves</h3><p>If you’re an administrator or user of databases, data warehouses, and data lakes, you may run into a common problem: the data you have represents only the current state of the world.</p><p><strong>Since the world is always changing, this data changes as well. </strong>If you want to get back or look into an older data status, you can dive into a log file and restore it — but this method isn’t exactly handy for data analytics purposes.</p><p>This is the problem that data versioning solves. Advanced data versioning helps users to set up a secure system for storing data. For example, in machine learning, data scientists might test their models to increase efficiency and make changes to their datasets. With this type of versioning, you can quickly capture the different versions of their data and models in commits, switching between these different datasets as needed.</p><p>You can keep your machine learning models and data consistent by <strong>creating a single history for them</strong>. This helps your team use logical file names and allows you to store your data in different storage solutions. Data versioning also paves the way to meeting data compliance requirements by letting you audit changes to your data.</p><h3>4 data version control systems you should know</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*_J-RZKZre7INhjiM" /></figure><h3>1. Dolt</h3><p><strong>What is it?</strong></p><p>Dolt is an open-source project which integrates a versioned database created on top of the Noms storage engine. This is how Dolt enables Git-like operations for data.</p><p><strong>How does it work?</strong></p><p>Dolt works with a data structure called a Prolly tree. A Prolly tree is a block-oriented search tree, which combines the properties of a B-tree and Merkle tree. This delivers results because it uses B-tree to hold indices in relational databases, letting you balance its structure and offering good performance for reading or writing from a database.</p><p><strong>When to use it?</strong></p><p>Pick Dolt if you’re using a relational database and want to continue doing so while enjoying version control capabilities.</p><p><strong>Any limitations?</strong></p><p>Dolt won’t work for you if the data you have isn’t in a relational database- or if you’d simply prefer to keep it somewhere else. Managing data on the petabyte scale would be tricky. And if you care about speed, Dolt’s structure is less efficient. Another bad use case for this solution is a scenario where you rely heavily on unstructured data. Then it’s time to look for another solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wg93Qv5NB8r4rVX4" /></figure><p>Source: lakeFS</p><h3>2. Git LFS</h3><p><strong>What is it?</strong></p><p>Git itself can’t scale for data, but you can use an add-on called Git LFS to manage data and code at the same time.</p><p><strong>How does it work?</strong></p><p>Git LFS relies on metadata management. The idea behind Git LFS derives from game development. Game developers usually deal with code but also tons of artifacts. Most of the time, these are binaries affecting the games’ look. Game devs used to manage such assets together with code, which made their repositories heavy and complex. So, they developed an add-on to Git that lets you avoid this.</p><p><strong>When to use it?</strong></p><p>This use case expanded to engineers doing machine learning and research — they need to deal with files that aren’t code and are heavier than what you’d typically expect. This includes files that manage code. It’s best to keep them together due to the connection between the model and the data on which it’s running.</p><p><strong>Any limitations?</strong></p><p>Git LFS smoothly integrates with Git repositories. But using it means that both your code and files are going to live there. You’ll have to lift and shift data to coexist with your code that way, which is time-consuming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UztzDcGbw_aFrOYu" /></figure><p>Source: lakeFS</p><h3>3. DVC</h3><p><strong>What is it?</strong></p><p>DVC is an open-source version control system for data science and machine learning projects. The solution was designed to work with version-controlled systems like Git.</p><p><strong>How does it work?</strong></p><p>When you’re adding data to a project using DVC commands, the solution uploads the data to a remote storage service and creates metadata pointing to that location. This metadata file is then added to a Git repository to enable version control. When you add, remove, or modify data files, the metadata file will be updated and new data uploaded. This lets you keep track of data and easily share it with collaborators without actually storing it all in a repository thanks to metadata files.</p><p><strong>When to use it?</strong></p><p>DVC is a suitable solution if you’re looking to track and save data and ML models the same way you save code, switch between different versions smoothly, and understand how datasets and ML artifacts were developed.</p><p><strong>Any limitations?</strong></p><p>DVC lakes some important features of a relational database. If you use one, it’s probably not the best choice for you. Also, caching is no longer unrealistic when you’re operating on the petabyte scale and using hundreds of millions of objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*70U2NfgTAnQ5JExl" /></figure><p>Source: lakeFS</p><h3>4. lakeFS</h3><p><strong>What is it?</strong></p><p>lakeFS is an open-source version control solution that sits on top of the data lake and is based on Git-like semantics. It lets you create isolated data versions, share them with your team, and quickly merge changes into your main.</p><p><strong>How does it work?</strong></p><p>lakeFS supports data in AWS S3, Azure Blob Storage, Google Cloud Storage, and any other object storage that has an S3 interface. It integrates well with popular data frameworks such as Spark, Hive Metastore, dbt, Trino, Presto, and others. lakeFS basically brings together all data sources in data pipelines — from analytics databases to key-value stores — using a unified API that lets you manage the underlying data in all the data stores.</p><p><strong>When to use it?</strong></p><p>If you’re looking for an ETL testing solution, lakeFS is a brilliant match. Other use cases include rolling back to a previous data version in case of an error, keeping track of the exact state of data over time, and implementing CI/CD pipelines via hooks that enable automation of checks and validations of data on lakeFS branches.</p><p><strong>Any limitations?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tqeMNlEJ3KmvPilY" /></figure><p>Source: lakeFS</p><h3>Wrap up</h3><p>Using the right version control tools, you can transform a chaotic environment into one that you can manage. You gain full control of your data — you know where it comes from, what has changed, and why.</p><p>You become that person in the room who can stop the manager before they make a decision based on inaccurate data.</p><h3>💡Curious to learn more?</h3><p>Here’s a <a href="https://lakefs.io/blog/dvc-vs-git-vs-dolt-vs-lakefs/">detailed comparison of DVC, Git LFS, and lakeFS</a>.</p><p>Check out <a href="https://hubs.ly/Q01ttC-f0">lakeFS docs</a> for more guides and detailed information on how to get started.</p><p>And don’t forget to join the awesome <a href="https://join.slack.com/t/lakefs/shared_invite/zt-1kokn8lv9-xL1Gp~V6JLx7bEhTpobzvg">lakeFS data practitioners’ Slack community</a> to meet like-minded people, ask questions, and share your wicked smart insights!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=407935ed2a8b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lakefs/boost-your-data-engineering-toolkit-in-2023-with-data-version-control-407935ed2a8b">Boost Your Data Engineering Toolkit In 2023 With Data Version Control</a> was originally published in <a href="https://medium.com/lakefs">lakeFS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Missing Piece in Your Software Cycle — An Isolated Testing Data Environment for Spark]]></title>
            <link>https://medium.com/lakefs/the-missing-piece-in-your-software-cycle-an-isolated-testing-data-environment-for-spark-1732b58294fb?source=rss----29af6db94071---4</link>
            <guid isPermaLink="false">https://medium.com/p/1732b58294fb</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[lakefs]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Adi Polak]]></dc:creator>
            <pubDate>Fri, 02 Dec 2022 17:22:56 GMT</pubDate>
            <atom:updated>2022-12-02T17:22:56.006Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Missing Piece in Your Software Cycle — An Isolated Testing Data Environment for Spark</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YQA_OSHQprdvFTcg" /><figcaption>Photo by <a href="https://unsplash.com/@ashkfor121?utm_source=medium&amp;utm_medium=referral">Ashkan Forouzani</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A typical routine of a data engineer includes writing code, choosing and upgrading the compute infrastructure, and testing both the new and changed data pipelines. Most of the time, engineers looking to test the changes they wish to apply need to run their tested pipelines in parallel to production.</p><p>Every data engineer knows that this complex process involves many moving parts and manual tasks, such as copying data, updating configuration, and creating alternative paths.</p><p><strong>You can only imagine how time-consuming and error-prone such a workflow is. If something goes south, it might damage production or pollute the data lake.</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fgiphy.com%2Fembed%2FmrnkgZ3iNZGRLWSg6p%2Fvideo&amp;display_name=GIPHY&amp;url=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fgiphy.com%2Fclips%2Fcartoonnetwork-cartoon-network-pan-we-baby-bears-mrnkgZ3iNZGRLWSg6p&amp;image=https%3A%2F%2Fblue-sea-697d.quartiers047.workers.dev%3A443%2Fhttps%2Fmedia3.giphy.com%2Fmedia%2FmrnkgZ3iNZGRLWSg6p%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="480" height="270" frameborder="0" scrolling="no"><a href="https://medium.com/media/78e6c94fbeb6707bc92f226ca6f2b3db/href">https://medium.com/media/78e6c94fbeb6707bc92f226ca6f2b3db/href</a></iframe><blockquote><strong><em>You don’t have to worry; I’ve got you covered!</em></strong></blockquote><p>Luckily, as a data practitioner, you can take advantage of solutions that simplify this workflow. <a href="https://hubs.ly/Q01ttC-f0">lakeFS</a> lets you create a safe and automated development environment for data without having to copy or mock data. You can easily work on production pipelines without any significant engagement of DevOps resources.</p><h3><strong>What will you learn?</strong></h3><p>This tutorial demonstrates how to build a development and testing environment for validating your logic on a full-blown production data volume and variety, working with lakeFS and <a href="https://spark.apache.org/">Spark</a>. You will walk through the journey of creating a repository and building a Spark application while using lakeFS capabilities. You will learn how to data changes, revert them in cases of mistakes or other hiccups, and lately merge separate branches to reflect data changes from the isolated environments.</p><blockquote><strong><em>Ready to jump in? Just lakeFS it!</em></strong></blockquote><p><strong>Table of contents:</strong></p><ul><li>Multiple environments: What is their purpose?</li><li>Why not build an isolated testing environment for data?</li><li>Building a testing environment for data with Spark and lakeFS</li><li>Step 1: Creating a repository</li><li>Step 2: Upload and commit data</li><li>Step 3: Develop a Spark application on the isolated branch</li><li>Step 4: Rolling back or committing changes</li><li>Step 5: Merge and iterate in the development workflow</li></ul><h3>Multiple environments: What is their purpose?</h3><p>If you run ETL jobs directly in production, expect data issues to start flowing into dashboards, ML models, and other data consumers sooner or later.</p><p>When working with a data lake, it’s a good idea to have replicas of your production environment. They let you test and understand changes to your data without impacting the consumers of production data.</p><p>The most common approach that allows engineers to avoid making changes directly in production is creating and maintaining a second data environment (dev/test environment) where you first implement updates.</p><p><strong>One problem with this approach is that maintaining a separate environment is both time- and resource-consuming. For larger teams, doing that might force multiple people to share a single environment, which requires significant coordination among team members. This takes a lot of time as well.</strong></p><p>But there’s a way out.</p><h3>Why not build an isolated data testing environment?</h3><p>You can create an isolated testing environment using lakeFS. That way, you don’t have to spend another minute on maintaining multiple environments. On top of that, you can create as many environments as you need instantly — without copying one KB of data.</p><p>How does all that work? Let’s take a quick look at the lakeFS repository structure:</p><p>In a lakeFS repository, you will always find data located on a branch.</p><ul><li>Each branch works like a separate environment.</li><li>Branches are fully isolated, meaning that data changes on one branch do not affect other branches.</li><li>Objects that don’t change between two branches are never copied but shared by these branches via metadata pointers (shallow copy), which lakeFS manages.</li><li>If you apply a change on one branch and want it to be reflected on another, you can carry out a merge operation to update one branch with changes from another.</li></ul><p>When using lakeFS, you can create an isolated data environment a moment before testing a change. Once new data is merged into production, you need to delete the branch to remove the environment you don’t need anymore.</p><p>This approach differs from building a long-living test environment engineers use as a staging area to test all the data updates. With lakeFS, you can create a new branch for every single change to production that we want to make. And you can test multiple changes at one time.</p><p>Now that we covered the theory let’s see what building a test environment with lakeFS looks like in practice.</p><h3>Building a testing environment for data with Spark and lakeFS</h3><p>To get started, we need to create a repository and build a small Spark application.</p><p>Prerequisites</p><ul><li><strong>Installation of lakeFS Server</strong> — you can spin up a server via the playground or<a href="https://hubs.ly/Q01tQCNp0"> run one locally</a>.</li><li><a href="https://hubs.ly/Q01tQCz30"><strong>lakectl</strong></a> — The official <a href="https://hubs.ly/Q01tQCz30">lakeFS CLI</a>; download it — <a href="https://github.com/treeverse/lakeFS/releases">here</a>.</li></ul><p>Tip: <a href="https://www.youtube.com/watch?v=CIDrHVFnIJY">Click here</a> to see how to run lakeFS locally against your storage in less than 3 minutes.</p><h3>Step 1: Creating a repository</h3><p>Our first step is to create a new repository called `example-repo` that will hold our data. In the code below, we’re using an S3 bucket `example-bucket` as the underlying storage.</p><pre>$ lakectl repo create lakefs://example-repo s3://example-bucket/example-repo -d main<br>Repository: lakefs://example-repo<br>Repository &#39;example-repo&#39; created:<br>storage namespace: s3://example-bucket/example-repo<br>default branch: main<br>timestamp: 1660458426</pre><h3>Step 2: Upload and commit data</h3><p>We can download our data and upload it directly into our newly-created repository using the following command.</p><pre># Download data file - credit to Gutenberg EBook of Alice&#39;s Adventures in Wonderland<br># Or you can use any text file you like<br>$ curl -o alice.txt https://www.gutenberg.org/files/11/11-0.txt<br># Upload to our repository<br>$ lakectl fs upload -s alice.txt lakefs://example-repo/main/alice.txt<br>Path: alice.txt<br>Modified Time: 2022–08–14 09:35:16 +0300 IDT<br>Size: 174313 bytes<br>Human Size: 174.3 kB<br>Physical Address: s3://barak-bucket1/example-repo/ec827db52c044d3881cdf426b99819f3<br>Checksum: 7e56f48cb7671ceba58e48bf232a379c<br>Content-Type: application/octet-stream</pre><p>This is the starting point of our development project. We must commit the data to a point in time from which we can always roll back, reference, or branch.</p><pre>$ lakectl commit -m &quot;alice in wonderland&quot; lakefs://example-repo/main<br>Branch: lakefs://example-repo/main<br>Commit for branch &quot;main&quot; completed.<br>ID: bf099c651bf8ee914fca2b42824f05d2f48ac17bde80f4b34a5d9fb61839a620<br>Message: alice in wonderland<br>Timestamp: 2022–08–14 09:36:08 +0300 IDT<br>Parents: fdcd03133c44f982b2f294494253d479a3409abd08d0d6e2686ea8764f0677dc</pre><p>At this point, we recommend updating the development environment’s main branch regularly. This is how we can keep the development environment on par with production.</p><p>Since all the branches are isolated, we can choose to update your branch — and newly-updated branches will be created from the updated main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NX74LVt1e467GQPD" /></figure><h3>Step 3: Develop a Spark application on the isolated branch</h3><p>We need to start with a new branch to capture the state of our repository while working on our Spark application.</p><pre>$ lakectl branch create lakefs://example-repo/word-count1 -s lakefs://example-repo/main<br>Source ref: lakefs://example-repo/main<br>created branch &#39;word-count1&#39; bf099c651bf8ee914fca2b42824f05d2f48ac17bde80f4b34a5d9fb61839a620</pre><p>By creating a branch, you get an isolated environment that contains a snapshot of your repository. Note that this operation is lightweight — it doesn’t copy any data and still gives us an isolated space guaranteed not to change.</p><p>At this point, we can use the lakectl command to list the content of our development branch and see that it contains the same data as our main branch:</p><pre>$ lakectl fs ls lakefs://example-repo/word-count1/<br>object 2022–08–14 09:35:16 +0300 IDT 174.3 kB alice.txt<br>$ llakectl fs ls lakefs://example-repo/main/<br>object 2022–08–14 09:35:16 +0300 IDT 174.3 kB alice.txt</pre><p>Now it’s time to run a simple word count using Spark to generate a report based on our story. The first step is to set up the <a href="https://docs.lakefs.io/integrations/spark.html#two-tiered-spark-support">lakeFS Spark integration</a>:</p><pre>sc.hadoopConfiguration.set(&quot;fs.s3a.access.key&quot;,&lt;lakeFS access key ID&gt;)<br>sc.hadoopConfiguration.set(&quot;fs.s3a.secret.key&quot;,&lt;lakeFS secret access key&gt;)<br>sc.hadoopConfiguration.set(&quot;fs.s3a.path.style.access&quot;, &quot;true&quot;)<br>sc.hadoopConfiguration.set(&quot;fs.s3a.impl&quot;, &quot;org.apache.hadoop.fs.s3a.S3AFileSystem&quot;)<br>sc.hadoopConfiguration.set(&quot;fs.s3a.endpoint&quot;, &quot;http://s3.local.lakefs.io:8000&quot;)<br>val branch = &quot;s3a://example-repo/word-count1/&quot;<br>val textFile = sc.textFile(branch + &quot;alice.txt&quot;)<br>val counts = textFile.flatMap(line =&gt; line.split(&quot; &quot;)).map(word =&gt; (word, 1)).reduceByKey(_ + _)<br>counts.saveAsTextFile(branch + &quot;wc.report&quot;)</pre><p>Access to our repository is enabled via the S3 interface — all we need to do is set the s3a endpoint and credentials based on our lakeFS installation.</p><p>Running the command above will generate a word count report. To see it, we can use lakectl diff:</p><pre>$ lakectl diff lakefs://example-repo/word-count1<br>Ref: lakefs://example-repo/word-count1<br>+ added wc.report/_SUCCESS<br>+ added wc.report/part-00000<br>+ added wc.report/part-00001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vME8WcDx1CRDrKNL" /></figure><p>If there’s any problem with the generated data, we can always discard all the uncommitted changes with a single command that resets the branch:</p><pre>$ lakectl branch reset lakefs://example-repo/word-count1 - yes<br>Branch: lakefs://example-repo/word-count1</pre><h3>Step 4: Rolling back or committing changes</h3><p>Once testing is completed, we’re ready to commit our changes. We can include additional metadata fields in our lakeFS commit — for example, by specifying its git commit hash, we can reference the code used to build the data.</p><pre>$ lakectl commit lakefs://example-repo/word-count1 -m &quot;word count&quot; - meta git_commit_hash=cc313c5<br>Branch: lakefs://example-repo/word-count1<br>Commit for branch &quot;word-count1&quot; completed.<br>ID: 068ddaf6b4919e5bf97a14d254ba5da64fa16e7fef438b1d65656cc9727b33df<br>Message: word count<br>Timestamp: 2022–08–14 11:36:16 +0300 IDT<br>Parents: bf099c651bf8ee914fca2b42824f05d2f48ac17bde80f4b34a5</pre><p>By using the `meta` flag, we can easily store multiple metadata key/value pairs to label our commit. Later on, we can take a look at the log and use the referenced data.</p><pre>d9fb61839a620<br>$ lakectl log lakefs://example-repo/word-count1<br>ID: 068ddaf6b4919e5bf97a14d254ba5da64fa16e7fef438b1d65656cc9727b33df<br>Author: barak<br>Date: 2022–08–14 11:36:16 +0300 IDT<br>word count<br>git_commit_hash = cc313c5<br>ID: bf099c651bf8ee914fca2b42824f05d2f48ac17bde80f4b34a5d9fb61839a620<br>Author: barak<br>Date: 2022–08–14 09:36:08 +0300 IDT<br>alice in wonderland<br>ID: fdcd03133c44f982b2f294494253d479a3409abd08d0d6e2686ea8764f0677dc<br>Date: 2022–08–14 09:27:06 +0300 IDT<br>Repository created</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cTg93zoxOSt2PUgB" /></figure><p>The commit ID — for instance, 068ddaf6b4919e5b — can be used by our CLI to address the repository.</p><pre>$ lakectl fs cat lakefs://example-repo/068ddaf6b4919e5b/wc.report/part-00000<br>(&quot;Found,2)<br>(someone,1)<br>(plan.&quot;,1)<br>(bone,1)<br>(roses.,1)<br>…<br>Or by our application as s3a address:<br>s3a://example-repo/068ddaf6b4919e5b/wc.report</pre><h3>Step 5: Merge and iterate in the development workflow</h3><p>Once both the code and data are committed, we can review them together before deciding to merge our new data into the main branch.</p><pre>$ lakectl merge lakefs://example-repo/word-count1 lakefs://example-repo/main<br>Source: lakefs://example-repo/word-count1<br>Destination: lakefs://example-repo/main<br>Merged &quot;word-count1&quot; into &quot;main&quot; to get &quot;50d593e52cba687f2af7894189b381ebafdf7495f9e65a70ba2fc67e4e8c0677&quot;.</pre><p>The merge operation will generate a commit in the target branch with all the changes we have applied.</p><p>Committing is a quick and atomic metadata operation. lakeFS doesn’t copy any data during the process. Moreover, the data is stored only once. If we decide to merge changes to multiple objects, we are guaranteed that they all show up in our destination branch at the same time.</p><p>Optionally, we can delete the feature branch once we no longer need it using this command:</p><pre>$ lakectl branch delete lakefs://example-repo/word-count1 - yes<br>Branch: lakefs://example-repo/word-count1</pre><h3>Let’s sum it up!</h3><p>Building an isolated development and testing environment for a data lake can be easy. I showed you how to do it with lakeFS and hope you feel empowered to take this open-source solution for a spin.</p><p>Note that all the content above is just suggestions — what matters is the concept and methodology.</p><h3>💡 Curious to learn more?</h3><p>Check out <a href="https://hubs.ly/Q01ttC-f0">lakeFS docs</a> for more guides and detailed information on how to get started.</p><p>Join the awesome<a href="https://join.slack.com/t/lakefs/shared_invite/zt-1kokn8lv9-xL1Gp~V6JLx7bEhTpobzvg"><em> lakeFS data practitioners’ Slack community</em></a> to meet like-minded people, ask questions, and share your wicked smart insights!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1732b58294fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lakefs/the-missing-piece-in-your-software-cycle-an-isolated-testing-data-environment-for-spark-1732b58294fb">The Missing Piece in Your Software Cycle — An Isolated Testing Data Environment for Spark</a> was originally published in <a href="https://medium.com/lakefs">lakeFS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>