<?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[mythoughts.io - Medium]]></title>
        <description><![CDATA[Personal Blog Mostly on Technology &amp; Start-up, By Guillaume Montard - Medium]]></description>
        <link>https://medium.com/mythoughts-io?source=rss----4849bfe91aa8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>mythoughts.io - Medium</title>
            <link>https://medium.com/mythoughts-io?source=rss----4849bfe91aa8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 05:12:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/mythoughts-io" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to start a company in France — 2018]]></title>
            <link>https://medium.com/mythoughts-io/how-to-start-a-company-in-france-2018-c56f38d107c3?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/c56f38d107c3</guid>
            <category><![CDATA[france]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[entrepreneur]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 09:58:34 GMT</pubDate>
            <atom:updated>2018-04-19T12:17:20.466Z</atom:updated>
            <content:encoded><![CDATA[<h4>I’m back at being an entrepreneur this year and just launched a brand new startup here in France. This new venture is my third one in 12 years — but my last one having been started in 2007, a few things changed since then…</h4><h4><strong>What is it like to launch a company in 2018?</strong></h4><p>Honestly <strong>this is easier than ever</strong>, thanks to new laws that have been able to bootstrap a whole ecosystem of <strong>startup</strong> focused on <strong>easing your “administrative” tasks as a founder</strong>!</p><h4><strong>1- Legal Setup</strong></h4><p>The time of gibberish forms and endless back and forth with the administation is over, you can now <strong>start a company 100% digitally -</strong> without hassle — and have everything ready in <strong>3 to 4 days maximum</strong>!</p><p><strong>For that purpose we used </strong><a href="http://legalstart.fr/"><strong>LegalStart.fr</strong></a></p><p>The big plus is that even if you are new to entrepreneurship, LegalStart provides you with very good information and advice — definitvielty a great source of knowledge.</p><h4><strong>2- Banking</strong></h4><p>One big part of the process of setting up a company is to open a bank account (<em>it’s mandatory</em>) — and sadly <strong>banks are usually a huge hassle</strong>. On the consumer level a lot of new options are now available (N26, Revolut etc.), but don’t worry <strong>entrepreneur have not been forgotten</strong>!</p><p>You can now <strong>open a bank account</strong>, have an IBAN and Credit Cards in few clicks, no phone call, <strong>no paperwork</strong> and most importantly <strong>no opening hours</strong>!</p><p><strong>For that purpose we use </strong><a href="http://qonto.eu/"><strong>Qonto.eu</strong></a></p><p><em>The nice thing is that Qonto and LegalStart are partners, making the whole capital process very simple.</em></p><p>Disclaimer: As of today these solutions are not yet fully comparable to “traditional” bank offers, meaning that if you plan to keep lot of money (<em>for ex. with a VC round</em>) you will probably still have to open a traditional bank account later. That said it might change with the future opening of <a href="https://margo.com/en/">MargoBank</a> and still it’s a great solution for many.</p><p><strong>3- Office Space</strong></p><p>Working <strong>remotely is definitively a great option</strong> <strong>in 2018</strong>, still you might want to get an office, meet with co-workers or simply don’t feel working alone.</p><p>In France, <strong>renting an office is legally very constraining</strong> (“<em>bail 3/6/9”)</em>, expensive, subject to taxes and therefore not flexible. That’s also changing thanks to CoWorking Spaces that boomed in the last 18 months.</p><p>If you live in Paris, there are literally dozens of very <strong>nice co-working spaces</strong>. You can rent —<strong> without any commitment</strong> — from a <strong>single desk </strong>to a <strong>2 or 50 people closed office</strong> in a matter of hours and be ready to work asap (<em>Internet, furniture, meeting rooms, kitchen, coffee etc.- all included</em>).</p><p>There are even startups handling that search &amp; find process for you!</p><p><strong>For that purpose we used </strong><a href="http://kowffice.com/"><strong>Kowffice</strong></a><strong> &amp; </strong><a href="https://www.leosquare.com/"><strong>LeoSquare</strong></a><strong> and ended-up renting at </strong><a href="https://www.athome-startup.fr/"><strong>At Home</strong></a><strong>.</strong></p><h4><strong>4- Employee Pay &amp; Health Insurance</strong></h4><p>Now that you are ready to hire people you need to manage what we call “The Pay” and everything that goes with it. Remember <strong>France is a welfare state</strong>, meaning it doesn’t come free of charge and <strong>administrative complexity</strong>!</p><p>That said this <strong>complexity is now a thing from the past</strong> — you don’t need to read the entire labor code anymore or hire dedicated people to manage it.</p><p><strong>For the pay we use </strong><a href="https://payfit.com/fr/"><strong>PayFit</strong></a><strong><br></strong>Payfit is even able to manage employee’s expense report and obviously link that to the monthly pay. They handle every possible scenario which is highly impressive.</p><p><strong>For the health insurance we use </strong><a href="http://alan.eu/"><strong>Alan</strong></a><strong><br></strong>The nice thing is that PayFit and Alan did partner and the link between them is automated!</p><h4>What else do you need to handle?</h4><p><strong>Accounting</strong> — There are startups that try to ease that part (<a href="http://freddelacompta.com/">Fred</a>), but at the end it is a person’s job where trust is key.</p><p><strong>Legal</strong> — Same apply to lawyers, and probably even more. Legal is about lot of different highly critical topics — corporate legal, IP, employment law etc. — that you don’t want to underestimate! The best idea is to have someone that can coordinate all those different aspects for you.</p><p><strong>Insurance </strong>— If you have an office you legally have to get insurance and besides it’s a good idea to get one for the company. It’s fairly easy with lot of private offers, some are now even focusing on startup like <a href="http://yesassurances.fr/">YesAssurances</a>.</p><p><strong>I hope this post will make you want to start a company in France and even help you, remember we now are a </strong><a href="https://www.reuters.com/article/us-france-business/french-business-creation-surges-as-macron-promises-start-up-nation-idUSKBN1F51M0"><strong>Startup Nation</strong></a><strong>!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FKDWkdSkCFLL0pv7nYW3ug.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c56f38d107c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/how-to-start-a-company-in-france-2018-c56f38d107c3">How to start a company in France — 2018</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Rails and Docker in Development — making them play nice together!]]></title>
            <link>https://medium.com/mythoughts-io/using-rails-and-docker-in-development-making-it-play-nice-together-41ef20ef78b0?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/41ef20ef78b0</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Wed, 12 Apr 2017 11:58:15 GMT</pubDate>
            <atom:updated>2017-04-12T12:01:07.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fc2h4HcmLnrNr0iTrFje8w.png" /></figure><p><strong>Who didn’t try Docker? But who succeeded in setting-up an efficient and clean development environment with it? Sadly a lot less</strong> :(</p><p>Using docker in development is a lot trickier than running it in staging or production from a functional standpoint (<em>let’s not start a :troll:</em>). Let’s see in this article <strong>what are the issues, how to circumvents them</strong> and finally how to <strong>make everything easier</strong> with the <a href="https://github.com/gmontard/dockrails"><strong>Dockrails Gem</strong></a><strong>!</strong></p><h3>Common issues</h3><h4>1- Docker Compose</h4><p>Your application is probably not just a simple app container, but chances are you will <strong>need one or more databases</strong> (mysql, pgsql, redis etc.) and even a <strong>job container</strong> or more. This is where <strong>Docker-Compose comes to play</strong>, by using a <em>docker-compose.yml</em> file you get to describe your containers and their link between each other.</p><h4>2- Code sync</h4><p>In development you <strong>code on your docker host machine</strong> (Mac etc.) with your <strong>favorite editor</strong> (Atom, Sublime, Vi etc.) and instantly refresh/run it — something that <strong>docker is not intended for</strong>. To be able to perform this sync you need to have your code base shared as a volume between your host and your container (both ways), sadly <strong>docker shared volume is so slow that it makes it unusable for this task</strong>!</p><p>Luckily a very smart guy, <strong>Eugen Meyer</strong>, came up with a <strong>tool called “docker-sync”</strong> that provide <strong>near instant sync</strong>. This tool come with a built-in <strong>command <em>docker-sync</em> </strong>that sit <strong>on top of docker-compose</strong>.</p><h4><strong>2- Data persistence</strong></h4><p>Each time you <strong>restart a container it does lose all its previous data</strong> (<em>containers are stateless</em>), meaning your <strong>databases get lost</strong>, your <strong>Gems too</strong> etc. To <strong>enable persistence</strong> you need to use a <strong>docker volume</strong> and <strong>mount the desired folder(s)</strong> to it and then reference everything in <em>docker-compose.yml</em>.</p><h4>3- Live debugging in the console</h4><p>If you’ve tried it yourself chances you discovered that it <strong>wasn’t straightforward to be able to use Pry or ByeBug</strong> while running your app in a container. The solution is to use <strong>docker-attach</strong> with the container image name and <strong>add a few lines</strong> in your <em>docker-compose.yml</em>.</p><h4>4- Git/SSH Access</h4><p>Did you find yourself <strong>needing to access a Git </strong>repository or perform<strong> an SSH session, from a container</strong>? You probably don’t want to add yet an other key that might get lost or changed at the next container reboot! The solution is to <strong>share your host SSH keys with your containers</strong> and possibly <strong>deal</strong> with the <strong><em>known_hosts</em> message</strong> in advance.</p><h4>5- Commands hell!</h4><p>If you are <strong>not familiar with docker it can get a bit messy</strong> and add a lot of <strong>overhead </strong>for your day to day workflow. Most of us are <strong>used to a set of commands </strong>in development, like bundle exec <em>rails start</em>, <em>bundle exec rake db:migrate</em> etc. and we <strong>don’t want to add complexity </strong>because we are using Docker. In addition to the <em>docker </em>command we introduced <em>docker-compose</em> and <em>docker-sync</em>, <strong>now go figure out which one to use and how </strong>to combine them with <strong>your development workflow</strong>!</p><h3>Let’s introduce Dockrails!</h3><p>I strongly <strong>believe in simplicity </strong>and<strong> automation</strong>, after discovering and circumventing all the above issues I was <strong>very</strong> <strong>satisfied with my docker environment for development</strong>. Finally, I was able to <strong>ditch Vagrant</strong> and the heavy Virtual machine.</p><p>To make <strong>all of this much easier</strong> I designed a <strong>simple CLI</strong> (through a Gem) called <a href="https://github.com/gmontard/dockrails"><strong><em>Dockrails</em></strong></a>, it <strong>provides an interactive command to build</strong> <strong>and run </strong>your environment <strong>without falling into the commands hell</strong>!</p><figure><a href="https://asciinema.org/a/26tls9e5bh860ai91d7grkkf6"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFL6MRO7DhVNUVHcZKku_A.png" /></a></figure><blockquote>Now you don’t have any more excuses to not use docker in development and build a reusable environment!</blockquote><p><strong>Get Dockrails on Github: </strong><a href="https://github.com/gmontard/dockrails">https://github.com/gmontard/dockrails</a></p><p><strong><em>If you liked this article please consider clicking the ❤️ below so more people could read it, thank you!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41ef20ef78b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/using-rails-and-docker-in-development-making-it-play-nice-together-41ef20ef78b0">Using Rails and Docker in Development — making them play nice together!</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I Learned Spending 10 Years Building a Startup]]></title>
            <link>https://medium.com/mythoughts-io/what-i-learned-spending-10-years-building-a-startup-86ee58f6aea8?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/86ee58f6aea8</guid>
            <category><![CDATA[feedback]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[entrepreneur]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Fri, 03 Mar 2017 11:15:21 GMT</pubDate>
            <atom:updated>2017-03-06T12:17:35.266Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I Co-founded Vodeclic in 2007 and served as CTO, we got acquired in 2015 by SkillSoft and I kept on working there for 18 months until I decided to quit last December.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHM_0L_Qyjlu5vlCw_iNPg.png" /></figure><h4>It takes a lot of time, a whole lot of time!</h4><p>I never thought about this before I started, obviously it takes a lot of your day to day time but more importantly it just takes time as in years. <strong>It took me almost 10 years and I honestly don’t know if I would have signed for it if I knew</strong>. By the way 10 years is the average time for a successful startup adventure.</p><h4><strong>Hiring is key and yet you will do many mistakes and it’s OK</strong></h4><p>You have to hire, but the truth is that it’s damn hard and not only in tech jobs, in any jobs! I found this hard because you end-up always<strong> looking for the five-legged sheep</strong> and even when you found it chances you will need someone different in a year or two because your company changed so much.</p><h4><strong>Why would the best work for you?</strong></h4><p>Like I said previously hiring is hard and yet people always say something like “I’m looking only for the best” but did you ask why would those people work for you? Honestly we weren’t Google, Uber or the next Unicorn and chances are most startups aren’t either. <strong>You won’t hire “only the best” and it’s OK</strong>, you probably <strong>don’t need them</strong> and <strong>won’t be able to handle them </strong>anyway. At the end of the day I often even traded really good technical candidates by other I found more as a match with the company, the mindset and that I could help grow with the company. <strong>More than hiring people you are building a team!</strong></p><h4>Taking decision will become natural</h4><p>Sometimes people ask me how do you do to take such decision without looking back or doubting? <strong>Build a company and you will understand!</strong> Decision have to be taken everyday and the truth is that usually this is <strong>not the decision that matter, there is no right or wrong, only knowing why you took it really matters.</strong></p><h4>You never have enough money, never!</h4><p>As a founder you crave to raise fund because you need it to hire people, invest in the product, marketing etc. so <strong>once you raise money you think this is it</strong>. In fact, no and <strong>it only gets worse, money call money</strong> and the life of a startup is the non stop growth, in other words more money.</p><h4>It goes fast, but never fast enough</h4><p>Building from scratch a company, create a new product, hire dozens of people, make millions of dollars etc. <strong>this is amazing to do this in only 10 years</strong>! Building a startup can feel <strong>like a sprint with a marathon distance, </strong>but even that feel too slow when you are in because<strong> you always look for the next step.</strong></p><h4>Focus is key</h4><p>Everybody says it and yes it’s so true! <br>I felt this is a <strong>schizophrenic thing to do</strong> because you need to be open, for instance to get the right business model or market or product fit, but you need extreme focus in the meantime because <strong>it’s so easy to get yourself lost in endless path</strong>. It’s also very hard for technical/product people because <strong>today it’s easier than ever to build almost anything and that is a dangerous thing!</strong></p><h4>This is the best learning adventure possible</h4><p>Looking back my 10 years, I learned so many things that I don’t even know from where to start. If you like this<strong> feeling of not knowing anything about a topic and starting to catchup time after time, this is just amazing</strong>.</p><h4><strong>It’s a lonely job</strong></h4><p>Most people don’t talk about it, but I really do feel that way. Usually <strong>we create friendship and sometimes even more at work</strong>, the place you spend most of your time, but <strong>as a founder I don’t see how you can do this</strong> and yet it takes 10 years.</p><h4><strong>Doing it alone would have been impossible</strong></h4><p>I had two co-founders and I consider this the best approach, I wouldn’t start a company only by myself. Having co-founders help you <strong>keep the motivation</strong> and <strong>brings X times more skills/time</strong> on the project which is truly invaluable.</p><h4>The grass looks always greener on the other side</h4><p>Don’t read TechCrunch, it’s as simple as that! I’m only half joking, there is <strong>sadly a lot of bullshit in this economy</strong> so don’t spend too much time listening or you will end-up frustrated for nothing. <strong>Focus</strong>.</p><h4>Sometimes you wish you’d have stay small</h4><p>Crazy right? You <strong>spend you entire time growing</strong> and yet you do <strong>feel</strong> <strong>it was better once you were only a few</strong>. I felt this at about the 20th employees and once you don’t even remember everyone first name then it gets bad, but this is the game.</p><h4>Your company feels like home</h4><p>Imagine a place where you spend 50% of your time for years, where you know (<em>mostly</em>) everyone, they all know you, you have all your habit, etc. <strong>doesn’t it sound a bit like home?</strong></p><h4>Exit is the accomplishment you looked for!</h4><p>When you start a company and raise money <strong>you know there will be an exit</strong> (good or bad) and this is how most people <strong>measure</strong> <strong>success </strong>in this economy. I felt the acqusition of my company as a <strong>recognition</strong> for all that<strong> time and hard work</strong>.</p><h4>Yet an Exit is still an Exit</h4><p>An <strong>exit means you are gone one way or another</strong>, this is no longer your company and chances are you won’t work there anymore very soon after. Usually you <strong>don’t really control that timing,</strong> which is maybe what makes it harder to grasp.</p><h4>What to do next after such an adventure?</h4><p>Personally it is still an open question, but I don’t see how not to start something else,<strong> it’s probably an addiction!</strong></p><p><em>Below the slides that support this talk.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2FbTcyANVSbHmaTK&amp;url=https%3A%2F%2Fwww.slideshare.net%2FGuillaumeMontard%2Fwhat-i-learned-spending-10-years-building-a-startup&amp;image=https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fwhatilearnedspending10yearsbuildingastartup-170303110924-thumbnail-4.jpg%3Fcb%3D1488539445&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3a1fb7eeb41f2fa1129f9a8731b3b74/href">https://medium.com/media/a3a1fb7eeb41f2fa1129f9a8731b3b74/href</a></iframe><p><em>If you liked this article please consider clicking the ❤️ below so more people could read it, thank you!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86ee58f6aea8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/what-i-learned-spending-10-years-building-a-startup-86ee58f6aea8">What I Learned Spending 10 Years Building a Startup</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The End of a Great Story]]></title>
            <link>https://medium.com/mythoughts-io/the-end-of-a-great-story-a1f50442ddf8?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1f50442ddf8</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Wed, 30 Nov 2016 09:21:31 GMT</pubDate>
            <atom:updated>2016-11-30T09:23:53.958Z</atom:updated>
            <content:encoded><![CDATA[<p>The day has come, today is my last day at <a href="http://www.vodeclic.com/">Vodeclic</a> (<em>as Co-Founder &amp; CTO</em>) and <a href="http://www.skillsoft.com/">Skillsoft</a> (<em>as VP Engineering</em>), a story that started almost 10 years ago and that I never thought would lead me to that incredible journey!</p><p>I would like to thank my co-founders, Gabriel and Xavier, with whom this journey would never have happened. Thanks to my amazing engineering team at Vodeclic that I enjoyed so much working with along those years and finally the Skillsoft team, especially <a href="http://www.skillsoft.com/percipio">Percipio</a> project.</p><p>I won’t forget all the people I came across along those years, co-workers, partners, investors, etc. It was a fantastic journey, a once in a lifetime experience!</p><p>Anyway it’s time open a new chapter, but not first without some long overdue relaxing vacation :)</p><p>Guillaume.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*RBxdQqgxxmgblAmIJ33DSw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1f50442ddf8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/the-end-of-a-great-story-a1f50442ddf8">The End of a Great Story</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating from Jekyll to Medium]]></title>
            <link>https://medium.com/mythoughts-io/migrating-from-jekyll-to-medium-98f83bad1619?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/98f83bad1619</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[jekyll]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[medium]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 17:54:18 GMT</pubDate>
            <atom:updated>2017-03-06T12:20:59.830Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*ITWPCJsXE4OGHiDaGdy5Kg.png" /></figure><p>For those that don’t know <a href="https://jekyllrb.com/">Jekyll</a>, it’s a simple and yet powerful static blog engine, used by <a href="https://pages.github.com/">Github Pages</a> for instance. I decided to <strong>move to Medium and needed a migration solution</strong>.</p><p>Medium let you <a href="https://help.medium.com/hc/en-us/articles/218572107-How-to-move-to-Medium">import</a> your old blog posts (by keeping date, tags etc.) but there is one small gotcha, it <strong>only works with Wordpress</strong>! In fact Medium ask you to export your posts with the Wordpress export feature which <strong>produce a custom XML file</strong>.</p><p>Jekyll doesn’t offer export feature, but by using <strong>Liquid markup</strong> I knew it was <strong>going to be possible to reproduce the same export file. </strong>Indeed, the solution was simple and took less than an hour to build.</p><p>Now time to get <strong>hands dirty, </strong>start by creating an <em>export.xml</em> file at the root of your blog, use code snippet below which use Jekyll template and liquid variables (<em>you may need to adapt those to your own Jekyll config</em>), download the XML output and use it in the Medium import tool.</p><blockquote>Simply put, <strong>it works great!</strong></blockquote><p>The Markdown -&gt; HTML -&gt; Medium <strong>text</strong> <strong>conversion is fantastic</strong>, your <strong>old URL are well 301 redirected</strong>, <strong>tags</strong> are presents, <strong>images</strong>, <strong>subtitle</strong> etc. the only <strong>downside</strong> is for <strong>code block</strong> that I ended-up rewriting quickly after the import was performed.</p><p>Below the full Jekyll export file, enjoy!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8352a89df47fffa84ba5722c78b6575a/href">https://medium.com/media/8352a89df47fffa84ba5722c78b6575a/href</a></iframe><p><em>If you liked this article please consider clicking the ❤️ below so more people could read it, thank you!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98f83bad1619" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/migrating-from-jekyll-to-medium-98f83bad1619">Migrating from Jekyll to Medium</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Facebook, welcome to B2B, seriously!]]></title>
            <link>https://medium.com/mythoughts-io/facebook-welcome-to-b2b-seriously-d89d85005c32?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/d89d85005c32</guid>
            <category><![CDATA[b2b]]></category>
            <category><![CDATA[b2c]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 11:38:14 GMT</pubDate>
            <atom:updated>2017-03-06T12:20:04.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*NyGSOdRuaJ26iaIDk7bACA.jpeg" /></figure><p>Yesterday, <strong>Facebook finally </strong><a href="https://workplace.fb.com/"><strong>unveiled Workplace</strong></a>, their « enterprise » Facebook offer. By making this move Facebook is entering in a very new and different market, <strong>B2B SaaS </strong>and<strong> it is no small thing even for them</strong>!</p><p>Do you know a company that is successful on B2B and B2C altogether at a major scale? Chances are that not and this is for a very good reason, <strong>it’s damn hard</strong>!</p><p>Most companies that play in both fields are usually in a transition period, they <strong>start as a B2C offer and shift to B2B, </strong>but try to keep the B2C revenue along the way. <strong>Eventually they kill their B2C offer</strong> because they find out that <strong>even if the product looks the same</strong>, the rest is <strong>so dramatically different</strong>; from Sales to Marketing, Branding and even Technology (security, deployment, support etc.).</p><blockquote><strong>With Workplace Facebook is betting against the odds!</strong></blockquote><p>I’m confident that <strong>Facebook is not going to reinvent itself and neither loose the consumer model </strong>or<strong> change </strong>its<strong> technology </strong>or its<strong> core principles </strong>like the famous<strong> « Move Fast and Break Things » </strong>(<em>even if they </em><a href="http://mashable.com/2014/04/30/facebooks-new-mantra-move-fast-with-stability/#ggcrigJFEkqL"><em>sort of did</em></a>) and this is exactly why we are about to witness a very interesting journey in the B2B &amp; SaaS landscape.</p><blockquote>How does Facebook DNA, deeply linked to B2C, is going to play in the Enterprise?</blockquote><p>Take a few topics like data privacy and security? Currently, Workplace doesn’t offer true data isolation between customers and neither offers regional datacenter of your choosing (<a href="https://fbatwork.files.wordpress.com/2016/05/facebook-soc-3-atwork.pdf"><em>more info here</em></a>). All those things are what Enterprise customers tend to ask more and more lately, <strong>is Facebook simply going to be able to tell them to forget about it</strong>? Even the pricing model is pretty bold for SaaS, MAA (Monthly Active User) is not the norm at all and this is only a few examples.</p><blockquote>As of today Workplace is mostly a thin layer on top of the “normal” Facebook.</blockquote><p><strong>Facebook Workplace is a bold move</strong>, not because the product is a revolution, it’s not, but<strong> if</strong> <strong>Facebook succeed it’s going to affect the whole B2B SaaS ecosystem.</strong></p><p>I’m thrilled.</p><p><em>If you liked this article please consider clicking the ❤️ below so more people could read it, thank you!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d89d85005c32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/facebook-welcome-to-b2b-seriously-d89d85005c32">Facebook, welcome to B2B, seriously!</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Helioth: Feature Flipping Ruby Gem]]></title>
            <link>https://medium.com/mythoughts-io/introducing-helioth-feature-flipping-ruby-gem-e6261dd00c9b?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/e6261dd00c9b</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rollout]]></category>
            <category><![CDATA[flipping]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Wed, 10 Sep 2014 22:00:00 GMT</pubDate>
            <atom:updated>2016-11-18T14:59:40.524Z</atom:updated>
            <content:encoded><![CDATA[<p>Your application keeps getting bigger and bigger, the number of features increase and the customer base grow exponentially! Everything is fine, right? Pretty much, but with <strong>more features, more releases and more customers we tend to increase the rate at which a problem will occur</strong>.</p><p>Let’s imagine a feature you are launching is bugged (no this never happen!) or is not yet fully ready, but your product team is pushing for a release? <strong>This is when it starts to get messy and developers don’t like that!</strong></p><p>Starting digging into this problem I found out I wasn’t the only one (shocking!) and also that a <strong>whole concept to manage those problems called Feature flipping existed</strong>. Let me explain you some of this concept, then dig into real use cases and eventually how I tried <strong>to tackle it with my own Ruby Gem </strong><a href="https://github.com/gmontard/helioth"><strong>Helioth</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*k3vUZWjOYDCBuFtK-aW-mg.jpeg" /></figure><h4>Feature flipping concept</h4><p>As I said this concept is not new, in fact it was (first) introduced by Flickr in 2009 in this <a href="http://code.flickr.net/2009/12/02/flipping-out/">blog post</a>.<br>The idea is pretty simple and I like to resume it as:</p><blockquote>Having a way to enable or disable a feature in a blink</blockquote><p>So how do we make that happen?<br>First you need a <strong>simple interface where all features are described</strong> (a configuration file, database etc.). On this interface you should be able to turn each feature status on and off and your app should automatically be impacted. One important thing to remember is that <strong>you shouldn’t change any of your application code</strong> during this process!</p><p>Let’s be fancy and from now on call this concept a <strong>Pattern</strong>. This feature flipping pattern is also known as:</p><ul><li>Feature flag</li><li>Feature bucket</li><li>Feature toggle</li><li>etc.</li></ul><h4>Use cases</h4><p>We introduced earlier the idea to use this pattern to enable or disable a feature in case of emergency. Of course there is more granularity to this use case. Let me introduce you two of them which will be <strong>the foundation of what’s coming next</strong>.</p><p>As a SaaS company when we ship code all our customers gets it at the same time which is pretty cool and one of the few reasons why SaaS is awesome! But we all have very important customers and even more important one (not that all customers are not important!).</p><p>I think you see where I’m going! Wouldn’t it be a great to <strong>be able to tag the importance of a customer and correlate it with the release stage of a feature?</strong> When everything will be fine and well battle tested it will be time to flip the feature to a full production phase affecting even the most important customers!</p><p>An other use case that we encounter is related to localization. Our platform is localized in 6 langages and it can happen that a feature is ready, but not yet localized for a specific language. Business and Product departments are pushing for a release and again feature flipping pattern is a pretty good answer. This time we could <strong>flag each feature with a set of locales and depending on the user language we enable the feature</strong> or not.</p><p><strong>Those two use cases are some of the most concerning one for me as running a B2B SaaS Application.</strong></p><h4>Implementing this pattern</h4><p>Now that we know the pattern and have some use cases it’s time to get technical!</p><p>We said it has to be easy and not impact the full application code. In order to do that we talked about describing the feature set. In fact, <strong>we are looking for more than a description, but more a framework</strong>. This way the application should implement as little logic as possible, and only make simple call as:</p><pre>if is_enabled?(:feature)<br> #do this<br>else<br> # do that<br>end</pre><p>By mixing those requirements and our use cases, let’s right down some of know facts:</p><ul><li>An app has users</li><li>An app has features</li><li>Users are linked to locales (language, ex: :fr, :en, :zh)</li><li>User have a status (ex: standard, important, critical)</li><li>Features also have a status (ex: beta, pre-release, production)</li><li>Features have locales (= localized in x languages)</li></ul><p>Here is everything needed to build a description framework! Once in place <strong>our application shouldn’t do anymore than asking if a feature is enabled or not while delegating all the logic to this framework</strong>.</p><h4>Ruby / Rails implementation (Gem)</h4><p>I found many Gems that implement this pattern and (even) some very nice one (ex: <a href="https://github.com/jnunemaker/flipper">flipper</a>, <a href="https://github.com/pda/flip">Flip</a>, <a href="https://github.com/FetLife/rollout">rollout</a> etc.), but in fact none of them covered my use cases. Decision was made, I decided to <strong>build my own Gem and push the concept a little bit further</strong>.</p><p><strong>One of the main difference with my implementation is the way the decision logic is handled</strong>. I decided to put more logic inside the description file by setting a set of status for every objects (feature, user, instance) and then set their relations. At the end I think it’s much easier to read and maintain and give you more granularity.</p><p>Like I said the most important thing was having a simple and easy description process. In order to do that I chose to build the gem around a <a href="http://fr.wikipedia.org/wiki/Domain-specific_programming_language">DSL</a>. This DSL is the only thing the developer need to write and all the flipping logic is built behind the scene using it. Using a DSL was not only to be fancy but also to make the process readable and easy for any developers:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fafafb19d4a22836024b501883efeef6/href">https://medium.com/media/fafafb19d4a22836024b501883efeef6/href</a></iframe><p><strong>To find out more about how it works checkout </strong><a href="https://github.com/gmontard/helioth"><strong>Helioth Github repository</strong></a></p><p>Have fun and please give me your feedback to improve it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6261dd00c9b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/introducing-helioth-feature-flipping-ruby-gem-e6261dd00c9b">Introducing Helioth: Feature Flipping Ruby Gem</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vagrant, developer’s best friend!]]></title>
            <link>https://medium.com/mythoughts-io/vagrant-developers-best-friend-558d15224c7b?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/558d15224c7b</guid>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Wed, 23 Jul 2014 22:00:00 GMT</pubDate>
            <atom:updated>2016-11-18T14:57:38.580Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve started using Vagrant 9 months ago. At the beginning my goal was to <strong>stop spending time setup dev environment</strong> (I like to break it) and manage to get a consistent one between my developers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*4S2Jl6fUjzDqdauN7dgUIg.jpeg" /></figure><p>I worked on that matter earlier with a tool called <a href="https://boxen.github.com/">Boxen</a> (made by Github team) which purpose is to automate software install on OS X with a lot of HomeBrew behind the scenes. I’ve struck with many problems within this approach:</p><ul><li>Boxen always broke on OS X updates</li><li>It didn’t allow me to setup multiple environment per machine (which is not its goal anyway)</li><li>It only works on OS X</li></ul><p>Then came <strong>Vagrant</strong>!</p><p>My first reaction was:</p><blockquote>Yeah I’ll finally won’t fear to test and crash my box</blockquote><p>And right after that one:</p><blockquote>Oh my god I hate those Virtual Machines!</blockquote><p>Let’s see what makes <strong>Vagrant so useful for any developer</strong> (and devops!).</p><h4>Back to basis</h4><p>If you don’t know much about Vagrant I suggest you check their <a href="http://www.vagrantup.com/">website</a> and if you are too lazy let me resume it:</p><blockquote>A command line utility to let you build and run virtual machine using VirtualBox (or VMware) in the background.</blockquote><p>This means that you, as a developer, won’t have to use VirtualBox GUI at any time. You will run <strong>everything from your shell</strong> and the whole process will feel so natural that you will forget that you are running your code inside a VM (hopefully).</p><h4>Building aka Provisioning</h4><p>Your computer (the host) won’t run anymore your code, the Vagrant machine you are going to build will. In order to do so the first step is to actually <strong>build this machine</strong>, this is the <strong>provisioning</strong>.</p><p>Vagrant is able to use multiple providers: Chef, Chef-Solo, Puppet, Ansible and even Docker (full list <a href="https://docs.vagrantup.com/v2/provisioning/index.html">here</a>). It’s up to you to choose the one you like. The important thing is that this process force you to create a <strong>repeatable environment</strong> and this is a <strong>very good thing</strong>. You just need to pick the base box of your choice (<a href="https://vagrantcloud.com/discover/featured">full list</a>) and start the provisioning!</p><p>The whole Vagrant setup is described in a file called <em>Vagrantfile</em> that you should add at the root of your application repository and version it. Now <strong>your developer won’t only share code, but also the whole configuration needed to run it</strong>.</p><p>Once your Vagrant is setup it only takes one command to build your machine:<br><br>$ vagrant up</p><h4>Running it</h4><p>Once your machine is setup, you are ready to use it. Think of this machine as a distant server, so how do we use it? <strong>SSH</strong> my dear friend:</p><p>$ vagrant ssh<br><br>$ cd /vagrant #where vagrant mirror your host repository</p><p>Vagrant takes care of <em>everything</em> for you:</p><ul><li><strong>Mirror your code</strong> to the VM through NFS, so you can still use your host machine to code!</li><li><strong>Forward your host SSH keys</strong> to the VM so you can still connect to your servers inside the VM (useful for deployments!)</li><li>Setup <strong>everything network related</strong>, public and private network, port forwarding etc.</li><li>Manage the <strong>RAM and CPU dedicated</strong> to the VM</li><li>etc..</li></ul><h4>Gotchas</h4><p>At the beginning we experienced two kinds of problems, NFS share was slowing down our code and Network was pretty unstable. We solved those by switching to VMWare Fusion (which is a paid option) instead of VirtualBox.</p><p>Finally 3 months ago <strong>we switched back to VirtualBox</strong>, all those <strong>problems are now fixed</strong> and performance are at least as good as on VMWare.</p><p>Nowadays Vagrant seems to get more and more traction from the community and they add new features on a regular basis.</p><h4>Key benefits</h4><p>After 9 months of use with my team, here are the benefits I mesure:</p><ul><li>We now have a <strong>fast and easy initial setup</strong> for new developer</li><li>Our <strong>environment is always in sync</strong> (homogeneous)</li><li>We <strong>try more new things</strong> because we don’t fear to break our setup</li><li>Our <strong>development is closer to production</strong> which reduce last minute bug</li><li>Developers <strong>acquire DevOps knowledge</strong></li></ul><p>I hope this post gave you the desire to try it by yourself if it’s not already the case. If you have anything to add or to say feel free to use the comment section below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=558d15224c7b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/vagrant-developers-best-friend-558d15224c7b">Vagrant, developer’s best friend!</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A small step for the developer, a big step for the product]]></title>
            <link>https://medium.com/mythoughts-io/a-small-step-for-the-developer-a-big-step-for-the-product-28b621ed80b6?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/28b621ed80b6</guid>
            <category><![CDATA[features]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Mon, 23 Jun 2014 22:00:00 GMT</pubDate>
            <atom:updated>2016-10-13T11:33:11.821Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the story of how a simple feature could change a product.</p><p>Do you sometimes <strong>feel that a small change could be a big game changer</strong>?<br>Some don’t see it or the difference that it can make, but trust me when you see them it’s very frustrating.</p><p>I would like to give you one example, for that I’m calling Google as a witness.</p><h4>The Google «App Launcher» case</h4><p>You all know Google and Google Apps aka “Google for Business”.</p><p>Few years ago they started the Google Apps Marketplace, a marketplace for third party applications and vendors. Back in 2010 this was a huge deal, almost like it always is with Marketplaces and Google!</p><p>I won’t talk more about the marketplace for now, but about a simple feature you all have with your Google account, the « App launcher » link you find on the top bar of all google services:</p><figure><img alt="Google App Launcher" src="https://cdn-images-1.medium.com/max/331/0*KGufN2bbN-D7NZFJ.png" /></figure><p><strong>The idea of this launcher is great</strong> being able to access all your services with one click wherever you are! Back to our Marketplace for a second, one of the goal for 3rd party publisher is to develop apps that can let users use their google identity (Single Sign-On) and then be always <strong>one click away from the user</strong>. Google thought so too, so they made those Apps part of this « App launcher ».</p><blockquote>Remember SaaS is a paid as you go model, <strong>being visible is crucial</strong>.</blockquote><p>So everything is great… Except that when you add one of those marketplace App you don’t find it in the App Launcher because it’s <strong>hidden inside a « more » link at the bottom, genius UX!</strong></p><figure><img alt="Google App Launcher" src="https://cdn-images-1.medium.com/max/336/0*NnwV0IehdeoBeRl3.png" /></figure><p>So what could make a difference? Why not let users re-order those apps as they like, maybe they don’t care about « Google Sites » but more about the SaaS application they just bought? Hmm..</p><p>I don’t think it’s possible to argue with this, but <strong>it took almost 4 years for Google to do it</strong>. Since few weeks you can re-order those Apps as you like. (Only for personal Google account right now, but it will come next to Google Apps)</p><figure><img alt="Google App Launcher Order" src="https://cdn-images-1.medium.com/max/359/0*391X9fHCb0xDZCWn.png" /></figure><p>I’m sure with this small change Google will see a lot <strong>more people using the « App launcher »</strong> and it will also <strong>add value to the Google Apps Marketplace perceived by publishers</strong>.</p><blockquote>A small step for the developer, a big step for the product</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28b621ed80b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/a-small-step-for-the-developer-a-big-step-for-the-product-28b621ed80b6">A small step for the developer, a big step for the product</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing dynamic domains with Rails]]></title>
            <link>https://medium.com/mythoughts-io/managing-dynamic-domains-with-rails-b6ab1040dc8c?source=rss----4849bfe91aa8---4</link>
            <guid isPermaLink="false">https://medium.com/p/b6ab1040dc8c</guid>
            <category><![CDATA[domains]]></category>
            <category><![CDATA[route]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Guillaume Montard]]></dc:creator>
            <pubDate>Sun, 13 Apr 2014 22:00:00 GMT</pubDate>
            <atom:updated>2017-03-06T12:19:43.837Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*lHmh1HxL8Ferx-Hmyy1Rgw.jpeg" /></figure><p>As many SaaS application we offer the option to <strong>customize the domain</strong> (and subdomain) of our application to our customers. This option has always been a pain to manage in our Rails application. Rails 3 introduced a new concept, <strong>Routes constraints</strong> which makes Routes more dynamic, but it’s not (always) enough for this specific problem.</p><h4>The routes constraints</h4><p>As mentioned earlier Rails 3 support the concept of constraints for its Routes. Based on the <a href="http://guides.rubyonrails.org/routing.html#advanced-constraints">documentation</a> I created a custom constraint as below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a57746228c60412e518cf52175694db/href">https://medium.com/media/6a57746228c60412e518cf52175694db/href</a></iframe><p>Then I created a simple constraint class which respond to the <em>matches?</em> method by looking at the current host of the request and comparing it to the content of the @domains object. One thing to remember for later, <strong>this initialize only happen once</strong>, when the application starts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d834c6a4175b0cfa00eb4611ff38fdee/href">https://medium.com/media/d834c6a4175b0cfa00eb4611ff38fdee/href</a></iframe><p>So does this code work? Yes but when I add an item the <em>Domain</em> Model nothing happen, why?</p><h4>Making dynamic constraints</h4><p>As I said earlier the constraint class is initialized only once, at startup. So <strong>the @domains object never get update if we change the <em>Domain</em> Model</strong>.</p><p>The first solution I thought was to reload the class when I updated my <em>Domain</em> model. In fact, this means “Reload the Routes” which is something possible with the <a href="http://apidock.com/rails/Rails/Application/reload_routes!">reload_routes!</a> method.</p><p>We just have to add a callback to our subdomain Model:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96dbc1b56adc4a976d47666262d02617/href">https://medium.com/media/96dbc1b56adc4a976d47666262d02617/href</a></iframe><p>And voila…</p><p>Remember how Ruby works? Let me refresh your memory, NO (true) multithreading, so chances are <strong>you run multiple concurrent process of your application</strong> to spread the load. Then, the reload_routes! method has to run against each process in order to update your Routes on all processes.</p><p>Since I didn’t want to jump too much in this process thing, I bypassed this restriction by implementing a simple trigger mechanism.</p><h4>Triggering the constraint update</h4><p>The solution is pretty simple, when we initialize the constraint class we create an MD5 hash against the @domains object and then store it. Since I already use Redis to store some data I decided to use it here (Redis is a nice store engine for speed and reliability), but you could store this hash wherever you want.</p><p>Then in my Model callback I “invalidate” this value, then when the next <em>matches?</em> method is called for each process, the <strong>@domains object regeneration is triggered</strong>.</p><p>The code below will make it easier to understand:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5d7ddbf44ed1d374f7c6db3ca28d68e/href">https://medium.com/media/e5d7ddbf44ed1d374f7c6db3ca28d68e/href</a></iframe><p>Now <strong>my Routes constraint is truly dynamic and I don’t have to reload the whole Routes</strong> neither do I have to take care of ruby processes.</p><h4>The final version</h4><p>Finally I added some security to my Routes constraints by restricting some domains and subdomains and added other stuff that you can read by yourself below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95b44eac727241c70694bbaff323999d/href">https://medium.com/media/95b44eac727241c70694bbaff323999d/href</a></iframe><p><em>If you liked this article please consider clicking the ❤️ below so more people could read it, thank you!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ab1040dc8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mythoughts-io/managing-dynamic-domains-with-rails-b6ab1040dc8c">Managing dynamic domains with Rails</a> was originally published in <a href="https://medium.com/mythoughts-io">mythoughts.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>