<?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[Stories by Raman Gupta on Medium]]></title>
        <description><![CDATA[Stories by Raman Gupta on Medium]]></description>
        <link>https://medium.com/@ramangupta?source=rss-1fdb0a9c922d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*u6yUcR2VpZNSwZVr.jpg</url>
            <title>Stories by Raman Gupta on Medium</title>
            <link>https://medium.com/@ramangupta?source=rss-1fdb0a9c922d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:38:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramangupta/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Home for Gitworkflow]]></title>
            <link>https://medium.com/@ramangupta/a-home-for-gitworkflow-db7379f13fc2?source=rss-1fdb0a9c922d------2</link>
            <guid isPermaLink="false">https://medium.com/p/db7379f13fc2</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[git-workflow]]></category>
            <category><![CDATA[gitflow]]></category>
            <dc:creator><![CDATA[Raman Gupta]]></dc:creator>
            <pubDate>Mon, 09 Apr 2018 12:01:01 GMT</pubDate>
            <atom:updated>2018-04-09T16:15:15.230Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*BCZkmZR1_YzDZy22Vn4uUw.png" /></figure><p>Some time ago, I wrote about <a href="https://hackernoon.com/how-the-creators-of-git-do-branches-e6fcc57270fb">gitworkflow</a>, the git branching model used by the maintainers of <a href="https://git.kernel.org/pub/scm/git/git.git/">git</a> itself.</p><p>This branching model <a href="https://github.com/rocketraman/gitworkflow#key-advantages">is powerful</a>, but too often development teams reach for less capable solutions like <a href="http://nvie.com/posts/a-successful-git-branching-model/">GitFlow</a> and <a href="http://endoflineblog.com/oneflow-a-git-branching-model-and-workflow">OneFlow</a>.</p><p>As one step towards raising awareness and making this system more accessible, I am creating a home for gitworkflow on GitHub: <a href="https://github.com/rocketraman/gitworkflow">https://github.com/rocketraman/gitworkflow</a>.</p><p>My intention with this repository is to have a central place in which to write and collect readable documentation for gitworkflow, such as <a href="https://github.com/rocketraman/gitworkflow/blob/master/docs/concepts-summary.adoc">concept summaries</a>, <a href="https://github.com/rocketraman/gitworkflow/blob/master/docs/useful-commands.adoc">useful commands</a>, and <a href="https://github.com/rocketraman/gitworkflow/blob/master/docs/task-oriented-primer.adoc">task-oriented primers</a>, keep a curated “Awesome List” of links to related articles and docs, and a place for developers to ask questions and collaborate on related tooling and techniques.</p><p>This is a work in progress, but let’s see where it goes!</p><p>Raman Gupta is the VP Engineering at <a href="http://www.redock.com/">reDock Inc.</a>, and loves using and teaching the wonders of Git. BTW, <a href="https://www.redock.com/">reDock</a> is <a href="https://www.redock.com/careers/">hiring</a>! Follow us on Twitter <a href="https://twitter.com/reDockAI">@reDockAI</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db7379f13fc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How the Creators of Git Do Branching]]></title>
            <link>https://medium.com/hackernoon/how-the-creators-of-git-do-branches-e6fcc57270fb?source=rss-1fdb0a9c922d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6fcc57270fb</guid>
            <category><![CDATA[gitflow]]></category>
            <category><![CDATA[git-workflow]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Raman Gupta]]></dc:creator>
            <pubDate>Thu, 11 May 2017 15:53:39 GMT</pubDate>
            <atom:updated>2018-04-08T23:42:23.929Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*BCZkmZR1_YzDZy22Vn4uUw.png" /></figure><p>There are a few common branching and process models for distributed development with Git on larger teams and projects.</p><p><a href="http://nvie.com/posts/a-successful-git-branching-model/">GitFlow</a>, created by Vincent Drieesen, is one such common branching model. GitFlow is relatively simple to understand, was excellently presented and <a href="http://nvie.com/posts/a-successful-git-branching-model/">illustrated</a> by Vincent, and seems to properly leverage Git’s excellent branching and merging capabilities. Adam Ruka wrote a popular polemic called <a href="http://endoflineblog.com/gitflow-considered-harmful">GitFlow considered harmful</a>, and presented his own oft-used model.</p><p>I submit for your consideration another approach for larger teams and complex projects with periodic releases: the <a href="https://git-scm.com/docs/gitworkflows#_managing_branches">dogfood workflow</a> used by the <a href="/service/mailto:git@vger.kernel.org">git.git</a> project — the open source project that develops and maintains git itself. This workflow is not new — I <a href="https://git.kernel.org/pub/scm/git/git.git/commit/?id=382e54312220ac02586a3cbb06b0e4eb7789f043">contributed</a> to the <em>gitworkflows(7)</em> man page above in 2009, and it was first created by Thomas Rast in 2008. But it hasn’t gained a lot of adoption outside of the git.git project itself. I think the main reasons are that it a) doesn’t have an easy-to-google and easy to remember name like “GitFlow”, b) creates a seriously crazy-looking history graph, and c) is a bit harder to grok, especially when one is coming from a background of tools that prefer mostly linear history like subversion. Lets tackle each in turn.</p><p>To give it a name, let’s call it “<strong>gitworkflow</strong>”, in deference to its creators and the man page in which it is described. <em>A quick disclaimer: I am not a regular git.git contributor — and this is not in any way endorsed by the git.git project (though a few nice people from the git.git mailing list did review a draft), and any mistakes, inaccuracies, or misunderstandings in this article are mine and mine alone.</em></p><p>On to the second point: in Adam’s post, he shows two screenshots, one showing a non-linear history with GitFlow as an example (the key point relating to the use of --no-ff merges to create empty merge commits):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*-aqUl3YSf8wi6uYD_qh0Tw.png" /><figcaption>A non-linear GitFlow history</figcaption></figure><p>And another showing a linear history of the same project that uses fast-forward merges as Adam recommends:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*6FAa9159jno4rpNzg7jC-w.png" /></figure><p>and asks:</p><blockquote>Which history would you rather be faced with when investigating this problem?</blockquote><p>The latter history graph is seductively easy to grok, but… under the covers a history with merge commits provides much value. It keeps related work together, while the linear history intersperses related work among several non-continuous commits, with the only way to identify the relationships being the issue id in the commit log. The linear history is <strong>easy to view</strong>, but <strong>hard to use</strong> — in Rich Hickey’s terms, it is “easy” but not “simple” because it <a href="https://www.infoq.com/presentations/Simple-Made-Easy">introduces accidental complexity</a>.</p><p>However, the fact that the first history graph Adam illustrated <strong><em>is</em></strong><em> </em><strong><em>actually hard to understand</em></strong> is true and needs to be addressed. Here, Git’s capabilities come to the rescue. Want to see all the merges done to a branch without the details of the individual commits? Use --first-parent (as pointed out by the most popular comment on Adam’s post). Here is git.git’s history of the <em>master</em> branch without that flag (yikes):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*rdXMoBT-Ta1Uo0LGPZ7-XA.png" /><figcaption>git.git log master</figcaption></figure><p>but with--first-parent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*s0APFMSaU1m62HJkpY3BKQ.png" /><figcaption>git.git log master with --first-parent</figcaption></figure><p>Nice! Now compare the second screenshot to Adam’s linear history, and ask his question again. With this approach, each individual topic worked on is listed consistently, the details of each are elided, and the history is presented linearly. But at the same time, the detailed history of each topic branch is still there behind the scenes. For example, let’s look at the history of merged branch jk/snprintf-cleanups, using an alias called <a href="https://gist.github.com/rocketraman/1fdc93feb30aa00f6f3a9d7d732102a9#file-gitconfig-L41">mergedtopiclg</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*-IqWq0UYuJgBywt7yIjobA.png" /></figure><p>And now we see all of the commits related to <strong>that specific merge</strong>, again linearly, and without unrelated commits interspersed.</p><p>Now, the last and most important, reason why gitworkflow isn’t widely adopted: it’s hard to wrap your mind around it, or at least it was for me. Adam states:</p><blockquote>GitFlow advocates having two eternal branches — master and develop. Why two, when one is the conventional standard?</blockquote><p>In contrast, Gitworkflows actually has <em>four</em> such “important” branches, though of course only one of the four is “eternal”: <em>maint</em>, <em>master</em>, <em>next</em>, and <em>pu. E</em>xactly <em>why</em> do I need all of these branches and what the f*k is <em>pu</em>? The “Managing Branches” section of the <a href="https://git-scm.com/docs/gitworkflows">gitworkflows(7)</a> man page, and these sections of <a href="https://github.com/git/git/blob/efc912b23335434674bcfda8199077f8dfa5d6f0/MaintNotes#L144">MaintNotes</a> and <a href="https://github.com/git/git/blob/v2.13.0/Documentation/howto/maintain-git.txt#L35">maintain-git.txt</a>, are all worth reading again. And again (they may make more sense <em>after</em> finishing this article).</p><p>Consider that, if we are maintaining releases of a project, we probably have different “versions” of it at varying levels of stability. A stable “release” (or “production”) version, a beta (or “testing”) version for ambitious users and testers which is somewhat stable, and an alpha (or “development”) version that contains all the latest goodies, but in which there is probably a bunch of broken stuff as well.</p><p>Not coincidentally, our gitworkflow branches <em>master</em>, <em>next</em>, and <em>pu</em> (proposed updates)<em> </em>correspond<strong> </strong>to these release/beta/alpha levels of stability respectively. The remaining branch <em>maint</em> is branched off of <em>master</em> at release points, and simply contains hot fixes to already released code.</p><p>Now that we understand the purpose of each “integration branch” in terms of stability, we combine this with the concept of “topic branches”. Topic branches themselves are non-controversial — both GitFlow and Adam recommend using them. Topic branches are where all the current work is being done — one branch per issue, bug, or feature, and there can be many topic branches undergoing development at once. In gitworkflow, however, topic branches are <strong>actually fundamental to the flow</strong> as opposed to just being a temporary place to develop code in isolation.</p><p>Topic branches always start from either <em>maint</em> or <em>master.</em> Branch from <em>maint</em> if the topic eventually needs merging to the current release represented by <em>maint</em>, or <em>master</em> if the topic is intended for a future release (not necessarily the next one). Note one caveat: if a new topic <em>topic-b</em> depends on code written on an earlier topic <em>topic-a</em>, then <em>topic-b</em> should still branch from <em>maint</em> or <em>master</em>, but <em>topic-a</em> should be merged into <em>topic-b</em>. This keeps <em>topic-b</em> logically separate from <em>topic-a</em>, but makes the dependency explicit.</p><p>Since topics branch from <em>maint</em> or <em>master</em>, they can also be merged into <em>next</em> and <em>pu</em> without any hassle at all — since both of those branches share a common ancestor with the topic in the form of a commit on <em>master</em> (or <em>maint</em>, which <em>master</em> always always includes). Most branch strategies wrongly assume that one can only merge into the same branch one forked from, but Git is smarter and more flexible than that.</p><p>Topic branches start out in an unstable state, and probably contain errors and unfinished work. However, this shouldn’t stop us from integrating our work with other work in progress to see what happens, both at merge time and at run time — this process is represented by our alpha-state code in the <em>pu</em>, or proposed updates, branch. Periodically <em>pu</em> is reset to the current <em>master</em>, and then all the topic branches are merged into it to identify merge issues, run tests, and to produce alpha-state build artifacts. Note the order of the merges does not really matter, but can be defined on a project or case-by-case basis. Performing the merges in a consistent order will best allow useful tools like <a href="https://git-scm.com/docs/git-rerere">git rerere</a> to work correctly, and can be semi-automated via scripts.</p><p>Merging to <em>pu</em> is extremely useful for initial feedback on development work from product owners, functional testers, and keen users. GitFlow does not offer any inherent way to do this — CI has become shorthand for running tests on individual topic branches automatically, but at its core, <strong>it’s the capability to merge and test <em>all</em> current work in progress that is true CI and that gitworkflow enables</strong>.</p><p>Finally, note another useful attribute of gitworkflow: <em>pu</em> is well understood to be a throw-away branch that may be rebased at any time, and therefore no commits should generally be based on it. Therefore, despite past merges to <em>pu</em>, topics can still be interactively rebased as much as is necessary to produce a great, easily reviewable, and understandable series of commits, without worrying about other people having to “<a href="https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase">recover from upstream rebase</a>” (an easy process but not one that should often be needed).</p><p>After a topic branch has undergone several cycles of refinement, code review, and testing, it may reach the point (in someone’s judgement) that it is good enough to be released to a beta (or user acceptance test) environment. At this point, in gitworkflow, the topic “graduates” to the <em>next</em> branch. Graduation simply consists of merging the topic to <em>next</em> with --no-ff.</p><p>Now that the topic has graduated to <em>next</em>, it can be part of a beta, or acceptance release. So every topic on <em>next </em>can now undergo a second round of stabilization, which is exactly the purpose of a beta release / acceptance testing environment. However, note that with gitworkflow, we still have not committed (no pun intended!) to having this topic as part of our next release to production — it still has not been merged to <em>master</em>. This is similar in concept to GitFlow’s <em>release</em> branch, but far more flexible and powerful, since <em>master</em> has no dependencies on <em>next</em> whatsoever, nor is <em>next</em> ever merged wholesale into <em>master</em> (unlike the corresponding GitFlow branches <em>develop</em> and <em>release</em>).</p><p>What if topic branches continue to evolve with new commits after merging and testing on <em>next?</em> The branch is simply merged to <em>next</em> again, as is necessary. Optionally, these further changes can also undergo an extra stabilization period by merging them to <em>pu</em> first. Since <em>next</em> is an integration branch with a finite lifetime, repeated merges of topics to it do complicate it’s history, but only until the next rebuild of <em>next</em> (which may happen at the next release, but gitworkflow is flexible here). Irrelevant and distracting history here, and on <em>pu</em>, is eventually dropped and forgotten.</p><p>And lastly, once a topic is judged stable enough to release, the topic graduates again and is merged to <em>master</em> (or perhaps <em>maint</em>), again with --no-ff to preserve the complete history of the topic branch.</p><p>A couple of topic branches merged to <em>next</em>, tested there as beta-releases, and then finally graduating to <em>master</em> for release could look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*rEsb9OTh3FlVWdDBe_ZGuA.png" /><figcaption>Source: <a href="http://jsfiddle.net/jtooun5q/5/">http://jsfiddle.net/jtooun5q/5/</a></figcaption></figure><p>Note that in gitworkflow, unstable and stable development work is <strong>never</strong> mixed together on the same branch. In contrast, with GitFlow I have two choices: 1) I can test my topic in isolation on its own branch, or 2) I can merge it to <em>develop</em> for testing. Neither choice is appealing. The former doesn’t offer a true test of a topic’s stability when deployed together with other ongoing work, and the latter commits the topic to <em>develop</em> perhaps before it is stable.</p><p>For the same reason, GitFlow has no process-assisted way to identify in advance which topics may cause conflicts with other work in progress, so that the developers in question can coordinate efforts before that big final merge of their topic to <em>develop</em>. In short, in GitFlow <strong>there is always an unsolvable tension between the desire to keep development work clean and isolated on a topic branch, and integrating topic branches with other work </strong>by merging them to <em>develop</em> to make them visible and testable and to check for conflicts. Gitworkflow allows both goals to be achieved without sacrificing one for the other.</p><p>There are additional capabilities and more to learn about gitworkflow than I have covered here. Perhaps some followup posts by myself or others can cover this ground. In addition, an open source toolset around gitworkflow to help with things like rebuilding <em>pu</em> and <em>next</em>, and tracking the graduation status of topics would be useful — git.git has its “cooking” tools for this purpose, but tooling that is less git.git specific would be nice. As a start, I have created a <a href="https://gist.github.com/rocketraman/1fdc93feb30aa00f6f3a9d7d732102a9">few useful aliases</a>[1]. <em>UPDATE Apr 8/2018</em>: I’ve also created a <a href="https://github.com/rocketraman/gitworkflows">repository</a> on GitHub with additional documentation, including a <a href="https://github.com/rocketraman/gitworkflows/blob/master/docs/task-oriented-primer.adoc">task-oriented primer</a>.</p><p>But in short, gitworkflow is an excellent Git branching model / workflow for many use cases, and deserves to be more popular than it is. It does require a strong understanding of advanced Git features and concepts, but the effort is well worth it.</p><p>[1] See especially the aliaseslgp, topics, topiclg, mergedtopiclg, branchnote, andwhere</p><p>Raman Gupta is the VP Engineering at <a href="http://www.redock.com/">reDock Inc.</a>, and loves teaching the wonders of Git. BTW, <a href="https://www.redock.com/">reDock</a> is hiring! Follow us on Twitter <a href="https://twitter.com/reDockAI">@reDockAI</a>.</p><figure><a href="http://bit.ly/HackernoonFB"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0hqOaABQ7XGPT-OYNgiUBg.png" /></a></figure><figure><a href="https://goo.gl/k7XYbx"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vgw1jkA6hgnvwzTsfMlnpg.png" /></a></figure><figure><a href="https://goo.gl/4ofytp"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKBpq1ruUi0FVK2UM_I4tQ.png" /></a></figure><blockquote><a href="http://bit.ly/Hackernoon">Hacker Noon</a> is how hackers start their afternoons. We’re a part of the <a href="http://bit.ly/atAMIatAMI">@AMI</a> family. We are now <a href="http://bit.ly/hackernoonsubmission">accepting submissions</a> and happy to <a href="/service/mailto:partners@amipublications.com">discuss advertising &amp; sponsorship</a> opportunities.</blockquote><blockquote>If you enjoyed this story, we recommend reading our <a href="http://bit.ly/hackernoonlatestt">latest tech stories</a> and <a href="https://hackernoon.com/trending">trending tech stories</a>. Until next time, don’t take the realities of the world for granted!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*35tCjoPcvq6LbB3I6Wegqw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6fcc57270fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/how-the-creators-of-git-do-branches-e6fcc57270fb">How the Creators of Git Do Branching</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A New Rich Text Editor for the Web With Real-Time Collaboration]]></title>
            <link>https://medium.com/@ramangupta/a-new-rich-text-editor-for-the-web-with-real-time-collaboration-710ffdf6ee2c?source=rss-1fdb0a9c922d------2</link>
            <guid isPermaLink="false">https://medium.com/p/710ffdf6ee2c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Raman Gupta]]></dc:creator>
            <pubDate>Thu, 20 Aug 2015 16:06:27 GMT</pubDate>
            <atom:updated>2015-08-20T18:03:28.877Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing the open source <a href="http://ritzyed.github.io/ritzy/">Ritzy Editor</a></h3><p>Once upon a time, I was building a web application. My web application needed an editor component that would allow my users to enter their content into the application. First, I wanted it to <em>operate as close to Microsoft Word and Google Docs</em>, in the sense of shortcuts, selection behavior, and so forth, as possible. Secondly, I wanted it to <em>support character-by-character real-time collaboration</em> just like Google Docs. In other words, every user should see the cursor of other active users, and see the text they are typing, deleting, or selecting in real-time. Ideally it would support offline editing as well.</p><p>The choices of web-based editors available are <a href="https://www.google.com/search?q=web+based+editors&amp;oq=web+based+editors">many</a>. The choices that handily meet the requirements above are few (or none?). I believe this is because most web editors use a browser capability called “<a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable">contentEditable</a>”. The browser essentially turns a regular DOM element containing text and other content into an “editable” control in which the content can be modified by the user. The browser then updates the HTML underlying that content based on the user’s actions.</p><p>One problem with this approach is that the underlying model for the editor content is HTML. While this seems to make sense for a web-based editor, HTML is not flexible enough in some ways (e.g. one can’t do tab stops in HTML), and is too flexible in other ways (e.g. bold and italic text could be represented as &lt;em&gt;&lt;strong&gt;bold italic&lt;/strong&gt;&lt;/em&gt; or &lt;strong&gt;&lt;em&gt;bold italic&lt;/em&gt;&lt;/strong&gt; or even with CSS styles and divs to take just three options). Different browsers don’t create the same HTML from the same user inputs, and behave differently when it comes to selections and cursor positioning. The people behind this site (Medium.com) wrote a great post about <a href="https://medium.com/medium-eng/why-contenteditable-is-terrible-122d8a40e480">Why ContentEditable is Terrible</a>.</p><p>In addition, most existing editors do not support real-time editing at all, or if they do, certainly not as well as Google Docs does. Fundamentally, HTML is a poor data model to build real-time synchronization on top of, and doubly so when considering the multiple possible representations for the exact same user actions. Even things like: “how do I position the cursor of a remote user?” are difficult for these types of editors because the browser doesn’t expose the ability to have multiple cursors, nor does it provide any hooks to determine where in the document to place a cursor or a remote selection manually — for example, just determining how the browser has wrapped text in a ContentEditable is a hard problem that only has hacks as solutions.</p><p>There are a few editors that implement their own data model underneath a ContentEditable solution, and these solve a significant part of the problem. But these editors still need to wrestle with the collaboration problem (update: also check out recently unveiled, but not yet open source, <a href="http://prosemirror.net/">ProseMirror</a> by the <a href="http://marijnhaverbeke.nl/">creator of CodeMirror</a>, which I believe uses ContentEditable for the input but has a separate data model).</p><p>What I really wanted was an editor component that worked as well as Google Docs but was embedded into my application, and was open source as well. Google Docs (and Microsoft’s competitive solution Office 365) allow one to create add-ons that embed into their products, but not vice-versa. So I never found an approach that I was happy with.</p><p>The project I was originally working on fell by the wayside. But my interest in the type of editor I was looking for remained. I decided that if it did not exist, I was going to build it: a real-time character-by-character collaborative editor that, in principle, <a href="http://googledrive.blogspot.ca/2010/05/whats-different-about-new-google-docs.html">worked just like Google Docs</a>, but was open source and useful for embedding into applications.</p><p>Today, I am releasing the <a href="https://www.npmjs.com/package/ritzy">first version</a> of this editor — called <a href="http://ritzyed.github.io/ritzy/">Ritzy </a>— under an open source license. <a href="http://demo-ritzy.rhcloud.com/">Here is a demo</a>. So far, it is pretty basic and no doubt has some <a href="https://github.com/ritzyed/ritzy/issues">bugs</a> that will only be discovered through more real-world usage and eyeballs on the source. It has a lot of big items left to implement, like undo/redo and support for additional complex items like images and tables. However, I believe that it proves the concept works well, and is a solid base upon which to build more capabilities and features.</p><h3>Raman Gupta on Twitter</h3><p>I open sourced a web-based rich text editor with character-by-character real-time collaboration like Google Docs http://ritzyed.github.io/ritzy/</p><p>It is based on the open source libraries <a href="https://facebook.github.io/react/">React</a> and <a href="http://swarmjs.github.io/">SwarmJS</a> and primarily intended for embedding into applications to support rich text entry with real-time collaboration. As far as I know, this is the first open source implementation of the Google Docs-like Javascript <a href="http://googledrive.blogspot.ca/2010/05/whats-different-about-new-google-docs.html">custom surface and layout</a> technique. Please see the project <a href="https://github.com/ritzyed/ritzy/blob/master/README.adoc">README</a> and <a href="https://github.com/ritzyed/ritzy">source code</a> for more details.</p><p>Depending on interest, my company <a href="http://vivosys.com/">VIVO Systems</a> is considering offering the editor as a software-as-a-service solution. Because it is intended for real-time collaboration, a server-side component is (currently) required. While a simple implementation is part of the open source project, a more complete commercial service could handle storage, communications, security, availability, and provide a simple but powerful API for developers. The API would allow interaction with client-side editors and the data they contain, including real-time server-side push updates as editor contents change. Please let me know if your company or startup may be interested in such a service.</p><p>Whether there is demand for commercial solutions or not, as my first major Javascript project and my first editor implementation, Ritzy was a blast to write. I learned a heck of a lot from the effort, encompassing everything from Javascript build tools like npm, Gulp and Webpack to language features like ES6 to libraries like React, SwarmJS, and Express. I hope that Ritzy can serve as a useful open source project for future developers, either as a <a href="https://www.npmjs.com/package/ritzy">component</a> of their own work, or as a base upon which to build their own solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=710ffdf6ee2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Docker Data Containers are Good]]></title>
            <link>https://medium.com/@ramangupta/why-docker-data-containers-are-good-589b3c6c749e?source=rss-1fdb0a9c922d------2</link>
            <guid isPermaLink="false">https://medium.com/p/589b3c6c749e</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Raman Gupta]]></dc:creator>
            <pubDate>Thu, 20 Nov 2014 18:38:42 GMT</pubDate>
            <atom:updated>2017-05-12T16:06:43.635Z</atom:updated>
            <content:encoded><![CDATA[<h2>Why Docker Data Containers (Volumes!) are Good</h2><p><em>UPDATE! As of Docker 1.9.0, Docker has named volumes which replace data-only containers. The article below still has value in the sense of how to think about data inside docker, but consider using named volumes to implement the pattern described below rather than data containers.</em></p><p>You use the hot new containerization technology called <a href="https://www.docker.com/">Docker</a>. You have persistent data that you need to keep across invocations of a container. Google this and you will find a consistent piece of advice: for portability, <a href="http://stackoverflow.com/a/20652410/430128">use volumes mounted from data-only containers</a>.</p><p>When I first saw this, I didn’t understand it. In order to persist that data, I need to have it on my host machine (right?). So why create another data-only container, only to have the same mapping to the host data? Wasn’t it simply a level of abstraction that pushed the problem back one level, but didn’t really accomplish much? I wasn’t the <a href="https://groups.google.com/d/msg/docker-user/EUndR1W5EBo/JxcsbqIqfQQJ">only</a> <a href="http://stackoverflow.com/questions/23544282/what-is-the-best-way-to-manage-permissions-for-docker-shared-volumes">one</a>.</p><h3>The Aha! Moment</h3><p>After futzing with Docker for a while, and reading the <a href="http://docs.docker.com/userguide/dockervolumes/">documentation for data-only containers</a> multiple times, I finally realized I had to shift my mindset from “this data must logically and physically exist on my host” to “this data logically exists within a data-only container and I (probably) don’t care where it physically exists on my host”.</p><p>Even though containers do not persist data across invocations, <em>volumes </em>declared by containers <em>do</em>. Even when <em>not explicitly mapped to any host directory.</em> And since docker volumes, and the data they contain, <em>survive as long as any container references them</em>, even indirectly, as long as the data container exists (even if not running), the data is logically and effectively “stored” within docker.</p><p>To see this without getting too far into the data-container abstraction, lets run a container with a bound docker volume (without <em>—rm</em> to keep the container around after execution), and write some data to the mount:</p><pre># Note that we do not bind the volume from the host<br>$ docker run -v /foo --name=&quot;vtest&quot; busybox \<br>  sh -c &#39;echo hello docker volume &gt; /foo/testing.txt&#39;</pre><p>We’ve created a data container by binding a volume from docker, and written something to the volume using the same container for simplicity.</p><p>Now run it again and confirm the data exists, this time binding the volume from the previously run data container:</p><pre>$ docker run --volumes-from=vtest busybox cat /foo/testing.txt<br>hello docker volume</pre><p>The key take-away being that we persisted some data using docker <em>without ever binding it to the host</em>, and as long as <em>vtest</em> exists, the data exists.</p><p>As an aside, the physical location of the data is of course on the host — somewhere in <em>/var/lib/docker/ — </em>but this almost never matters. One exception to this is if the data must be mounted on specific hardware for ops purposes. This can be handled simply by a host bind of the volume on the data container, but logically everything remains exactly the same.</p><h3>So What</h3><p>OK, the data logically exists within a container and is not (explicitly) mounted to any host location. Fine, but then how do I view the data? How do I edit it? Back it up? And so on? Now you need to think containers containers containers. Whenever you think “I need to mount this volume on my host to do <em>x</em>”, change that in your head to “I need to create a container that uses — <em>volumes-from </em>the data-only container to do <em>x </em>within”.</p><p>When everything one needs to do with the data on the volume lives within one or more containers, one neatly side-steps problems that arise when one tries to access the data via the host. For example, <a href="https://github.com/docker/docker/issues/7198">the issue</a> of <a href="http://stackoverflow.com/questions/23544282/what-is-the-best-way-to-manage-permissions-for-docker-shared-volumes">matching a host uid/gid to a container uid/gid</a>, which of course makes the container non-portable to a host where that user/group does not exist or has a different<em> </em>uid/gid, <a href="http://stackoverflow.com/questions/23544282/what-is-the-best-way-to-manage-permissions-for-docker-shared-volumes/27021154#27021154">is solved</a> relatively simply.</p><p>It also means you can do neat things like creating tools containers with useful utilities and scripts that operate on your data, all of which access the volume via the data-only container, and all of which, as a result, are completely portable from host to host.</p><h3>Conclusion</h3><p>Data-only containers, far from being useless as I originally thought, are a key component to building a completely portable container-based ecosystem.</p><p>Raman Gupta is the Director of Development at <a href="http://www.redock.com/">reDock Inc.</a> We love using containers. BTW, <a href="https://www.redock.com/">reDock</a> is hiring! Follow us on Twitter <a href="https://twitter.com/reDockAI">@reDockAI</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=589b3c6c749e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>