<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CarmaBlog</title>
	<atom:link href="https://blog.fabianpiau.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.fabianpiau.com/en/</link>
	<description>Agility, Java programming, New technologies and more...</description>
	<lastBuildDate>Mon, 30 Dec 2024 14:34:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/2017/02/cup-rss-original-512.png?fit=32%2C32&#038;ssl=1</url>
	<title>CarmaBlog</title>
	<link>https://blog.fabianpiau.com/en/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">175576829</site>	<item>
		<title>How to write a blog post? At least my way!</title>
		<link>https://blog.fabianpiau.com/en/2022/12/05/how-to-write-a-blog-post-at-least-my-way/</link>
					<comments>https://blog.fabianpiau.com/en/2022/12/05/how-to-write-a-blog-post-at-least-my-way/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 05 Dec 2022 22:28:26 +0000</pubDate>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[sharing]]></category>
		<category><![CDATA[society]]></category>
		<category><![CDATA[write]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5264</guid>

					<description><![CDATA[<p>&#160;Version française disponible How to write a blog post? I have received a few messages from different readers asking me around this topic. How do I find ideas? How do I clear my thoughts before writing? Do I follow a particular process? Do I have any advice that I could share with someone that would [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2022/12/05/how-to-write-a-blog-post-at-least-my-way/">How to write a blog post? At least my way!</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2014/01/09/list-favourite-android-apps/" rel="bookmark" title="List of my favourite Android apps">List of my favourite Android apps</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/09/03/windows-7-test/" rel="bookmark" title="Windows 7 test">Windows 7 test</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/11/11/do-you-need-a-good-cover-for-this-winter-eclemma/" rel="bookmark" title="EclEmma &#8211; Do you need a good cover for this winter ?">EclEmma &#8211; Do you need a good cover for this winter ?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2022/12/05/how-to-write-a-blog-post-at-least-my-way" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>How to write a blog post? I have received a few messages from different readers asking me around this topic. </p>
<ul>
<li>How do I find ideas?</li>
<li>How do I clear my thoughts before writing?</li>
<li>Do I follow a particular process?</li>
<li>Do I have any advice that I could share with someone that would like to start blogging?</li>
</ul>
<p>I still remember the day I started this blog, nearly 13 years ago (as I am writing this, I am realising how prehistoric this sounds). At that time, I had this goal of posting once a month on various technical related topics whatever the idea was originating from, either from work or from personal projects. If it worked pretty well at start, lately, let&#8217;s face it, it does not work that well. I feel almost ashamed when I look at the date of the last (previous) article, more than a year ago, this is by far the longest period of inactivity on my blog!</p>
<p>Today, I have decided I will be writing on this particular topic, not only because I have been asked a few times but also because this article represents a milestone. Indeed this is my 100th article so I wanted to write on something slightly different than usual and this feels like the perfect topic.</p>
<p class="center"><img data-recalc-dims="1" fetchpriority="high" decoding="async" title="Photo Write Article Laptop" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00099/write-article-laptop-shadow.png?resize=568%2C303&#038;ssl=1" alt="Photo Write Article Laptop" width="568" height="303" /></p>
<p>To be honest, when it&#8217;s not part of your full-time job, it takes a fair amount of time and dedication to write articles, and I don&#8217;t think there is a magical recipe. Everyone&#8217;s mindset works differently, and what can work for me could have the opposite effect on you. In this article, I will try to describe the recipe that works for me. I have applied it to write this article so you will be the best to judge.</p>
<p><br clear="none" /></p>
<h4>Idea</h4>
<p>It all starts with an idea (it sounds like a movie trailer I know but it&#8217;s true). An idea is a single sentence, no more than a set of keywords, that represents a particular topic, not too specific but not too broad. It can come up while working, while doing tech-related things on my personal computer, while walking, while showering, there is no limit. An idea will usually come up a while before you start to write any content on it, but it&#8217;s not always true, and you could find an idea you will be passionate about to write an article in the next hour.</p>
<p>I keep all my ideas as an unordered bulleted list in a note file on my computer. To give you an idea (yes it was an easy joke sorry), I currently have 9 ideas in this list.</p>
<p>Thorough the year, I have this pool of ideas that I can pick up from. As I mentioned previously, there are no rules when picking up an idea, sometimes I write an article on an idea that I just added to the pool (this article is one of them), sometimes I write an article on an idea that I added 3 years ago. Most of the ideas I have now will probably never be transformed into an article, so that&#8217;s normal to discard quite a lot of them over time for various reasons, e.g. if the idea is:</p>
<ul>
<li>not good enough to make an interesting post ;</li>
<li>not aligned with the content of my blog, i.e. targeting the wrong audience ;</li>
<li>about a very niche topic ;</li>
<li>or, on the opposite, many bloggers already got it covered.</li>
</ul>
<p><br clear="none" /></p>
<h4>Raw Content</h4>
<p>Once I have selected the idea, I find 1 or 2 hours and I start writing. I need some focused time to do this part with as little break as possible. I am talking about writing pure content, a really drafted and raw version of the content, everything I could think of about the idea that I want to talk about, it can be in the form of full sentences, bulleted lists, a few raw links or textual description of the images and diagrams I would like to include, etc.</p>
<p>It depends on the idea, but if it&#8217;s a very technical one, I may also do some preparation beforehand and use some notes that I took previously, e.g. it can be a couple of lines of code or other coding examples that I want to include. I can also do some extra bit of research on the Internet to know what is there already, and if there is anything else I did not think of. It&#8217;s not a bad thing to get some inspiration from other sources, of course as long as you are not paraphrasing or doing any form of plagiarism!</p>
<p>At this stage, I am not paying attention to spelling, typos and other grammatical mistakes, I am literally writing what comes to my mind and that I would not want to miss out. I also use a simple text editor rather than using the online blog editor to avoid any distraction.</p>
<p>You may not be affected by this, but since my blog is bilingual, available in French and English, I also need to decide in which language I want to write first. In my opinion, it does not make sense to do both languages in parallel, and I prefer to focus on one at a time leaving the translation at the end. Most of the time, I end up writing in English first even if French is my mother tongue. The main reason is because I could write too many complex sentences in French that won&#8217;t be easily translatable into English, another reason is the fact I am working in technology in an English environment so English feels simply more natural (I really never think I would write that one day!).</p>
<p><br clear="none" /></p>
<h4>Review, Improve, Polish, Repeat</h4>
<p>Now that I got the idea and all the associated information I want to expose and shed light on, you would think I am pretty much at 60% of the writing process. Unfortunately, this is far from that, and realistically I would say I did about 30%.</p>
<p>This is when an iterative, slightly tedious, reviewing &#038; improving process starts. It&#8217;s the longest part of writing an article, this is when I think about the structure of the article. I reorganise my thoughts in a logical way so the content will be easy to read and follow by my readers. The return lines, paragraphs, sections, titles and subtitles will naturally appear at that review stage. It&#8217;s totally fine to remove some text if you realise it doesn&#8217;t fit with the rest, or elaborate on some section if some details were missed, or even rewrite entire paragraphs.</p>
<p>It&#8217;s important to adapt the tone of voice and keep it consistent across all your articles. If it&#8217;s your own blog, it&#8217;s something you won&#8217;t even think of, but imagine you are writing an article in a scientific blog that has multiple authors, writing a joke is probably the last thing you would want to do&#8230;</p>
<p>Note that I stop using a simple text editor in favour of the online blog editor, so I can use the preview mode and see the final rendering of the article.  This is important as this part is not focusing on the text only, but I also think about the images I would like to integrate, the links I would like to include and the formatting I would like to apply.</p>
<p><br clear="none" /></p>
<p><strong>Visuals</strong></p>
<p>When adding images, don&#8217;t overdo it. Adding an image for each section will impact the network bandwidth and cause some distraction to your readers. In most cases, an image at the top of the article will be enough.</p>
<p>To look for the perfect image and if you are not satisfied with your own photos, you could be tempted to use Google Images, but there are other resources available, they will also help you to avoid any form of copyright infringement.</p>
<ul>
<li><a href="https://unsplash.com/" target="_blank" title="Unsplash" rel="noopener noreferrer">Unsplash</a></li>
<li><a href="https://www.pexels.com/" target="_blank" title="Pexels" rel="noopener noreferrer">Pexels</a></li>
<li><a href="https://thenounproject.com/" target="_blank" title="TITRE" rel="noopener noreferrer">The Noun Project</a></li>
</ul>
<p>You may need to create a diagram or a schema. I personally use PowerPoint, it may not be the best tool out there but it has a rendering that I like and I am very familiar with Office. In case I need to generate a more technical diagram, I also use <a href="https://plantuml.com/" target="_blank" title="PlantUML" rel="noopener noreferrer">PlantUML</a>. It will really depend on what you are writing on and your field of expertise, in short, choose the tool you prefer!</p>
<p><br clear="none" /></p>
<p><strong>Links</strong></p>
<p>When adding links, don&#8217;t overdo it. Linking is the fundamental tool to navigate the Internet, it helps referencing every websites including your own, but adding many links will be distracting and your reader may end up thinking you are advertising rather than providing accurate information.</p>
<p>When adding links, ensure they all have a purpose. Do they help the reader to have more context? Do they let the reader access a tool that you have mentioned? And it&#8217;s very important to label your link properly and not use the typical &#8220;click here&#8221; that does not carry any context. </p>
<p>On the other end of the spectrum, it&#8217;s fine if your article does not contain any link or only a few. However, I would suggest to have a section at the bottom of the article with a list of useful links. This can be for reference (also a nice way to thank the authors you may have got some inspiration from) but this can also be useful if the reader wants to carry on more reading on the topic.</p>
<p><br clear="none" /></p>
<p><strong>Formatting</strong></p>
<p>When adding formatting, don&#8217;t overdo it. Consistency and simplicity are key concepts. </p>
<p>You can use multiple levels to differentiate main titles and subtitles in your article. I personally limit myself to 2 levels maximum. If you need more, maybe your article is too complex and you may want to break it down into a series of articles instead.</p>
<p>In general, you should space your text and avoid long and complex sentences. Use bulleted lists where it makes sense, not everywhere.</p>
<p>Some minor text formatting like bold and italic can be useful. </p>
<ul>
<li>Bold can emphasise an idea and grab the reader&#8217;s attention.</li>
<li>Italic can be used to introduce a technical term or when quoting a text.</li>
</ul>
<p><br clear="none" /></p>
<h4>Last Review</h4>
<p>At this stage, it&#8217;s important to use the preview mode of your blog editor, so you can check that there are no broken links, the images are rendered properly at the right place with the right dimensions, the formatting and spacing is working as expected, etc.</p>
<p>I have to admit I am using some help from Word for my spelling and grammar, what I do is copy the full content to a Word document, and then impact the potential suggested fixes back into the article. A more sophisticated tool like <a href="https://www.grammarly.com/" target="_blank" title="Grammarly" rel="noopener noreferrer">Grammarly</a> or <a href="https://www.antidote.info/" target="_blank" title="Antidote" rel="noopener noreferrer">Antidote</a> can also be a great help, and they integrate directly into your browser so you don&#8217;t need to transfer the content to an external tool.</p>
<p>If you know someone willing to help reviewing your article, it could be a colleague, a friend or a family member, ask them! It&#8217;s always good to have another pair of eyes on your work. Personally, I skip that step and do my own review. But not doing it can be slightly risky, especially if you are posting on behalf of your company for instance. I am pretty sure I have many articles published with typos, this is especially true in the English version of my old articles (hopefully my English is better now). Again, that is not the end of the world, that happens on an individual blog, you already took some time to write and share your knowledge, and your reader won&#8217;t judge you for that.</p>
<p>As the title suggests, this is a last review, so don&#8217;t review over and over. I know it can be tempting to improve your text again. I think it can be better like that. I think I went into too much details in this part and not enough in that part. The wording is not great here. What if I use this sentence instead? Let&#8217;s be honest, there is little chance that you will be fully satisfied.</p>
<p>Since you have already spent hours on your article, it&#8217;s time to let it go and click that publish button! Ah, last but not least, don&#8217;t forget to find a good title, it needs to be short, catchy and convey the main idea of your article.</p>
<p><br clear="none" /></p>
<h4>Optional Translation</h4>
<p>In my case, I am not done and I can&#8217;t publish just yet. I also need to translate the article into French before. </p>
<p>Although French is my mother tongue, I take some shortcut to speed up the translation process and I use Google Translate. So I can start from a text already translated that I can review, and potentially reformulate a few sentences here and there. The automatic translation is not perfect, but I have to say that it is pretty good, I would say that about 70% of the content is usually left untouched or with minor changes.</p>
<p>Unless I have to recreate some diagrams in French, the translation is probably the quickest part to do, since I keep the same images, text and formatting, and French is obviously easier for me&#8230;</p>
<p class="center"><img data-recalc-dims="1" decoding="async" title="Process write article" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00099/write-article-process-en.png?w=568&#038;ssl=1" alt="Process write article"  /></p>
<p><br clear="none" /></p>
<p>Happy blogging!</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2022/12/05/how-to-write-a-blog-post-at-least-my-way/">How to write a blog post? At least my way!</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2014/01/09/list-favourite-android-apps/" rel="bookmark" title="List of my favourite Android apps">List of my favourite Android apps</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/09/03/windows-7-test/" rel="bookmark" title="Windows 7 test">Windows 7 test</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/11/11/do-you-need-a-good-cover-for-this-winter-eclemma/" rel="bookmark" title="EclEmma &#8211; Do you need a good cover for this winter ?">EclEmma &#8211; Do you need a good cover for this winter ?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2022/12/05/how-to-write-a-blog-post-at-least-my-way/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5264</post-id>	</item>
		<item>
		<title>Bot Attacks: You are not alone&#8230;</title>
		<link>https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/</link>
					<comments>https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Tue, 20 Apr 2021 15:42:31 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[incident management]]></category>
		<category><![CDATA[bot]]></category>
		<category><![CDATA[bots]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5179</guid>

					<description><![CDATA[<p>&#160;Version française disponible Note I originally published this article on the Medium Expedia Group technology blog: Bot Attacks: You are not alone&#8230; In a recent article, Security Magazine stated that 1.3 billion bot attacks were detected in Q3 2020. It&#8217;s not a surprise. We are not alone. You are not alone. Last year, the Opex [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/">Bot Attacks: You are not alone&#8230;</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-related-none yarpp-template-list'>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2021/04/20/bot-attacks-you-are-not-alone/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Note</strong><br />
I originally published this article on the Medium Expedia Group technology blog: <a href="https://medium.com/expedia-group-tech/bot-attacks-you-are-not-alone-d8b3290342bd" target="_blank" title="Bot Attacks: You are not alone..." rel="noopener noreferrer">Bot Attacks: You are not alone&#8230;</a>
</div>
<p>In a recent article, Security Magazine stated that <a href="https://www.securitymagazine.com/articles/93920-3-billion-bot-attacks-were-detected-in-q3-of-2020" target="_blank" title="1.3 billion bot attacks were detected in Q3 of 2020" rel="noopener noreferrer">1.3 billion bot attacks were detected in Q3 2020</a>. It&#8217;s not a surprise. We are not alone. You are not alone.</p>
<p>Last year, the Opex Excellence team at Expedia Group did a review of the incidents in production that impacted the Hotels.com website. We covered a 12-month period, and <strong>bot attacks</strong> are one of the most important threats we identified.</p>
<blockquote><p>Anything that can go wrong will go wrong — Murphy&#8217;s law</p></blockquote>
<p>In this article, I will define and explain what bots and bot attacks are. I hope it will help you in building up some knowledge and getting a better understanding of the threat your website could be facing, so you can come up with a set of strategies and solutions to prevent and mitigate a future bot attack.</p>
<blockquote><p>Know the enemy and know yourself, in a hundred battles you will never be in peril — Sun Tzu, The Art of War</p></blockquote>
<p class="center"><img data-recalc-dims="1" decoding="async" title="Bots - Photo by Eric Krull on Unsplash" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00098/bots-banner.png?resize=550%2C246&#038;ssl=1" alt="Bots - Photo by Eric Krull on Unsplash" width="550" height="246" /></p>
<h3>What are bot attacks?</h3>
<p>The first type of bot attack that usually comes to mind are <strong>Denial Of Service</strong> attacks (DoS) or DDoS (when it&#8217;s distributed). A DDoS attack usually impacts the whole website, with failures happening in cascade, making it unavailable. The attacker sends a large number of requests (e.g. perform multiple GET/POST on random URLs) in order to overload the underlying services so much that they cannot handle the traffic anymore. Services will start to respond to requests with timeout or error responses. This obviously also affects the requests originating from legitimate customers — customers that are trying to book their hotel stay, in our case.</p>
<p>Another type of attack, slightly more targeted, are <strong>Scraping</strong> attacks. A crawler bot can look into various pages in order to extract specific pieces of information. This is also known as Data scraping. They usually target your inventory data, e.g. all the properties details and contact information, or pricing details for specific dates. Sometimes it could even be the whole contents of some pages of your website, in order to replicate them and prepare a phishing attack.</p>
<blockquote><p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2139.png" alt="ℹ" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Ideally, the attacker does not want to be seen while scraping a website and will try to span the attack over multiple days to avoid a surge in the traffic that may trigger some alert and investigation on your side. Unless the attack is sophisticated and coming from different machines, you can usually figure out that the website is being scraped when you start to see an abnormal number of requests coming from the same IP address (or range of IPs) at the Edge level. I will give more details about the Edge level in the next part.</p></blockquote>
<p><br clear="none" /></p>
<p>If DoS and Scraping attacks are quite <strong>general</strong> in scope, in the sense they are targeting various pages across the website, we also see attacks against <strong>specific</strong> pages.</p>
<p>Specialized attacks are much more narrow in scope, and they usually target a specific page or feature of your website. Below are a few real cases that we have been faced with:</p>
<ul>
<li>An attack on the Booking page, when the attacker tries to break the coupon field by generating and trying multiple codes, hoping there is an exploitable pattern to the codes. This is using brute force.</li>
<li>An attack on the Sign in page, when the attacker tries multiple login and password combinations. The idea is to get access to user accounts and confidential data, or what we call Account Take Over (ATO). This is also using brute force.</li>
<li>An attack on the Mobile App page, when the attacker tries to send large numbers of SMS to random or fake phone numbers. It is quite typical nowadays to prompt users to download an app to their mobile device by sending an SMS with the link to the app on the store. The targeted website will end up paying money as messaging service is usually handled by a third party vendor and each SMS sent has a cost.</li>
</ul>
<p>General or specific, an attack can be basic or sophisticated. An example of a <strong>basic attack</strong> is someone trying desperately to find a discount code firing dozen of requests to a coupon service. Basic attacks are difficult to spot but easy to block: you can block the IP address with a WAF (Web Application Firewall) rule. They also have a low risk profile.</p>
<p>On the other hand, with <strong>sophisticated attacks</strong>, they can be distributed and spanned over thousands of machines located in different countries and using advanced scripting technologies, like headless browser. The level of impact and risk is much higher but they are obviously easier to spot when associated with a traffic surge.</p>
<p class="center"><img data-recalc-dims="1" decoding="async" title="Bot attack risk matrix" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00098/bot-attack-risk-matrix-en.png?resize=550%2C454&#038;ssl=1" alt="Bot attack risk matrix" width="550" height="454" /></p>
<h3>Should we block every bot?</h3>
<p>Definitely not! Not all bots are evil; some are even beneficial to us.</p>
<ul>
<li>There are the <strong>Spider bots</strong> (or Crawlers) from popular search engines like Google Search or Microsoft Bing. If we block those, the indexing of the website will be badly impacted, the legitimate traffic will degrade over time, and the website popularity will go down.</li>
<li>There are also the <strong>Commercial bots</strong> (e.g. Google AdSense bot), to provide personalized ads to the users, including the ads for our own website.</li>
<li>There are the <strong>Data bots</strong> like content aggregators and feeds, and there is also the <a href="https://archive.org/web/" target="_blank" title="Archive bot" rel="noopener noreferrer">Archive bot</a> that is building the biggest internet Archive.</li>
<li>There are the <strong>Copyright bots</strong>, that look for plagiarism or intellectual property theft. You may have faced one of them if you&#8217;ve tried to upload a video on YouTube with your favourite music in background. You certainly quickly realize Google took it down, reminding you politely that you cannot use any protected material.</li>
<li>There are also the <strong>Monitoring bots</strong> to make sure your website is healthy, and raise some alert in case it&#8217;s not. For example, Akamai, Datadog, and so on use bots to make sure your site is responding properly.</li>
</ul>
<blockquote><p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2139.png" alt="ℹ" class="wp-smiley" style="height: 1em; max-height: 1em;" /> You should not block any of these bots because they are not bad, and usually they are not aggressive, plus they contribute to the Internet. If you feel your legitimate traffic is suffering from them, then instead of blocking, it&#8217;s best to have a tarpitting or rate limiting strategy in place to mitigate their impact. More details about this in the next part about the Edge level.</p></blockquote>
<p>If all these bots are third party, sometimes you can have your own. In our case, an <strong>internal bot</strong> is regularly checking our landing pages to make sure there are no dead links or unnecessary redirections. So we definitely don&#8217;t want to block it!</p>
<h3>What can we do?</h3>
<p>We can prevent attacks at the <strong>Edge level</strong> and mitigate them at the <strong>Application level</strong>.</p>
<p class="center"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Edge and Application levels" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00098/edge-application-levels.png?resize=550%2C374&#038;ssl=1" alt="Edge and Application levels" width="550" height="374" /></p>
<h4>Use of <em>robots.txt</em></h4>
<p>The first thing that comes to mind when dealing with bots is the <em>robots.txt</em> file. Every website has it and it has been there for ages. This is a text file accessible publicly at the root of your website. It specifies the rules for any bots accessing your site. These rules define which pages the bots can and can&#8217;t crawl, and which links they should and shouldn&#8217;t follow.</p>
<p>Good bots will follow these rules. For instance, if a website owner doesn&#8217;t want a certain page on their site to show up in Google search results, they can write a rule for it, and Google web crawler bots won&#8217;t index that page. Although the <em>robots.txt</em> file cannot actually enforce these rules, good bots are programmed to look for that file and follow the rules before they do anything else. It&#8217;s based on a code of honor.</p>
<p>Malicious and bad bots will obviously not follow any of your rules. On the opposite, they will often read it to learn what content a website is trying to keep off-limits from them, then access that content. Thus, managing bots requires a more active approach than simply defining the rules for bot behavior in the <em>robots.txt</em> file. This is what we are going to see in the next part.</p>
<blockquote><p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2139.png" alt="ℹ" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The <em>robots.txt</em> file can also be used to set up a &#8216;honeypot&#8217;. A honeypot is a fake target for bad actors that, when accessed, exposes the bad actor as malicious. In the case of a bot, a honeypot could be a page on the site that&#8217;s forbidden to bots by the <em>robots.txt</em> file. Good bots will read the <em>robots.txt</em> file and avoid that page, some bad bots will crawl the page. By tracking the information of the bots that access the honeypot, bad bots can be identified and blocked. Source: <a href="https://www.cloudflare.com/en-gb/learning/bots/what-is-bot-management/" target="_blank" title="What is bot management by Cloudflare" rel="noopener noreferrer">Cloudflare</a></p></blockquote>
<p><br clear="none" /></p>
<h4>Advanced Bot Management</h4>
<p>The main shield against bad bots is Bot Management at the Edge level. This is much more advanced than the <em>robots.txt</em> file. I took this list from <a href="https://www.cloudflare.com/en-gb/learning/bots/what-is-bot-management/" target="_blank" title="What is bot management by Cloudflare" rel="noopener noreferrer">Cloudflare</a> but it will be a similar set of features for any other Edge tool:</p>
<ul>
<li>Identify bots vs. human visitors (using behavioral analysis and potentially machine learning)</li>
<li>Identify bot reputation</li>
<li>Identify bot origin IP addresses and block based on IP reputation</li>
<li>Analyze bot behavior</li>
<li>Add good bots to allowlists</li>
<li>Add bad bots to blocklists</li>
<li>Challenge potential bots via a CAPTCHA test, JavaScript injection, or other methods</li>
<li>Rate limit any potential bot over-using a service</li>
<li>Tarpit recognized bot requests (see definition below)</li>
<li>Deny access to certain content or resources for bad bots</li>
<li>Serve alternative/cached content to bots</li>
</ul>
<blockquote><p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2139.png" alt="ℹ" class="wp-smiley" style="height: 1em; max-height: 1em;" /> &#8216;Tarpitting&#8217; is an interesting feature. It means to add an artificial delay to the request. It is usually much better than blocking because the bot won&#8217;t know it has been discovered, but the attack will slow down significantly as fewer requests will reach the Application level, as they could time out at the Edge level. Rate limiting can also be another good strategy you may want to look at.</p></blockquote>
<p>When deciding about an Advanced Bot manager, you can use a popular third party provider like <a href="https://www.akamai.com/uk/en/products/security/bot-manager.jsp" target="_blank" title="Bot manager by Akamai" rel="noopener noreferrer">Akamai</a> or <a href="https://www.cloudflare.com/products/bot-management/" target="_blank" title="Bot management by Cloudflare" rel="noopener noreferrer">Cloudflare</a>.</p>
<p><strong>Pros</strong></p>
<ul>
<li>No impact on the application code.</li>
<li>A bot rule is relatively quick to deploy with immediate effect.</li>
</ul>
<p><strong>Cons</strong></p>
<ul>
<li>Most of the cons lie in the fact they are third party.</li>
<li>There is a license cost.</li>
<li>Bot rules can only be defined against generic and non business parameters like user agent, IP, endpoint, etc.</li>
<li>They sometimes involve a heavy approval process, e.g. adding a new rule will require people outside of the company plus internal people with special authorization.</li>
<li>A new rule can have side effects. Unless blocking a unique IP address, it&#8217;s very hard to be sure it won&#8217;t prevent some legitimate traffic from getting in.</li>
<li>The maintenance of the rules can be cumbersome over time.</li>
<li>Partial access and visibility for application teams.</li>
</ul>
<p>Most of the disadvantages can be mitigated if you are using your own in-house Edge tool. This is particularly interesting when used in addition to a third party Edge tool. It&#8217;s obviously not something every company can invest in, but it will give you much more flexibility.</p>
<ul>
<li>Ability to set rules related to your business.</li>
<li>Ability to add some one-off temporary rule to mitigate an attack that you can delete shortly after the attacks passed.</li>
<li>Ability to centralize the Edge monitoring and make the information available to every team.</li>
</ul>
<p><br clear="none" /></p>
<h4>Traffic prioritization</h4>
<p>The idea here is not about replacing your main Edge tool but to add some bot logic after it. In a nutshell, such a tool will act as a prioritization queue so <strong>low value bot requests are deprioritized</strong> in favor of real user requests that have higher business value, e.g. ending up with potential booking in our case.</p>
<blockquote><p>User requests > Internal bot requests > External good bot requests</p></blockquote>
<blockquote><p><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2139.png" alt="ℹ" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Netflix is applying some similar concepts that you can read in <a href="https://netflixtechblog.com/keeping-netflix-reliable-using-prioritized-load-shedding-6cc827b02f94" target="_blank" title="Keeping Netflix Reliable Using Prioritized Load Shedding" rel="noopener noreferrer">Keeping Netflix Reliable Using Prioritized Load Shedding</a>.</p></blockquote>
<p><br clear="none" /></p>
<h4>Caching</h4>
<p>We talked about Bot Management but there is something else that the Edge layer can provide for you, and that is the ability to cache content. We usually refer this to a Content Delivery Network (CDN). The idea is to <strong>serve cached pages to good bots rather than generate fresh pages</strong>.</p>
<p>We did a Proof of Concept last year and it significantly decreased the traffic to our Landing services without affecting the SEO of the website. This year, we are looking at generalizing this approach.</p>
<p><br clear="none" /></p>
<h4>Mitigating at the Application level</h4>
<p>Managing bots at the application level means that a bot attack was able to pass through the higher level of protection on the Edge.</p>
<p>The solutions we have at this level are only <strong>mitigation solutions</strong> in order to be proactive and reduce the burden of an attack.</p>
<p>On a sad note, we know it&#8217;s going to happen, and even multiple times, so we need to prepare for it. On a brighter note, what we know is that bot attacks do not last forever. A sophisticated attack costs a significant amount of resources for the attacker, and as resources cost money. As long as we make the attacker spend more value than it is getting, we are certain the attack will be stopped eventually as a bad investment.</p>
<p>There are different actions we can do and most of them are good practices.</p>
<ul>
<li>First is when <strong>coding</strong> the application logic, we can avoid high complexity code, blocking threads, and so on. A good idea is to separate application and management ports. If you use the same port, in case of a bot attack the service will be so overloaded that it won&#8217;t be able to respond to health checks and your infrastructure platform will flag it as unhealthy. Even if it does not solve all your issues, having a separate port can mitigate this.</li>
<li>Having a <strong>chaos mindset</strong> is important. For critical services, make sure you have <strong>load and stress testing</strong> in place in your pipeline. This is to ensure your services are resilient enough, and that you have identified potential memory leaks in your code and bottlenecks reaching downstream services or data sources. In case something goes wrong, you still want to serve a degraded response to mitigate the impact to the customer. You could also have some caching mechanism in place.</li>
<li>Make sure you <strong>leverage your infrastructure</strong>. If you use Kubernetes, you can take a look at <strong>auto-scaling</strong>. Be vigilant when enabling it. Ensure the configuration is well thought out and in line with your dependencies. Setting up a high number of pods and consider it as done will be a mistake, as you will also share the load with your downstream dependencies and, if they are not prepared for it, you will basically shift the bottleneck deeper in the stack without solving it. It may also cost you more money, if your infrastructure is hosted on a Cloud provider like AWS. Also make sure your pods are ready to take traffic once they are exposed to the attack. A <strong>warm up routine</strong> like <a href="https://opensource.expediagroup.com/mittens/" target="_blank" title="Mittens" rel="noopener noreferrer">Mittens</a> will support you, especially for applications that are slow to start up.</li>
</ul>
<p>There are also other strategies at the application level that are not related to configuration and infrastructure. Some mimic a bot management solution at the Edge level:</p>
<ul>
<li>Captcha mechanism. A common way is to display a captcha to the user if there are too many attempts, or to target account-related attacks.</li>
<li>Authentication mechanism. If your APIs are public, you may want to add some authentication, from &#8216;Basic Auth&#8217; to &#8216;CSRF Token&#8217;. But you should be aware it will add some complexity to your system, and you have to balance it with the information your API provides, e.g. ask yourself if the content exposed is sensitive enough.</li>
<li>Caching, Blocking, and Rate limiting mechanism. This may be quite complex to achieve and maintain, especially in a micro-service architecture, but I prefer to mention it because it could be a potential solution if you don&#8217;t have any Edge tool or if you are working on a monolithic app.</li>
</ul>
<p><br clear="none" /></p>
<h4>Observability, Monitoring and Alerting</h4>
<p>Last but not least, it&#8217;s very important that you have proper observability in place. Any bot attacks that start to get heavy and put high pressure on your system should trigger a set of alerts automatically.</p>
<p><strong>At the Edge level:</strong></p>
<ul>
<li>Alert on the bot rules when a rule created recently is blocking too much traffic or, on the opposite, when a rule has not blocked any traffic for the last &#8216;n&#8217; months and can be reviewed for potential deletion.</li>
<li>Alert when the bot traffic (good or bad) is much higher than usual.</li>
</ul>
<p><strong>At the Application and Infrastructure level:</strong></p>
<ul>
<li>Alert on auto-scaling and number of instances. E.g. when Kubernetes is spinning up 5 new pods in the last 5 minutes and it&#8217;s not Black Friday, there is probably something fishy&#8230;</li>
<li>Alert on response time and status when the service starts to respond slowly and/or with errors. I recommend you to read <a href="https://medium.com/expedia-group-tech/creating-monitoring-dashboards-1f3fbe0ae1ac" target="_blank" title="Creating Monitoring Dashboards" rel="noopener noreferrer">Creating Monitoring Dashboards</a>, which covers all you need to know about monitoring.</li>
<li>You can also set up some alerts at the log levels. This can be useful if you are missing some metrics in your application, and in case you are using an advanced log management tool like Splunk.</li>
</ul>
<h3>The last word</h3>
<p>I hope this article was useful and you now have better knowledge of bots and bot attacks.</p>
<p>I did not discuss any silver bullet tool here, because there is no such thing as a single, perfect anti-bot tool for everyone. But there is always room for improvement to prevent and mitigate bot attacks.</p>
<p>Ah&#8230; And good luck for the next one! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f44b.png" alt="👋" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f916.png" alt="🤖" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The article <a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/">Bot Attacks: You are not alone&#8230;</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-related-none yarpp-template-list'>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5179</post-id>	</item>
		<item>
		<title>Flagger &#8211; Monitor your Canary deployments with Grafana</title>
		<link>https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/</link>
					<comments>https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sun, 28 Jun 2020 17:07:44 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[flagger]]></category>
		<category><![CDATA[grafana]]></category>
		<category><![CDATA[helm]]></category>
		<category><![CDATA[istio]]></category>
		<category><![CDATA[kubernetes]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5137</guid>

					<description><![CDATA[<p>&#160;Version française disponible Update October, 17th, 2020 : Use newer versions (Helm 3, Kube 18, Istio 1.7, Flagger 1.2). This is the third article in our series dedicated to Flagger. In a nutshell, Flagger is a progressive delivery tool that automates the release process for applications running on Kubernetes. It reduces the risk of introducing [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/">Flagger &#8211; Monitor your Canary deployments with Grafana</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" rel="bookmark" title="Flagger &#8211; Get Started with Istio and Kubernetes">Flagger &#8211; Get Started with Istio and Kubernetes</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Update</strong><br />
<strong>October, 17th, 2020 : </strong> Use newer versions (Helm 3, Kube 18, Istio 1.7, Flagger 1.2).
</div>
<p class="left" style="padding-right:15px;"><a href="https://flagger.app/" target="_blank" title="Flagger logo" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Flagger logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/flagger-logo.png?resize=180%2C180&#038;ssl=1" alt="Flagger logo" width="180" height="180" /></a></p>
<p>This is the third article in our series dedicated to <a href="https://flagger.app/" target="_blank" title="Flagger" rel="noopener noreferrer">Flagger</a>. In a nutshell, Flagger is a progressive delivery tool that automates the release process for applications running on Kubernetes. It reduces the risk of introducing a new software version in production by gradually shifting traffic to the new version while measuring metrics and running conformance tests.</p>
<p>Make sure you have a local Kubernetes cluster running with the service mesh Istio. If you don&#8217;t, read <a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" title="Flagger – Get Started with Istio and Kubernetes">the first article: Flagger – Get Started with Istio and Kubernetes</a>. You also need to be familiar with Flagger and MHS, you will find all details in <a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" title="Flagger - Canary deployments on Kubernetes">the second article: Flagger &#8211; Canary deployments on Kubernetes</a>.</p>
<p>In this third guide, we will focus on the installation of Grafana for Flagger and how you can monitor your Canary deployments without having to use Kubernetes (i.e. Kube dashboard or <code>kubectl</code> command line tool).</p>
<div class="info"><strong class="label">Note</strong><br />
This is a hands-on guide and can be followed step by step on MacOS. It will require some adjustments if you are using a Windows or Linux PC. It is important to note that this article will not go into details and only grasp the concepts &#038; technologies so if you are not familiar with Docker, Kubernetes, Helm or Istio, I strongly advise you to check some documentation yourself before continuing reading.
</div>
<p><br clear="none" /></p>
<h4>Installing Grafana</h4>
<p>Flagger provides a Grafana dashboard out of the box to monitor all the canary deployments inside your cluster.</p>
<p>Let&#8217;s install Grafana in the namespace <code>istio-system</code> with a single command:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> upgrade -i flagger-grafana flagger/grafana \<br />--namespace=istio-system \<br />--set url=http://prometheus:9090 \<br />--set user=admin \<br />--set password=changeme<br /></div>

<blockquote><p>
Reference: <a href="https://docs.flagger.app/usage/monitoring" target="_blank" title="Flagger monitoring" rel="noopener noreferrer">Flagger monitoring</a><br />
Flagger depends on Istio telemetry and Prometheus (I&#8217;ve assumed Istio is installed in the <code>istio-system</code> namespace).
</p></blockquote>
<p>After a few seconds, you should get a message confirming that Grafana for Flagger has been installed. From the Kubernetes dashboard, verify that the Flagger Grafana pod is running in <code>istio-system</code>.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/flagger-grafana-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5137];player=img;" title="Grafana for Flagger is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/flagger-grafana-deployed-new-thumbnail.png?resize=550%2C315&#038;ssl=1" alt="Grafana for Flagger is deployed in your cluster" title="Grafana for Flagger is deployed in your cluster" width="550" height="315" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Grafana for Flagger is deployed in your cluster</p></div>
<p>To expose Grafana, run:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n istio-system port-forward svc/flagger-grafana 3000:80<br /></div>

<p>So you can access it with your browser at <a href="http://localhost:3000/d/flagger-istio/istio-canary" target="_blank" title="Grafana Dashboard" rel="noopener noreferrer">http://localhost:3000/d/flagger-istio/istio-canary</a>. Use the login and password you specified before (<code>admin</code> / <code>changeme</code>).</p>
<blockquote><p>
Note that as we use Istio, we use the Istio Canary dashboard. Flagger is compatible with other service meshes and there are other dashboards available.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Running the canary deployments</h4>
<p>If you have followed the previous article, make sure you select <code>application</code> for the Namespace and associate <code>mhs-primary</code> to Primary and <code>mhs</code> to Canary.</p>
<p>Then try again the <a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" title="Flagger - Canary deployments on Kubernetes">different experiments we did in the previous article</a> and monitor the Grafana dashboard at the same time, especially:</p>
<ul>
<li>Experiment 1 &#8211; MHS v1.1.2 successful deployment</li>
<li>Experiment 2 &#8211; MHS v1.1.3 faulty deployment</li>
</ul>
<p><br clear="none" /></p>
<h4>Results</h4>
<p>Look at this screenshot I took during Experiment 1 when the canary release was successful and the new version rolled out. I annotated it and added explanations, so it&#8217;s easier to understand the graphs.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/canary-success-en.png?ssl=1" rel="shadowbox[sbpost-5137];player=img;" title="A successful Canary deployment"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/canary-success-en-thumbnail.png?resize=550%2C698&#038;ssl=1" alt="A successful Canary deployment" title="A successful Canary deployment" width="550" height="698" class="size-medium wp-image-257" /></a><p class="wp-caption-text">A successful Canary deployment</p></div>
<p>And this is a similar screenshot for Experiment 2 when the canary release did not succeed and the new version was not rolled out.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/canary-fail-en.png?ssl=1" rel="shadowbox[sbpost-5137];player=img;" title="A failed Canary deployment"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00097/canary-fail-en-thumbnail.png?resize=550%2C711&#038;ssl=1" alt="A failed Canary deployment" title="A failed Canary deployment" width="550" height="711" class="size-medium wp-image-257" /></a><p class="wp-caption-text">A failed Canary deployment</p></div>
<p>Congratulations, you&#8217;ve come to the end of this third tutorial!</p>
<p><br clear="none" /></p>
<h4>Cleaning up resources</h4>
<p>You can delete the MHS application and its namespace. We can also remove Istio and Flagger because this is the last article of the series.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> delete mhs --namespace application<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces application<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> delete flagger --namespace flagger-system<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces flagger-system<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete -f https://raw.githubusercontent.com/istio/istio/release-1.7/samples/addons/prometheus.yaml<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">istioctl</span> manifest generate --set profile=demo <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">kubectl</span> delete -f -<br /></div>


<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces istio-system<br /></div>

<p>You can also stop the Kubernetes cluster by unchecking the box and restarting Docker Desktop.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/">Flagger &#8211; Monitor your Canary deployments with Grafana</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" rel="bookmark" title="Flagger &#8211; Get Started with Istio and Kubernetes">Flagger &#8211; Get Started with Istio and Kubernetes</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5137</post-id>	</item>
		<item>
		<title>Flagger &#8211; Canary deployments on Kubernetes</title>
		<link>https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/</link>
					<comments>https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Tue, 19 May 2020 18:56:08 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[flagger]]></category>
		<category><![CDATA[helm]]></category>
		<category><![CDATA[istio]]></category>
		<category><![CDATA[kubernetes]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5131</guid>

					<description><![CDATA[<p>&#160;Version française disponible Update October, 17th, 2020 : Use newer versions (Helm 3, Kube 18, Istio 1.7, Flagger 1.2). This article is the second one of the series dedicated to Flagger. In a nutshell, Flagger is a progressive delivery tool that automates the release process for applications running on Kubernetes. It reduces the risk of [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/">Flagger &#8211; Canary deployments on Kubernetes</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" rel="bookmark" title="Flagger &#8211; Get Started with Istio and Kubernetes">Flagger &#8211; Get Started with Istio and Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" rel="bookmark" title="Flagger &#8211; Monitor your Canary deployments with Grafana">Flagger &#8211; Monitor your Canary deployments with Grafana</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2020/05/19/flagger-canary-deployments-on-kubernetes/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Update</strong><br />
<strong>October, 17th, 2020 : </strong> Use newer versions (Helm 3, Kube 18, Istio 1.7, Flagger 1.2).
</div>
<p class="right" style="padding-left:15px;"><a href="https://flagger.app/" target="_blank" title="Flagger logo" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Flagger logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/flagger-logo.png?resize=180%2C180&#038;ssl=1" alt="Flagger logo" width="180" height="180" /></a></p>
<p>This article is the second one of the series dedicated to <a href="https://flagger.app/" target="_blank" title="Flagger" rel="noopener noreferrer">Flagger</a>. In a nutshell, Flagger is a progressive delivery tool that automates the release process for applications running on Kubernetes. It reduces the risk of introducing a new software version in production by gradually shifting traffic to the new version while measuring metrics and running conformance tests.</p>
<p>Make sure you have a local Kubernetes cluster running with the service mesh Istio. If you don&#8217;t, read <a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" title="Flagger – Get Started with Istio and Kubernetes">the first article: Flagger – Get Started with Istio and Kubernetes</a>.</p>
<p>In this second guide, we will focus on the installation of Flagger and run multiple canary deployments of the application <a href="https://github.com/eexit/mirror-http-server" target="_blank" title="Mirror HTTP Server" rel="noopener noreferrer">Mirror HTTP Server</a> (MHS). Remember that this dummy application can simulate valid and invalid responses based on the request. This is exactly what we need to test the capabilities of Flagger. We will cover both happy (rollout) and unhappy (rollback) scenarios.</p>
<div class="info"><strong class="label">Note</strong><br />
This is a hands-on guide and can be followed step by step on MacOS. It will require some adjustments if you are using a Windows or Linux PC. It is important to note that this article will not go into details and only grasp the concepts &#038; technologies so if you are not familiar with Docker, Kubernetes, Helm or Istio, I strongly advise you to check some documentation yourself before continuing reading.
</div>
<p><br clear="none" /></p>
<h4>Installing Flagger</h4>
<p>Let&#8217;s install Flagger by running these commands.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> create ns flagger-system<br /></div>

<p>We install Flagger in its own namespace <code>flagger-system</code>.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> repo add flagger https://flagger.app<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> upgrade -i flagger flagger/flagger \<br />--namespace=flagger-system \<br />--set crd.create=false \<br />--set meshProvider=istio \<br />--set metricsServer=http://prometheus.istio-system:9090<br /></div>

<blockquote><p>
Reference: <a href="https://docs.flagger.app/install/flagger-install-on-kubernetes" target="_blank" title="Flagger Install on Kubernetes" rel="noopener noreferrer">Flagger Install on Kubernetes</a><br />
Flagger depends on Istio telemetry and Prometheus (in that case, we assume Istio is installed in the <code>istio-system</code> namespace).<br />
All parameters are available on <a href="https://github.com/fluxcd/flagger/blob/main/charts/flagger/README.md" target="_blank" title="Flagger Github readme file" rel="noopener noreferrer">the Flagger readme file on GitHub</a>.<br />
We don&#8217;t specify a version for Flagger, which means it will use the latest available in the repo (<code>1.2.0</code> at the time of writing).
</p></blockquote>
<p>After a few seconds, you should get a message confirming that Flagger has been installed. From the Kube dashboard, verify that a new namespace has been created <code>flagger-system</code> and the Flagger pod is running.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/flagger-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5131];player=img;" title="Flagger is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/flagger-deployed-new-thumbnail.png?resize=550%2C316&#038;ssl=1" alt="Flagger is deployed in your cluster" title="Flagger is deployed in your cluster" width="550" height="316" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Flagger is deployed in your cluster</p></div>
<p><br clear="none" /></p>
<h4>Experiment 0 &#8211; Initialize Flagger with MHS v1.1.1</h4>
<p>Mirror HTTP Server has <a href="https://hub.docker.com/r/eexit/mirror-http-server/tags" target="_blank" title="MHS tags" rel="noopener noreferrer">multiple versions available</a>. To play with Flagger canary deployment feature, we will switch between version <code>1.1.1</code>, <code>1.1.2</code> and <code>1.1.3</code> of MHS (the latest version at the time of writing).</p>
<p>Before deploying MHS, let&#8217;s create a new namespace <code>application</code>, we don&#8217;t want to use the default one at the root of the cluster (this is good practice). The name is too generic, but sufficient for this tutorial, in general you will use the name of the team or the name of a group of features.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> create ns application<br /></div>

<p>Do not forget to activate Istio on this new namespace:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> label namespace application istio-injection=enabled<br /></div>

<p>To deploy MHS via Flagger, I created a <a href="https://helm.sh/docs/topics/charts/" target="_blank" title="Helm Chart" rel="noopener noreferrer">Helm chart</a>.</p>
<p><a href="https://github.com/fabianpiau/mhs-canary-chart" target="_blank" title="MHS Canary Helm Chart" rel="noopener noreferrer">This &#8220;canary flavored&#8221; chart</a> was created based on <a href="https://github.com/fabianpiau/mhs-chart" target="_blank" title="MHS Helm Chart" rel="noopener noreferrer">the previous chart without Flagger</a> which itself was created with the <code>helm create mhs-chart</code> command, then adapted. In this &#8220;canary flavored&#8221; chart, I did some extra adaptation <a href="https://github.com/fabianpiau/mhs-canary-chart/commit/8947788253a1b02e91eaca6ed46d5f89d5b6dc5e" target="_blank" title="First commit" rel="noopener noreferrer">to use 2 replicas instead of 1 to make it more realistic and use a fixed version to <code>1.1.1</code></a>, I also <a href="https://github.com/fabianpiau/mhs-canary-chart/commit/e92d8fcc3fa1257bd02370eaae17dcc9fde76378" target="_blank" title="Second commit" rel="noopener noreferrer">added the canary resource</a> where the magic happens.</p>
<p>Clone the chart repo:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">git</span> clone https://github.com/fabianpiau/mhs-canary-chart.git<br /></div>

<p>And install MHS:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">cd</span> mhs-canary-chart<br />helm install --name mhs --namespace application ./mhs<br /></div>

<p>After a few moments, if you look at the dashboard, you should see 2 replicas of MHS in the namespace <code>application</code>.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.1-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5131];player=img;" title="MHS 1.1.1 is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.1-deployed-new-thumbnail.png?resize=550%2C315&#038;ssl=1" alt="MHS 1.1.1 is deployed in your cluster" title="MHS 1.1.1 is deployed in your cluster" width="550" height="315" class="size-medium wp-image-257" /></a><p class="wp-caption-text">MHS 1.1.1 is deployed in your cluster</p></div>
<blockquote><p>
It is important to note that no canary analysis has been performed and the version has been automatically promoted. It was not a &#8220;real&#8221; canary release.<br />
Why? Because Flagger needs to initialize itself the first time we do a canary deployment of the application. So make sure the version you are deploying with Flagger the first time is fully tested and works well!<br />
You could also guess this auto-promotion happened because there was no initial version of the application in the cluster. Although this is obviously a good reason, it&#8217;s important to note that, even if we had a previous version before (e.g. <code>1.1.0</code>), the canary version <code>1.1.1</code> would have still been automatically promoted without analysis.
</p></blockquote>
<p>You can still check the canary events with:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n application describe canary/mhs<br /></div>

<p>You should have a similar output without a canary analysis:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">Events</span>:<br />Type     Reason  Age                  From     Message<br />----     ------  ----                 ----     -------<br />Warning  Synced  2m29s                flagger  mhs-primary.application not ready: waiting for rollout to finish: observed deployment generation less then desired generation<br />Normal   Synced  92s (x2 over 2m30s)  flagger  all the metrics providers are available!<br />Normal   Synced  92s                  flagger  Initialization done! mhs.application<br /></div>

<p>Or you can also directly check the log from Flagger:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">export</span> FLAGGER_POD_NAME=$(<span class="wp-shkshell-command">kubectl</span> get pods --namespace flagger-system -l <span class="wp-shkshell-string">"app.kubernetes.io/name=flagger,app.kubernetes.io/instance=flagger"</span> -o jsonpath="{.items[<span class="wp-shkshell-command">0</span>].metadata.name}")<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n flagger-system logs <span class="wp-shkshell-variable">$FLAGGER_POD_NAME</span><br /></div>

<p>If you take a closer look at the Kube dashboard, you should see some <code>mhs</code> and <code>mhs-primary</code> resources:</p>
<ul>
<li><code>mhs-primary</code> are the primary instances (= the non-canary ones). Flagger automatically add the <code>-primary</code> suffix to differentiate them from the canary instances.</li>
<li><code>mhs</code> are the canary instances. They exist only during the canary deployment and will disappear once the canary deployment ends. That&#8217;s why, in the screenshot above, you don&#8217;t see any <code>mhs</code> canary pods (i.e. 0 / 0 pod).</li>
</ul>
<blockquote><p>
Why this naming convention? I asked Flagger team directly and there is <a href="https://github.com/fluxcd/flagger/issues/522" title="Use of a -canary suffix for the canary pods instead of a -primary suffix on the normal pods" target="_blank" rel="noopener noreferrer">a technical constraint</a>.
</p></blockquote>
<p>Flagger is now initialized properly and MHS is deployed to your cluster. You can use the terminal to confirm MHS is accessible (thanks to the <a href="https://github.com/fabianpiau/mhs-canary-chart/blob/master/mhs/templates/gateway.yaml" title="Istio Gateway for MHS" target="_blank" rel="noopener noreferrer">Istio Gateway</a>):</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I -H Host:mhs.example.com <span class="wp-shkshell-string">'http://localhost'</span><br /></div>

<p>You should receive an HTTP 200 OK response:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 200 OK<br />x-powered-by: Express<br />date: Sun, 17 May 2020 16:47:33 GMT<br />x-envoy-upstream-service-time: 10<br />server: istio-envoy<br />transfer-encoding: chunked<br /></div>

<p>And:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I -H Host:mhs.example.com -H X-Mirror-Code:500 <span class="wp-shkshell-string">'http://localhost'</span><br /></div>

<p>should return an HTTP 500 response:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 500 Internal Server Error<br />x-powered-by: Express<br />date: Sun, 17 May 2020 16:48:09 GMT<br />x-envoy-upstream-service-time: 12<br />server: istio-envoy<br />transfer-encoding: chunked<br /></div>

<p><br clear="none" /></p>
<h4>Experiment 1 &#8211; MHS v1.1.2 canary deployment</h4>
<p>We are going to install a newer version <code>1.1.2</code>. You need to manually edit the file <code>mhs-canary-chart/mhs/values.yaml</code> and replace <code>tag: 1.1.1</code> with <code>tag: 1.1.2</code> (<a href="https://github.com/fabianpiau/mhs-canary-chart/blob/master/mhs/values.yaml#L9" target="_blank" title="Line to update" rel="noopener noreferrer">this line</a>).</p>
<p>Then:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">cd</span> mhs-canary-chart<br />helm upgrade mhs --namespace application ./mhs<br /></div>

<p>While the canary deployment is in progress, it&#8217;s very important to generate some traffic to MHS. Without traffic, Flagger will consider that something went wrong with the new version and will rollback automatically to the previous one. Obviously, you don&#8217;t need this extra step in a production environment that continuously receives real traffic.</p>
<p>Run this loop command in another terminal to generate artificial traffic:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">while</span> (true)<span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">do</span> curl -I -H Host:mhs.example.com <span class="wp-shkshell-string">'http://localhost'</span> <span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">sleep</span> 0.5 <span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">done</span><br /></div>

<p>Check the Kube dashboard, you should see the canary pod with the new version <code>1.1.2</code> at some point:</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.2-canary-deployment-in-progress-new.png?ssl=1" rel="shadowbox[sbpost-5131];player=img;" title="Canary deployment of MHS 1.1.2 in progress in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.2-canary-deployment-in-progress-new-thumbnail.png?resize=550%2C315&#038;ssl=1" alt="Canary deployment of MHS 1.1.2 in progress in your cluster" title="Canary deployment of MHS 1.1.2 in progress in your cluster" width="550" height="315" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Canary deployment of MHS 1.1.2 in progress in your cluster</p></div>
<p>Check the canary events with the same command as before:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n application describe canary/mhs<br /></div>

<p>After a while (about 6 minutes) you should have a similar event output:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">Events</span>:<br />Type     Reason  Age                From     Message<br />----     ------  ----               ----     -------<br />Warning  Synced  30m                flagger  mhs-primary.application not ready: waiting for rollout to finish: observed deployment generation less then desired generation<br />Normal   Synced  29m (x2 over 30m)  flagger  all the metrics providers are available!<br />Normal   Synced  29m                flagger  Initialization done! mhs.application<br />Normal   Synced  10m                flagger  New revision detected! Scaling up mhs.application<br />Normal   Synced  9m16s              flagger  Starting canary analysis for mhs.application<br />Normal   Synced  9m16s              flagger  Advance mhs.application canary weight 10<br />Normal   Synced  8m16s              flagger  Advance mhs.application canary weight 20<br />Normal   Synced  7m16s              flagger  Advance mhs.application canary weight 30<br />Normal   Synced  6m16s              flagger  Advance mhs.application canary weight 40<br />Normal   Synced  5m16s              flagger  Advance mhs.application canary weight 50<br />Normal   Synced  4m16s              flagger  Copying mhs.application template spec to mhs-primary.application<br />Normal   Synced  3m16s              flagger  Routing all traffic to primary<br />Normal   Synced  2m16s              flagger  (combined from similar events): Promotion completed! Scaling down mhs.application<br /></div>

<p>The canary release performed successfully. Now you have version <code>1.1.2</code> installed on all the primary pods and the canary pod has been removed.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.2-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5131];player=img;" title="MHS 1.1.2 is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00096/mhs-1.1.2-deployed-new-thumbnail.png?resize=550%2C315&#038;ssl=1" alt="MHS 1.1.2 is deployed in your cluster" title="MHS 1.1.2 is deployed in your cluster" width="550" height="315" class="size-medium wp-image-257" /></a><p class="wp-caption-text">MHS 1.1.2 is deployed in your cluster</p></div>
<blockquote><p>
Why did this deployment take about 6 minutes? Because it includes a 5 minutes canary analysis. During this analysis, the traffic was routed progressively to the canary pod. The canary traffic increased by steps of 10% every 1 minute until it reached 50% of the global traffic. The analysis is configurable and defined in the <a href="https://github.com/fabianpiau/mhs-canary-chart/blob/master/mhs/templates/canary.yaml" target="_blank" title="Canary resource" rel="noopener noreferrer">canary.yaml file</a> that was added to the chart.
</p></blockquote>
<p>Below is the analysis configuration:</p>
<pre class="brush: yaml; title: ; notranslate">
  analysis:
    # stepper schedule interval
    interval: 1m
    # max traffic percentage routed to canary - percentage (0-100)
    maxWeight: 50
    # canary increment step - percentage (0-100)
    stepWeight: 10
    # max number of failed metric checks before rollback (global to all metrics)
    threshold: 5
    metrics:
      - name: request-success-rate
        # percentage before the request success rate metric is considered as failed (0-100)
        thresholdRange:
          min: 99
        # interval for the request success rate metric check
        interval: 30s
      - name: request-duration
        # maximum req duration P99 in milliseconds before the request duration metric is considered as failed
        thresholdRange:
          max: 500
        # interval for the request duration metric check
        interval: 30s
</pre>
<blockquote><p>
The canary analysis has been covered with the 2 basic metrics that are provided out of the box by Istio / Prometheus (request success rate + duration). It is possible to define your own custom metrics. In that case, they will need to be provided by your application. Your application will need to expose a Prometheus endpoint that includes your custom metrics. And you will be able to <a href="https://docs.flagger.app/usage/metrics#prometheus" target="_blank" title="Custom metrics in the canary analysis" rel="noopener noreferrer">update the Flagger analysis configuration to use them with your own PromQL query</a>. Note this goes beyond the scope of this hands-on guide that uses only the built-in metrics.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Experiment 2 &#8211; MHS v1.1.3 faulty deployment</h4>
<p>Again, you need to manually edit the file <code>mhs-canary-chart/mhs/values.yaml</code> and replace <code>tag: 1.1.2</code> with <code>tag: 1.1.3</code>.</p>
<p>Then:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">cd</span> mhs-canary-chart<br />helm upgrade mhs --namespace application ./mhs<br /></div>

<p>We generate some artificial traffic:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">while</span> (true)<span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">do</span> curl -I -H Host:mhs.example.com <span class="wp-shkshell-string">'http://localhost'</span> <span class="wp-shkshell-special">;</span>  curl -I -H Host:mhs.example.com -H X-Mirror-Code:500 <span class="wp-shkshell-string">'http://localhost'</span> <span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">sleep</span> 0.5 <span class="wp-shkshell-special">;</span> <span class="wp-shkshell-command">done</span><br /></div>

<blockquote><p>
This time, we also generate invalid traffic to make sure the request success rate is going down!
</p></blockquote>
<p>Check the canary events with the same command as before:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n application describe canary/mhs<br /></div>

<p>After a while (about 6 minutes) you should have a similar event output:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">Normal</span>   Synced  8m23s (x2 over 20m)  flagger  New revision detected! Scaling up mhs.application<br />Normal   Synced  7m23s (x2 over 19m)  flagger  Advance mhs.application canary weight 10<br />Normal   Synced  7m23s (x2 over 19m)  flagger  Starting canary analysis for mhs.application<br />Warning  Synced  6m23s                flagger  Halt mhs.application advancement success rate 57.14% <span class="wp-shkshell-special"><</span> 99%<br />Warning  Synced  5m24s                flagger  Halt mhs.application advancement success rate 0.00% <span class="wp-shkshell-special"><</span> 99%<br />Warning  Synced  3m24s                flagger  Halt mhs.application advancement success rate 71.43% <span class="wp-shkshell-special"><</span> 99%<br />Warning  Synced  2m24s                flagger  Halt mhs.application advancement success rate 50.00% <span class="wp-shkshell-special"><</span> 99%<br />Warning  Synced  84s                  flagger  Halt mhs.application advancement success rate 63.64% <span class="wp-shkshell-special"><</span> 99%<br />Warning  Synced  24s                  flagger  Rolling back mhs.application failed checks threshold reached 5<br />Warning  Synced  24s                  flagger  Canary failed! Scaling down mhs.application<br /></div>

<p>And you are still on version <code>1.1.2</code>.</p>
<blockquote><p>
Flagger decided not to go ahead and propagate version <code>1.1.3</code> as it could not perform a successful analysis and the error threshold was reached, i.e. 5 times (indeed, each time, about 50% of the requests were ending up in an HTTP 500 response). Flagger has simply redirected all traffic back to the primary instances and removed the canary pod.
</p></blockquote>
<p>Congratulations, you&#8217;ve come to the end of this second tutorial!</p>
<p><br clear="none" /></p>
<h4>Observations</h4>
<p>Before we clean up the resources we&#8217;ve created, let&#8217;s wrap up with a list of observations:</p>
<ul>
<li>Deleting a deployment will delete all pods (canary / primary). And we don&#8217;t end up with orphan resources.</li>
<li>Prometheus is required. Without it, the canary analysis won&#8217;t work.</li>
<li>It is not possible to re-trigger a canary deployment of the same version if it has just failed. It forces you to bump up the version (even if it was a configuration and not a code issue).</li>
<li>Flagger off-boarding process is not as simple as removing the canary resource from the chart and deploy a new version. If you delete the canary resource then Flagger won&#8217;t trigger the canary process, it will change the version in <code>mhs</code> and remove <code>mhs-primary</code> but <code>mhs</code> has 0 pods so it will make your service unavailable! You need to be careful and adopt a proper manual off-boarding process. Recently, the Flagger team added a property <code>revertOnDeletion</code> you can enable to avoid this issue. You can read the documentation <a href="https://docs.flagger.app/usage/how-it-works#canary-finalizers" target="_blank" title="Flagger canary finalizer" rel="noopener noreferrer">to know more about this canary finalizer</a>.</li>
<li>After multiple deployments, it seems that some events can be missing, the Kubernetes <code>describe</code> command is accumulating them (<code>x&lt;int&gt; over &lt;int&gt;m</code>) sometimes the order is not preserved and/or some events are not showing up. You can look at the phase status (terminal status are <code>Initialized</code>, <code>Succeeded</code> and <code>Failed</code>). The best is to look directly at the logs on the Flagger pod as this is always accurate and complete.</li>
<li>The canary analysis should be configured to run for a short period of time (i.e. no more than 30 minutes) to leverage continuous deployment and avoid releasing a new version while a canary deployment for the previous one is still in progress. If you want to perform canary releases over longer periods, Flagger may not be the best tool.</li>
<li>Finally, it&#8217;s important to remember that the first time you deploy with Flagger (like in experiment 0 above), the tool needs to initialize itself (<code>Initialized</code> status) and will not perform any analysis.</li>
</ul>
<p><br clear="none" /></p>
<h4>Cleaning up resources</h4>
<p>Now the tutorial is complete you can remove the MHS application and its namespace.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> delete mhs --namespace application<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces application<br /></div>

<p>We recommend that you leave Flagger and Istio in place to save time in the next tutorial. If however you&#8217;d like to remove everything now, then you can run the following commands.</p>
<p>Remove Flagger:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> delete flagger --namespace flagger-system<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces flagger-system<br /></div>

<p>Remove Istio and Prometheus:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete -f https://raw.githubusercontent.com/istio/istio/release-1.7/samples/addons/prometheus.yaml<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">istioctl</span> manifest generate --set profile=demo <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">kubectl</span> delete -f -<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces istio-system<br /></div>

<p><br clear="none" /></p>
<h4>What&#8217;s next?</h4>
<p>The <a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" title="Flagger – Monitor your Canary deployments with Grafana">next article</a> will focus on the <a href="https://grafana.com/" target="_blank" title="Grafana website" rel="noopener noreferrer">Grafana dashboard</a> provided out of the box with Flagger which is a nice addition, so you don&#8217;t need to manually run any <code>kuberctl</code> commands to check the result of your canary deployments. Stay tuned! In the meantime, you can stop the Kubernetes cluster by unchecking the box and restarting Docker Desktop. Your computer deserves another break.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/">Flagger &#8211; Canary deployments on Kubernetes</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" rel="bookmark" title="Flagger &#8211; Get Started with Istio and Kubernetes">Flagger &#8211; Get Started with Istio and Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" rel="bookmark" title="Flagger &#8211; Monitor your Canary deployments with Grafana">Flagger &#8211; Monitor your Canary deployments with Grafana</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5131</post-id>	</item>
		<item>
		<title>Flagger &#8211; Get Started with Istio and Kubernetes</title>
		<link>https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/</link>
					<comments>https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sat, 02 May 2020 17:40:37 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[flagger]]></category>
		<category><![CDATA[helm]]></category>
		<category><![CDATA[istio]]></category>
		<category><![CDATA[kubernetes]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5125</guid>

					<description><![CDATA[<p>&#160;Version française disponible Update October, 17th, 2020 : Use newer versions (Helm 3, Kube 18, Istio 1.7). This series of articles is dedicated to Flagger, a tool that integrates with Kubernetes, the popular container orchestration platform. Flagger enables automated deployments and will be one step closer to a continuous deployment process. This article is the [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/">Flagger &#8211; Get Started with Istio and Kubernetes</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" rel="bookmark" title="Flagger &#8211; Monitor your Canary deployments with Grafana">Flagger &#8211; Monitor your Canary deployments with Grafana</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/09/17/choose-the-web-hosting-service-that-fits-your-needs/" rel="bookmark" title="Choose the web hosting service that fits your needs">Choose the web hosting service that fits your needs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2020/05/02/flagger-get-started-with-istio-and-kubernetes/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Update</strong><br />
<strong>October, 17th, 2020 : </strong> Use newer versions (Helm 3, Kube 18, Istio 1.7).
</div>
<p>This series of articles is dedicated to <a href="https://flagger.app/" target="_blank" title="Flagger" rel="noopener noreferrer">Flagger</a>, a tool that integrates with <a href="https://kubernetes.io/" target="_blank" title="Kubernetes" rel="noopener noreferrer">Kubernetes</a>, the popular container orchestration platform. Flagger enables automated deployments and will be one step closer to a continuous deployment process.</p>
<p>This article is the first of the series and also the only one where we won&#8217;t use Flagger yet&#8230; this article will walk through how you to run a Kubernetes cluster on your local environment and deploy an application which will be accessible via an <a href="https://istio.io/" target="_blank" title="Istio" rel="noopener noreferrer">Istio</a> gateway.</p>
<div class="info"><strong class="label">Note</strong><br />
This is a hands-on guide and can be followed step by step on MacOS. It will require some adjustments if you are using a Windows or Linux PC. It is important to note that this article will not go into details and only grasp the concepts &#038; technologies so if you are not familiar with Docker, Kubernetes, Helm or Istio, I strongly advise you to check some documentation yourself before continuing reading.
</div>
<p><br clear="none" /></p>
<h4>Docker</h4>
<p>Install Docker by installing the <a href="https://hub.docker.com/editions/community/docker-ce-desktop-mac/" target="_blank" title="Docker for Mac" rel="noopener noreferrer">Docker Desktop for Mac</a> application, you can refer to the <a href="https://docs.docker.com/docker-for-mac/install/" target="_blank" title="Install Docker for Mac" rel="noopener noreferrer">official installation guide</a>. For Windows users, the equivalent application &#8220;Docker for Windows&#8221; exists.</p>
<p>In the next part, we will also use Docker for Mac to set up our local Kubernetes cluster. Note that this tutorial has been tested with <a href="https://docs.docker.com/docker-for-mac/release-notes/#docker-desktop-community-2400" target="_blank" title="Docker for Mac 2.4.0.0" rel="noopener noreferrer">Docker for Mac 2.4.0.0</a> that includes a Kubernetes Cluster in version 1.18.8, this is the latest at the moment of writing.</p>
<blockquote><p>
If you use a different version, technology is moving fast so I cannot guarantee that the commands used in this series will work without any adjustment.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Mirror HTTP Server</h4>
<p>First a few words about the application <a href="https://github.com/eexit/mirror-http-server" target="_blank" title="Mirror HTTP Server" rel="noopener noreferrer">Mirror HTTP Server</a> we will use in this series of articles.</p>
<p>MHS is a very simple JavaScript application based  on <a href="https://nodejs.org/" target="_blank" title="Node.js" rel="noopener noreferrer">Node.js</a> using the framework <a href="https://expressjs.com/" target="_blank" title="Express" rel="noopener noreferrer">Express</a> which allows you to customize the HTTP response received by setting specific HTTP headers in the request. The Docker image is <a href="https://hub.docker.com/r/eexit/mirror-http-server" target="_blank" title="Mirror HTTP Server Docker Image" rel="noopener noreferrer">publicly available on the Docker Hub</a>. You can consult the <a href="https://github.com/eexit/mirror-http-server" target="_blank" title="Mirror HTTP Server" rel="noopener noreferrer">Github repo of the project </a> to find out more, please note that I am not the author.</p>
<p>This little app is exactly what we need to test the capabilities of Flagger to simulate 200 OK responses and 500 Internal Server Error responses.</p>
<p>Let&#8217;s pull the Docker image:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">docker</span> pull eexit/mirror-http-server<br /></div>

<p>And run a new container that uses it:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">docker</span> run -itp 8080:80 eexit/mirror-http-server<br /></div>

<p>Then let&#8217;s make sure it is functioning properly:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I <span class="wp-shkshell-string">'http://localhost:8080'</span><br /></div>

<p>You should receive an HTTP 200 OK response:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 200 OK<br />X-Powered-By: Express<br />Date: Fri, 01 May 2020 17:57:17 GMT<br />Connection: keep-alive<br /></div>

<p>While:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I -H X-Mirror-Code:500 <span class="wp-shkshell-string">'http://localhost:8080'</span><br /></div>

<p>will return an HTTP 500 response:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 500 Internal Server Error<br />X-Powered-By: Express<br />Date: Fri, 01 May 2020 17:57:45 GMT<br />Connection: keep-alive<br /></div>

<blockquote><p>
For simplicity, we use the curl command, but you can use your favourite tool, e.g. <a href="https://www.postman.com/" target="_blank" title="Postman" rel="noopener noreferrer">Postman</a>.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Kubernetes</h4>
<p>Now that you&#8217;ve installed Docker for Mac, having a Kubernetes cluster running locally will be a simple formality. You just need to check a box!</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/docker-for-mac-enable-new.png?ssl=1" rel="shadowbox[sbpost-5125];player=img;" title="Enable Kubernetes with Docker for Mac"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/docker-for-mac-enable-new-thumbnail.png?resize=550%2C349&#038;ssl=1" alt="Enable Kubernetes with Docker for Mac" title="Enable Kubernetes with Docker for Mac" width="550" height="349" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Enable Kubernetes with Docker for Mac</p></div>
<p>If the light is green, then your Kubernetes cluster has successfully started. Please note, this requires a significant amount of resources, so don&#8217;t panic if the fan is running at full speed and it takes a bit of time to start&#8230;</p>
<p><br clear="none" /></p>
<h4>Kube dashboard</h4>
<p>We will install our first application in our Kubernetes cluster.</p>
<p>Kubernetes via Docker does not come with the dashboard by default, you have to install it yourself. This dashboard is very practical and provides a graphical interface of what is going on in your cluster and will save you from having to enter <code>kubectl</code> commands.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio/deploy/recommended.yaml<br /></div>

<p>The dashboard is protected, but you can use the default user to access it. You can generate a default token via this command:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> -n kube-system describe secret default <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">grep</span> token: <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">awk</span> <span class="wp-shkshell-string">'{print <span class="wp-shkshell-variable">$2</span>}'</span><br /></div>

<p>Copy it.</p>
<blockquote><p>
You will need to re-use this command and /or the token copied if your session has expired, this happens when you don&#8217;t interact with the dashboard for a little while.
</p></blockquote>
<p>Finally, create a proxy to access the dashboard from the browser (this command will need to run indefinitely):</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> proxy<br /></div>

<p>If you access http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login and use the token that you copied to authenticate, you should see this screen.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/kube-dashboard-new.png?ssl=1" rel="shadowbox[sbpost-5125];player=img;" title="Kube Dashboard"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/kube-dashboard-new-thumbnail.png?resize=550%2C316&#038;ssl=1" alt="Kube Dashboard" title="Kube Dashboard" width="550" height="316" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Kube Dashboard</p></div>
<p><br clear="none" /></p>
<h4>Helm</h4>
<p>We use <a href="https://brew.sh/" target="_blank" title="Homebrew" rel="noopener noreferrer">Homebrew</a> for the installation of Helm. Homebrew is a handy package manager available for Mac.</p>
<p>We will use <a href="https://helm.sh/" target="_blank" title="Helm" rel="noopener noreferrer">Helm</a> to install Istio and the MHS application in our cluster. Helm is a bit like Homebrew, but for Kubernetes. We are using version 3. Helm will save you from having to enter many <code>kubectl apply</code> commands.</p>
<p>Let&#8217;s install Helm 3 with:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">brew</span> install helm@3<br /></div>

<p>To verify that Helm has been installed:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> version<br /></div>

<p>You should have a similar output (note that Helm 3.3.4 is the latest version at the time of writing):</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">version</span>.BuildInfo{Version:"v3.3.4", GitCommit:"a61ce5633af99708171414353ed49547cf05013d", GitTreeState:"dirty", GoVersion:"go1.15.2"}<br /></div>

<p><br clear="none" /></p>
<h4>Istio &#038; Prometheus</h4>
<p>Now, we are going to install the Istio Service Mesh. For full explanations and the benefits of using a Service Mesh, I invite you to read the <a href="https://istio.io/latest/about/service-mesh/" target="_blank" title="What is Istio" rel="noopener noreferrer">official documentation</a>.</p>
<p>First of all, you must increase the memory limits of your Kubernetes via Docker, otherwise you will run into deployment issues. Your laptop&#8217;s fans will recover, don&#8217;t worry&#8230;</p>
<p>Here is my configuration:</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/docker-for-mac-config-new.png?ssl=1" rel="shadowbox[sbpost-5125];player=img;" title="Kubernetes Configuration in Docker for Mac for Istio"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/docker-for-mac-config-new-thumbnail.png?resize=550%2C349&#038;ssl=1" alt="Kubernetes Configuration in Docker for Mac for Istio" title="Kubernetes Configuration in Docker for Mac for Istio" width="550" height="349" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Kubernetes Configuration in Docker for Mac for Istio</p></div>
<p>I followed the <a href="https://istio.io/latest/docs/setup/platform-setup/docker/" target="_blank" title="Docker Desktop recommendations for Istio" rel="noopener noreferrer">Docker Desktop recommendations for Istio</a>.</p>
<p>Let&#8217;s go and install Istio 1.7.3 (the latest version at the time of writing). First, download the source:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -L https://istio.io/downloadIstio <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">ISTIO_VERSION</span>=1.7.3 sh -<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">cd</span> istio-1.7.3<br /></div>

<p>Add the <code>istioctl</code> client to your path:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">export</span> PATH=<span class="wp-shkshell-variable">$PWD</span>/bin:<span class="wp-shkshell-variable">$PATH</span><br /></div>

<p>Install Istio with the provided client, we use the <a href="https://istio.io/latest/docs/setup/additional-setup/config-profiles/" rel="noopener noreferrer" title="Istio Installation Configuration Profiles" target="_blank">demo profile</a>:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">istioctl</span> install --set profile=demo<br /></div>

<p>After a few minutes, you should get a message confirming that Istio has been installed. And voilà!</p>
<blockquote><p>
To install the latest version of Istio, you can simply replace the first line with <code>curl -L https://istio.io/downloadIstio | sh -</code>.
</p></blockquote>
<p>Add Prometheus as it&#8217;s required for Flagger:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> apply -f https://raw.githubusercontent.com/istio/istio/release-1.7/samples/addons/prometheus.yaml<br /></div>

<p>From the Kube dashboard, verify that a new namespace has been created <code>istio-system</code> and that it contains the Istio tools including <a href="https://prometheus.io/" target="_blank" title="Prometheus" rel="noopener noreferrer">Prometheus</a>.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/istio-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5125];player=img;" title="Istio is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/istio-deployed-new-thumbnail.png?resize=550%2C316&#038;ssl=1" alt="Istio is deployed in your cluster" title="Istio is deployed in your cluster" width="550" height="316" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Istio is deployed in your cluster</p></div>
<blockquote><p>
Why is Prometheus important? Because it is an essential component for Flagger which will provide the metrics to show if the new version of your application is healthy or not, thus it will know when to promote or rollback a version. I will come back to this in detail in the next article.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Deploying Mirror HTTP Server</h4>
<p>Before deploying MHS, let&#8217;s create a new namespace <code>application</code>, we don&#8217;t want to use the default one at the root of the cluster (this is good practice). The name is too generic, but sufficient for this tutorial, in general you will use the name of the team or the name of a group of features.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> create ns application<br /></div>

<p>Do not forget to activate Istio on this new namespace:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> label namespace application istio-injection=enabled<br /></div>

<p>To deploy MHS, I created a <a href="https://helm.sh/docs/topics/charts/" target="_blank" title="Helm Chart" rel="noopener noreferrer">Helm chart</a>.</p>
<p><a href="https://github.com/fabianpiau/mhs-chart" target="_blank" title="MHS Helm Chart" rel="noopener noreferrer">This chart</a> was created with the <code>helm create mhs-chart</code> command, then I updated to <a href="https://github.com/fabianpiau/mhs-chart/commit/bb992384546ad2dfc231c6264629d23cea7203e4" target="_blank" title="First commit" rel="noopener noreferrer">use the latest image of MHS</a>. I also added <a href="https://github.com/fabianpiau/mhs-chart/commit/ecbde2e254e8887b3ed73b081ea5a763860e6ce6" target="_blank" title="Second commit" rel="noopener noreferrer">a gateway.yaml file to configure the Istio gateway</a> so it can be accessible outside of the cluster.</p>
<p>Clone the chart repo:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">git</span> clone https://github.com/fabianpiau/mhs-chart.git<br /></div>

<p>And install MHS:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">cd</span> mhs-chart<br />helm install --name mhs --namespace application ./mhs<br /></div>

<p>After a few moments, if you look at the dashboard, you should see 1 replica of MHS in the namespace <code>application</code>.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/mhs-deployed-new.png?ssl=1" rel="shadowbox[sbpost-5125];player=img;" title="MHS is deployed in your cluster"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00095/mhs-deployed-new-thumbnail.png?resize=550%2C316&#038;ssl=1" alt="MHS is deployed in your cluster" title="MHS is deployed in your cluster" width="550" height="316" class="size-medium wp-image-257" /></a><p class="wp-caption-text">MHS is deployed in your cluster</p></div>
<p>You now have 1 MHS pod running in your Kubernetes cluster. The pod is exposed to the outside world via an Istio gateway.</p>
<p>To test, use the similar commands that we used against the docker container earlier:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I -H Host:mhs.example.com <span class="wp-shkshell-string">'http://localhost'</span><br /></div>

<p>You should receive an HTTP 200 OK response that was handled by <a href="https://www.envoyproxy.io/" target="_blank" title="Envoy proxy" rel="noopener noreferrer">Envoy</a>, the proxy used by Istio:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 200 OK<br />x-powered-by: Express<br />date: Fri, 01 May 2020 17:37:19 GMT<br />x-envoy-upstream-service-time: 17<br />server: istio-envoy<br />transfer-encoding: chunked<br /></div>

<p>And:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">curl</span> -I -H Host:mhs.example.com -H X-Mirror-Code:500 <span class="wp-shkshell-string">'http://localhost'</span><br /></div>

<p>should return an HTTP 500 response:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">HTTP</span>/1.1 500 Internal Server Error<br />x-powered-by: Express<br />date: Fri, 01 May 2020 17:38:34 GMT<br />x-envoy-upstream-service-time: 2<br />server: istio-envoy<br />transfer-encoding: chunked<br /></div>

<p>Congratulations, you&#8217;ve come to the end of this first tutorial!</p>
<blockquote><p>
For information, you can also access MHS with your favourite browser if you run a proxy command first to expose the pod:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">export</span> POD_NAME=$(<span class="wp-shkshell-command">kubectl</span> get pods --namespace application -l <span class="wp-shkshell-string">"app.kubernetes.io/name=mhs,app.kubernetes.io/instance=mhs"</span> -o jsonpath="{.items[<span class="wp-shkshell-command">0</span>].metadata.name}")<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> port-forward --namespace application <span class="wp-shkshell-variable">$POD_NAME</span> 8080:80<br /></div>

<p>Then, navigate to <a href="http://localhost:8080/" target="_blank" title="Localhost MHS" rel="noopener noreferrer">http://localhost:8080/</a>.</p>
<p>You should see a&#8230; blank page. This is normal, MHS does not return a body in the response and there is no HTML output!
</p></blockquote>
<p><br clear="none" /></p>
<h4>Cleaning up resources</h4>
<p>You can delete the MHS application and its namespace.</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">helm</span> delete mhs --namespace application<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces application<br /></div>

<p>We don&#8217;t remove Istio / Prometheus because we will need it in the next article, but if you want to free up some resources, you can use these commands:</p>

<div class="wp-shkshell"><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete -f https://raw.githubusercontent.com/istio/istio/release-1.7/samples/addons/prometheus.yaml<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">istioctl</span> manifest generate --set profile=demo <span class="wp-shkshell-special">|</span> <span class="wp-shkshell-command">kubectl</span> delete -f -<br /><span class="wp-shkshell-prompt"></span> <br /><span class="wp-shkshell-prompt"></span> <span class="wp-shkshell-command">kubectl</span> delete namespaces istio-system<br /></div>

<p><br clear="none" /></p>
<h4>What&#8217;s next?</h4>
<p>The <a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="noopener" title="Flagger – Canary deployments on Kubernetes">next article</a> will focus on the installation of Flagger and use different versions of MHS to try canary deployments. Stay tuned! In the meantime, you can stop the Kubernetes cluster by unchecking the box and restarting Docker Desktop. Your computer deserves a break.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/">Flagger &#8211; Get Started with Istio and Kubernetes</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/06/28/flagger-monitor-your-canary-deployments-with-grafana/" rel="bookmark" title="Flagger &#8211; Monitor your Canary deployments with Grafana">Flagger &#8211; Monitor your Canary deployments with Grafana</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/09/17/choose-the-web-hosting-service-that-fits-your-needs/" rel="bookmark" title="Choose the web hosting service that fits your needs">Choose the web hosting service that fits your needs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2020/05/02/flagger-get-started-with-istio-and-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5125</post-id>	</item>
		<item>
		<title>Expedia CoderDojo in London</title>
		<link>https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/</link>
					<comments>https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 22 Jul 2019 17:37:13 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[coderdojo]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[programmer]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5079</guid>

					<description><![CDATA[<p>&#160;Version française disponible Last Wednesday, Expedia organized the first CoderDojo in our London office. CoderDojo is a volunteer-led community group for young people aged 7 to 17 to come together and learn to create cool projects with technology. It&#8217;s free to come along and all experience levels are welcome; whether you&#8217;re new to coding or [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/">Expedia CoderDojo in London</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/02/20/fosdem-2013-impressions/" rel="bookmark" title="Fosdem 2013 Impressions">Fosdem 2013 Impressions</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2019/07/22/expedia-coderdojo-in-london/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>Last Wednesday, Expedia organized the first <a href="https://coderdojo.com/" target="_blank" title="CoderDojo website" rel="noopener noreferrer">CoderDojo</a> in our London office.</p>
<p class="center"><a href="https://coderdojo.com/" target="_blank" title="CoderDojo logo" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="CoderDojo logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-logo.png?resize=460%2C160&#038;ssl=1" alt="CoderDojo logo" width="460" height="160" /></a></p>
<p>CoderDojo is a volunteer-led community group for young people aged 7 to 17 to come together and learn to create cool projects with technology.</p>
<p>It&#8217;s free to come along and all experience levels are welcome; whether you&#8217;re new to coding or have a project idea that you want to make reality!</p>
<p><br clear="none" /></p>
<p>For this first session, we had about 10 participants aged between 7 and 13 years old. </p>
<p>As an ice breaker, we did the &#8220;two truths and a lie&#8221; game mentioning 3 things we had done during that day. I was quite glad that most kids fell into my trap when I said that I played PlayStation at work, and they all thought it was the lie&#8230; :)</p>
<p>We organized different activities depending on what the kids were interested in:</p>
<ul>
<li><a href="https://scratch.mit.edu/" target="_blank" title="Scratch website" rel="noopener noreferrer">Scratch</a>, using drag &#038; drop blocks instead of traditional code, to make a hippo fly or build more complex projects</li>
<li>Learn basic algorithm skills based on <a href="https://code.org/starwars" target="_blank" title="Building Star Wars games with Code" rel="noopener noreferrer">Star Wars</a> or <a href="https://studio.code.org/s/flappy/reset" target="_blank" title="Code your own Flappy game" rel="noopener noreferrer">Flappy Bird</a> games</li>
<li>Use of the <a href="https://microbit.org/" target="_blank" title="Micro:bit website" rel="noopener noreferrer">BBC Micro:Bit</a> to create games or simulate robot emotions</li>
</ul>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-1.jpg?ssl=1" rel="shadowbox[sbpost-5079];player=img;" title="CoderDojo @ Expedia London"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-1-thumbnail.png?resize=550%2C404&#038;ssl=1" alt="CoderDojo @ Expedia London" title="CoderDojo @ Expedia London" width="550" height="404" class="size-medium wp-image-257" /></a><p class="wp-caption-text">CoderDojo @ Expedia London</p></div>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-2.jpg?ssl=1" rel="shadowbox[sbpost-5079];player=img;" title="CoderDojo @ Expedia London"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-2-thumbnail.png?resize=550%2C404&#038;ssl=1" alt="CoderDojo @ Expedia London" title="CoderDojo @ Expedia London" width="550" height="404" class="size-medium wp-image-257" /></a><p class="wp-caption-text">CoderDojo @ Expedia London</p></div>
<p>At the end of the activity, the kids were invited to show what they achieved over the last hour. It was nice to see the majority of them really happy &#038; enthusiastic to tell us about what they built.<br />
Sharing knowledge and collaboration are very important soft skills.</p>
<p>In summary, it was fun for the kids but also the mentors!</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-3.jpg?ssl=1" rel="shadowbox[sbpost-5079];player=img;" title="CoderDojo Mentors: Veli, Alice, Adam, Ana, Fabian, Nicola"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00094/coderdojo-3-thumbnail.png?resize=550%2C404&#038;ssl=1" alt="CoderDojo Mentors: Veli, Alice, Adam, Ana, Fabian, Nicola" title="CoderDojo Mentors: Veli, Alice, Adam, Ana, Fabian, Nicola" width="550" height="404" class="size-medium wp-image-257" /></a><p class="wp-caption-text">CoderDojo Mentors: Veli, Alice, Adam, Ana, Fabian, Nicola</p></div>
<p>After receiving spontaneously good feedback from some participants at the end, we can say this first session was a success. We obviously have room for improvement and already got some new ideas for the next session.</p>
<p>We are planning to have a monthly Dojo, the 3rd Wednesday of each month, which means the next one will be on August, 21st.</p>
<p>Whether you are a kid, a parent or a mentor, we hope to see you soon at the second one! More info and registration at <a href="https://zen.coderdojo.com/dojos/gb/london-borough-of-islington-london/angel-london-expedia-group" target="_blank" title="London Angel Expedia CoderDojo" rel="noopener noreferrer">London Angel Expedia CoderDojo</a>.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/">Expedia CoderDojo in London</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/02/20/fosdem-2013-impressions/" rel="bookmark" title="Fosdem 2013 Impressions">Fosdem 2013 Impressions</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5079</post-id>	</item>
		<item>
		<title>Volunteering at Devoxx4Kids</title>
		<link>https://blog.fabianpiau.com/en/2019/05/06/volunteering-at-devoxx4kids/</link>
					<comments>https://blog.fabianpiau.com/en/2019/05/06/volunteering-at-devoxx4kids/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 06 May 2019 11:47:51 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[devoxx]]></category>
		<category><![CDATA[devoxx4kids]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[programmer]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=5050</guid>

					<description><![CDATA[<p>&#160;Version française disponible Devoxx4Kids is a spin-off of the Devoxx developer conference, with some differences: the event lasts one day, does not include any conferences, but focuses on workshops and, of course, is designed for kids (ages 10-14). Last year, I volunteered for Devoxx4Kids London and it was lots of fun. I like IT and [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2019/05/06/volunteering-at-devoxx4kids/">Volunteering at Devoxx4Kids</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
<li><a href="https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/" rel="bookmark" title="Expedia CoderDojo in London">Expedia CoderDojo in London</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/01/21/firefox-nightly-aurora-beta-desktop-mobile-esr-co/" rel="bookmark" title="Firefox Nightly, Aurora, Beta, Desktop, Mobile, ESR &#038; Co.">Firefox Nightly, Aurora, Beta, Desktop, Mobile, ESR &#038; Co.</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2019/05/06/volunteering-at-devoxx4kids/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p class="center"><a href="https://www.devoxx4kids.org/" target="_blank" title="Devoxx4Kids" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Devoxx4Kids logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/devoxx4kids-logo-medium.png?resize=556%2C202&#038;ssl=1" alt="Devoxx4Kids logo" width="556" height="202" /></a></p>
<p><a href="https://www.devoxx4kids.org/" target="_blank" title="Devoxx4Kids website" rel="noopener noreferrer">Devoxx4Kids</a> is a spin-off of the <a href="https://devoxx.com/" target="_blank" title="Devoxx website" rel="noopener noreferrer">Devoxx</a> developer conference, with some differences: the event lasts one day, does not include any conferences, but focuses on workshops and, of course, is designed for kids (ages 10-14).</p>
<p>Last year, I volunteered for <a href="https://www.facebook.com/devoxx4kidsuk" target="_blank" title="Devoxx4Kids UK Facebook page" rel="noopener noreferrer">Devoxx4Kids London</a> and it was lots of fun. I like IT and I like kids, so it&#8217;s a good motivation! Playing with <a href="https://scratch.mit.edu/" target="_blank" title="Scratch website" rel="noopener noreferrer">Scratch</a>, making <a href="https://www.softbankrobotics.com/emea/en/nao" target="_blank" title="Nao the robot website" rel="noopener noreferrer">Nao the robot</a> dance &#038; talk, programming some <a href="https://www.lego.com/mindstorms" target="_blank" title="Lego Mindstorms website" rel="noopener noreferrer">Lego Mindstorms</a> for battles, etc. You almost end up being a kid yourself!</p>
<p>It&#8217;s a very good initiative to introduce basic engineering and programming skills to the youngest generation so they discover what IT is in a good and practical way. This experience can also teach them some soft skills like patience, sharing and listening.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/devoxx4kids-collage.jpg?ssl=1" rel="shadowbox[sbpost-5050];player=img;" title="Devoxx4Kids 2018 in London - Collage"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/devoxx4kids-collage-thumbnail.png?resize=550%2C377&#038;ssl=1" alt="Devoxx4Kids 2018 in London - Collage" title="Devoxx4Kids 2018 in London - Collage" width="550" height="377" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Devoxx4Kids 2018 in London - Collage</p></div>
<p>Devoxx4Kids is also a good opportunity to teach kids that tech is not something only for boys, and girls can take their part too. As they are young, they are much less concerned with stereotypes. As a reader of this blog and probably an adult, you won&#8217;t be surprised that someone working in IT can be associated to a bearded nerdy guy typing lines of code in the dark with his coffee &#038; a sexy wallpaper&#8230;</p>
<p class="center"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Stereotyped IT engineer" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/nerdy-guy-frame.png?resize=411%2C366&#038;ssl=1" alt="Stereotyped IT engineer" width="411" height="366" /></p>
<p>Joke apart, Devoxx4kids will take place next Saturday (on May 11th) in London. Unfortunately, I won&#8217;t be able to attend and help this year, I will have to give the <a href="https://sphero.com/products/sphero-bolt" target="_blank" title="Sphero BOLT website" rel="noopener noreferrer">Sphero BOLT</a> and the <a href="https://www.amazon.co.uk/Kano-Harry-Potter-Coding-Kit/dp/B07C7X8LG9" target="_blank" title="Harry Potter coding wand website" rel="noopener noreferrer">Harry Potter coding wand</a> a miss. But don&#8217;t hesitate, if you are interested and free that day, I would say it&#8217;s never too late to volunteer. You can find all the details on the <a href="https://www.eventbrite.com/e/devoxx4kids-uk-london-may-2019-tickets-57921482714" target="_blank" title="Devoxx4Kids UK London May, 11th Eventbrite page" rel="noopener noreferrer">event page</a> or reach them via <a href="https://www.facebook.com/devoxx4kidsuk" target="_blank" title="Devoxx4Kids UK Facebook page" rel="noopener noreferrer">Facebook</a> or <a href="https://twitter.com/devoxx4kidsuk" target="_blank" title="Devoxx4Kids UK Twitter" rel="noopener noreferrer">Twitter</a>.</p>
<p>If you are not living in London or even in UK, there are plenty of Devoxx4Kids around the world, get in touch with the one near your home, I&#8217;m sure they will be happy to have some extra help!</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/devoxx4kids-group-photo.jpg?ssl=1" rel="shadowbox[sbpost-5050];player=img;" title="Devoxx4Kids 2018 in London - Group photo"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00093/devoxx4kids-group-photo-thumbnail.jpg?resize=550%2C149&#038;ssl=1" alt="Devoxx4Kids 2018 in London - Group photo" title="Devoxx4Kids 2018 in London - Group photo" width="550" height="149" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Devoxx4Kids 2018 in London - Group photo</p></div>
<p>The article <a href="https://blog.fabianpiau.com/en/2019/05/06/volunteering-at-devoxx4kids/">Volunteering at Devoxx4Kids</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
<li><a href="https://blog.fabianpiau.com/en/2019/07/22/expedia-coderdojo-in-london/" rel="bookmark" title="Expedia CoderDojo in London">Expedia CoderDojo in London</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/01/21/firefox-nightly-aurora-beta-desktop-mobile-esr-co/" rel="bookmark" title="Firefox Nightly, Aurora, Beta, Desktop, Mobile, ESR &#038; Co.">Firefox Nightly, Aurora, Beta, Desktop, Mobile, ESR &#038; Co.</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2019/05/06/volunteering-at-devoxx4kids/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5050</post-id>	</item>
		<item>
		<title>A Java 11 migration successful story</title>
		<link>https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/</link>
					<comments>https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/#comments</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Thu, 27 Dec 2018 11:45:00 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[migration]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4998</guid>

					<description><![CDATA[<p>&#160;Version française disponible This post summarizes the work we have achieved within my team to migrate our micro-services from Java 8 to Java 11 for the website Hotels.com. In summary, for each of the services we own, we have made the following steps: Make the code compile with Java 11 Run the Java 11 compatible [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/">A Java 11 migration successful story</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/" rel="bookmark" title="QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2018/12/27/a-java-11-migration-successful-story/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>This post summarizes the work we have achieved within my team to migrate our micro-services from Java 8 to Java 11 for the website Hotels.com.</p>
<p>In summary, for each of the services we own, we have made the following steps:</p>
<ul>
<li>Make the code compile with Java 11</li>
<li>Run the Java 11 compatible service on Java 8</li>
<li>Run the service on Java 11</li>
</ul>
<blockquote><p>In reality, we had some extra steps because when we began the migration, Java 11 was not released yet, we could only use Java 10.<br />
The assumption was if the code compiles on Java 10, there will not be so much work to migrate to Java 11 as the biggest change about modularity was introduced with Java 9 and the Jigsaw project. Thankfully, it was the case!</p></blockquote>
<p><br clear="none" /></p>
<div style="max-width: 560px" class="wp-caption aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00092/star-wars-lightsaber-upgrade.png?resize=550%2C186&#038;ssl=1" alt="Star Wars lightsaber upgrade..." title="Star Wars lightsaber upgrade..." width="550" height="186" class="size-medium wp-image-257" /><p class="wp-caption-text">Star Wars lightsaber upgrade...</p></div>
<p><br clear="none" /></p>
<h4>1. Make the code compile with Java 11</h4>
<p>This was the longest part. Indeed, we had to bump the version up of most of the frameworks and tools we are using. Especially, we had to handle the migration from Spring Boot 1 to 2 and Spring 4 to 5. As these are major versions, we had to fix a couple of breaking changes.</p>
<p><strong>Spring Boot</strong></p>
<p>For Spring Boot 2, the official migration guides for <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes" target="_blank" title="Spring Boot 2.0 Release Notes" rel="noopener noreferrer">Spring Boot 2.0</a> and <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes" target="_blank" title="Spring Boot 2.1 Release Notes" rel="noopener noreferrer">Spring Boot 2.1</a> are well written and detailed.</p>
<ul>
<li>The <a href="https://github.com/spring-projects/spring-boot/issues/13151" target="_blank" title="Different profile precedence with Spring Boot 2" rel="noopener noreferrer">profile loading has evolved</a></li>
<li>The <a href="https://github.com/spring-projects/spring-boot/wiki/Relaxed-Binding-2.0" target="_blank" title="Spring Boot Relaxed Binding 2.0" rel="noopener noreferrer">relaxed binding of properties is a bit less relaxed</a></li>
<li>Some properties were renamed and others made unavailable (e.g. <code>security.basic.enabled</code> property that has to be replaced with a <code>WebSecurityConfigurerAdapter</code>)</li>
<li>Some endpoints were renamed (e.g. the actuator healthchecks)</li>
<li>The bean overriding is now disabled by default, which is something we were using in our integration tests, we had to re-enable it with the new property <code>spring.main.allow-bean-definition-overriding</code>.</li>
</ul>
<p><strong>Spring</strong></p>
<p>The <a href="https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x" target="_blank" title="Upgrading to Spring Framework 5.x" rel="noopener noreferrer">migration to Spring 5</a> was quite straightforward from a code point of view with few minor changes. The hard part was related to the fact the project is legacy and we had to deal with complex Spring XML configuration and the migration to Dropwizard Metrics 4.</p>
<p><strong>Misc</strong></p>
<p>Few frameworks are still not compatible with Java 9+ as they are not actively maintained by the community. In our case, we had to find a workaround for Cassandra Unit. We did not want to invest time to change of testing framework as we are planning to move to DynamoDB.</p>
<p>We also had to deal with the Maven dependency hell because some required dependencies were bringing old dependencies not compatible with Java 9+. In most of the cases, adding some exclusions in the POM solved it.</p>
<p><strong>Local environment</strong></p>
<p>Locally, we added a simple set of aliases to our bash profile file to switch between the Java versions.</p>
<pre class="brush: bash; light: true; title: ; notranslate">
alias setjava8=&quot;export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/&quot;
alias setjava10=&quot;export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/&quot;
alias setjava11=&quot;export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home/&quot;
</pre>
<p>On IntelliJ, changing of Java version can be done from the project settings (&#8220;Project SDK&#8221; dropdown).</p>
<p><strong>CI environment</strong></p>
<p>For the Continuous Integration side (we are using Bamboo), we updated the agent to use Java 11.<br />
We noticed that it’s not possible to have different versions of the agent for the branch plans and the master plan as the plan configuration is global. It means updating the agent to Java 11 will break master if someone else was pushing a change to master (e.g. a new feature or a bug fix totally independent from the Java 11 migration).<br />
To mitigate this issue and avoid a red build, it was important for us to make sure the project was compiling with Java 11 and that all tests were passing locally before updating the agent in order to merge the Java migration pull request quickly. Another option would be to set back the agent to Java 8 temporarily once the branch plan was green on Java 11 without forgetting to set it back to Java 11 just before the merge.</p>
<p><br clear="none" /></p>
<h4>2. Run the Java 11 compatible service on Java 8</h4>
<p>Once everything was fixed, merged and the master build was green, we had to ensure the Java 11 compatible version was running fine in our test environments. Basically make sure nothing was broken… We had unit, integration and end-to-end tests so our level of confidence was quite high. Just to be safe, we did some extra exploratory and manual testing on the API with some exotic and edge case requests to make sure it was behaving correctly. We also ensure the logs and Grafana dashboards were fine.</p>
<p>The next step was to push the new version in production. The service was still running with Java 8 even if the code was Java 11 compatible (and compiled), we did not want to introduce too many changes at the same time, we don’t like risky releases after all. We handle this release with extra care because of the multiple refactoring and versions bump up. After looking at the Grafana dashboards for a few days, comparing metrics before and after the migration, it shows that all went well.</p>
<p><br clear="none" /></p>
<h4>3. Run the service on Java 11</h4>
<p>The ultimate goal was to run the service on Java 11. In theory, it will be as simple as updating the Docker file to use the Java 11 image and push the artifact in production. However, in practice it was not that simple…</p>
<p>First of all, we had to update the Java JVM arguments  (the <a href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8180286" target="_blank" title="Remove the launchers data model flags" rel="noopener noreferrer"><code>-d64</code> parameter is deprecated</a> and will prevent the service to start, we also had to update the GC logs argument).</p>
<p>Then, we quickly realized that the service logs had disappeared from Splunk in our on-premises production environment, the logs were actually showing up in the future while it was working fine on AWS. We had to update the logback config to fix this “temporal distortion” ;) by updating the <a href="https://logback.qos.ch/manual/layouts.html#date" target="_blank" title="Logback date patterns" rel="noopener noreferrer"> date pattern</a> from <code>%d{ISO8601}</code> to <code>%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ,UTC}</code>.</p>
<p>We had another weird error <code>VerifyError: Bad type on operand stack</code> that arises during the deployment to production, AppDynamics was preventing some instances from starting due to some exotic bytecode manipulation. For some reason, it was fine on prod-canary, then started to fail after a successful deployment on a couple of instances! We had to disable AppDynamics, which was fine as we are not using this tool in our team.</p>
<p>As we were moving to Java 11, we also had to update some of our Grafana dashboards to reflect the use of a new Garbage Collector &#8211; G1.</p>
<p><br clear="none" /></p>
<h4>Conclusion</h4>
<p>Today, 3 services providing the user notifications using Spring Boot 2, and 1 service providing the website header &#038; footer using Spring 5 are running smoothly on Java 11, it has been several weeks now. They are using the default G1 Garbage Collector and we did not encounter any weird behavior related to memory footprint or any other performance issue. On the other hand, we did not see any improvement in our response time. But now we are using a Java LTS (Long Term Support) release, the migration was a success.</p>
<p>What&#8217;s next? <a href="https://openjdk.java.net/projects/jdk/12/" target="_blank" title="JDK 12" rel="noopener noreferrer">Java 12</a> is going to be released in March 2019. At this time, we still don’t know if we will use this version or wait for the next Java LTS. It will probably depend on which features are included.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/">A Java 11 migration successful story</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/" rel="bookmark" title="QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4998</post-id>	</item>
		<item>
		<title>Tips to make your WordPress website secure</title>
		<link>https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/</link>
					<comments>https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Wed, 10 Oct 2018 17:43:41 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hacker]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4945</guid>

					<description><![CDATA[<p>&#160;Version française disponible Update January, 14th, 2021 : Update security headers, replaced &#8220;Feature-policy&#8221; with &#8220;Permissions-policy&#8221;. WordPress is one of the most popular CMS (Content Management System). That popularity also means that it is a target of choice for hackers. In this article, I will give you some tips to keep your website secure and avoid [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/">Tips to make your WordPress website secure</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/11/01/some-basic-rules-to-prevent-your-accounts-from-getting-hacked/" rel="bookmark" title="Some basic rules to prevent your accounts from getting hacked">Some basic rules to prevent your accounts from getting hacked</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/05/11/first-steps-with-apache-camel/" rel="bookmark" title="First steps with Apache Camel">First steps with Apache Camel</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/15/optimize-your-website-for-print-in-5-minutes/" rel="bookmark" title="Optimize your website for print in 5 minutes">Optimize your website for print in 5 minutes</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2018/10/10/tips-to-make-your-wordpress-website-secure/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Update</strong><br />
<strong>January, 14th, 2021 : </strong> Update security headers, replaced &#8220;Feature-policy&#8221; with &#8220;Permissions-policy&#8221;.
</div>
<p>WordPress is one of the most popular CMS (Content Management System). That popularity also means that it is a target of choice for hackers.<br />
In this article, I will give you some tips to keep your website secure and avoid being attacked.</p>
<p><br clear="none" /></p>
<h4>1. Use latest versions</h4>
<p>This is true for WordPress itself but also for all your extensions. There are new versions available regularly. If a plugin has not been updated for a while, it is probably not maintained anymore and you might need to remove or replace it. This is also applicable for your theme.<br />
The version of PHP is also important, check with your hosting provider that you are running the latest version of PHP (7.X), especially <a href="https://www.php.net/supported-versions.php" target="_blank" title="PHP supported versions" rel="noopener noreferrer">the versions 5.X won&#8217;t be supported by the end of the year</a>.<br />
Also, note that the more extensions you have installed, the more risk you are taking, as your WordPress configuration will rely on more 3rd party code. You should only keep the plugins that you really need. If a plugin is disabled, don&#8217;t keep its source code and remove all its associated files.</p>
<p><br clear="none" /></p>
<h4>2. Use secure login details</h4>
<p>Never use the default admin user. If you do, disable this account and create your own account with a personalized username.<br />
Choose a <a href="https://blog.fabianpiau.com/en/2013/11/01/some-basic-rules-to-prevent-your-accounts-from-getting-hacked/" target="_blank" title="Some basic rules to prevent your accounts from getting hacked" rel="noopener noreferrer">strong password</a>. If several users are managing your website, make sure the permissions are valid and avoid giving the admin permission to everyone.</p>
<p><br clear="none" /></p>
<h4>3. Scan your website</h4>
<p>This is an easy and quick  way to find vulnerabilities and see if one of your plugins is vulnerable or not. You can use these 2 online tools:</p>
<ul>
<li><a href="https://hackertarget.com/wordpress-security-scan/" target="_blank" title="WordPress Security Scan" rel="noopener noreferrer">WordPress Security Scan</a> (my favourite with a detailed report)</li>
<li><a href="https://wpsec.com/" target="_blank" title="WPScans" rel="noopener noreferrer">WPSec</a></li>
</ul>
<p><br clear="none" /></p>
<h4>4. Use .htaccess files to protect your directories</h4>
<p>The <code>.htaccess</code> file is a server configuration file. It allows you to define rules for your server to follow. </p>
<p>For example, in <code>/wp-content/uploads</code>, I have created the following <code>.htaccess</code>:</p>
<pre class="brush: xml; title: ; notranslate">
# Deny access to everything by default
Order deny,allow
Deny from all

# Allow access to media files
&lt;FilesMatch '\.(jpg|jpeg|png|gif|bmp|zip|rar|pdf)$'&gt;
    Allow from all
&lt;/FilesMatch&gt;
</pre>
<p>This config ensures only media files are accessible from the browser, any JavaScript, PHP files will be discarded. It is not 100% bulletproof as only the extension is checked, but it is better than nothing.</p>
<p>To avoid execution of malicious PHP in some folder (e.g. in <code>/wp-includes</code>), you can create another <code>.htaccess</code> file with the following content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;Files *.php&gt;
Order allow,deny
Deny from all
&lt;/Files&gt;
</pre>
<p><br clear="none" /></p>
<h4>5. Review file and directory permission</h4>
<p>Make sure the critical files (<code>wp-config.php</code>, <code>php.ini</code>&#8230;) are not writable publicly, only readable. Only owners should be able to write.</p>
<p><br clear="none" /></p>
<h4>6. Use security headers</h4>
<p>You can check <a href="https://securityheaders.com/" target="_blank" title="Security Headers Online Tool" rel="noopener noreferrer">which security headers you currently use with this online tool</a>.</p>
<p>At the root folder, update the <code>.htaccess</code> file and add:</p>
<pre class="brush: xml; title: ; notranslate">
# Extra Security Headers
&lt;IfModule mod_headers.c&gt;
	Header set Strict-Transport-Security 'max-age=31536000; includeSubDomains'
	Header set X-XSS-Protection '1; mode=block'
	Header set X-Frame-Options 'sameorigin'
	Header set X-Content-Type-Options 'nosniff'
	Header unset Server
	Header always unset X-Powered-By
	Header unset X-Powered-By
	Header unset X-CF-Powered-By
	Header unset X-Mod-Pagespeed
	Header unset X-Pingback
&lt;/IfModule&gt;
</pre>
<p>In <code>wp-config.php</code>, add:</p>
<pre class="brush: xml; title: ; notranslate">
/** Extra Security */
header('X-Frame-Options: SAMEORIGIN');
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
header('Strict-Transport-Security:max-age=31536000; includeSubdomains; preload');
header('Referrer-Policy: no-referrer-when-downgrade');
header('Content-Security-Policy: upgrade-insecure-requests');
header('Permissions-Policy: autoplay=(), camera=(), encrypted-media=(), fullscreen=(), geolocation=(), microphone=(), midi=(), payment=()');
header_remove('X-Powered-By');
header_remove('Server');
header_remove('X-CF-Powered-By');
header_remove('X-Mod-Pagespeed');
header_remove('X-Pingback');
@ini_set('session.cookie_httponly', true);
@ini_set('session.cookie_secure', true);
@ini_set('session.use_only_cookies', true);
</pre>
<p><br clear="none" /></p>
<h4>7. Do not expose too much information</h4>
<p>At the root folder of your website, in <code>php.ini</code>, add the line:</p>
<pre class="brush: xml; light: true; title: ; notranslate">
expose_php = Off
</pre>
<p>Your current version of PHP will not be exposed.</p>
<p><br clear="none" /></p>
<h4>8. Backup your website regularly</h4>
<p>Last but not least! You don&#8217;t need a particular software or extra plugin to achieve this.</p>
<ul>
<li>With your favourite FTP tool (e.g. <a href="https://filezilla-project.org/" target="_blank" title="Filezilla" rel="noopener noreferrer">Filezilla</a>), save all the files available on your server.</li>
<li>For the database, use the available MySQL backup feature. Many hosting companies provide access to phpMyAdmin, an online tool.</li>
</ul>
<p>I recommend doing a backup every month, and keep the history of the last 6 backups somewhere safe. Of course, it depends on the volume of articles you are writing and how critical is your data.</p>
<p><br clear="none" /></p>
<p>That&#8217;s it! If you have done all the above, your website should be more resilient to attacks. In the worst case, you should be able to recover easily.</p>
<p>Happy safe blogging!</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/">Tips to make your WordPress website secure</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/11/01/some-basic-rules-to-prevent-your-accounts-from-getting-hacked/" rel="bookmark" title="Some basic rules to prevent your accounts from getting hacked">Some basic rules to prevent your accounts from getting hacked</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/05/11/first-steps-with-apache-camel/" rel="bookmark" title="First steps with Apache Camel">First steps with Apache Camel</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/15/optimize-your-website-for-print-in-5-minutes/" rel="bookmark" title="Optimize your website for print in 5 minutes">Optimize your website for print in 5 minutes</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4945</post-id>	</item>
		<item>
		<title>Devoxx UK 2018 &#8211; Day 2</title>
		<link>https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/</link>
					<comments>https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Wed, 06 Jun 2018 10:52:37 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[devoxx]]></category>
		<category><![CDATA[london]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4648</guid>

					<description><![CDATA[<p>&#160;Version française disponible This year I attended the 2 days of conference at Devoxx UK taking place in London on 10-11th May. This article is a summary of the notes I took during the second day. You can read the previous article talking about my first day. And if you&#8217;re interested in more details in [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/">Devoxx UK 2018 &#8211; Day 2</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/" rel="bookmark" title="Bot Attacks: You are not alone&#8230;">Bot Attacks: You are not alone&#8230;</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/" rel="bookmark" title="Microservices architecture &#8211; Best practices">Microservices architecture &#8211; Best practices</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2018/06/06/devoxx-uk-day-2/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>This year I attended the 2 days of conference at <a href="https://www.devoxx.co.uk/" target="_blank" title="Devoxx UK" rel="noopener noreferrer">Devoxx UK</a> taking place in London on 10-11th May. This article is a summary of the notes I took during the second day. You can read <a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" title="Devoxx UK 2018 - Day 1">the previous article talking about my first day</a>. And if you&#8217;re interested in more details in a talk, you can watch the associated video.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00091/devoxx-3.jpg?ssl=1" rel="shadowbox[sbpost-4648];player=img;" title="Devoxx UK took place in the Business Design Centre in London"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00091/devoxx-3-thumbnail.jpg?resize=550%2C367&#038;ssl=1" alt="Devoxx UK took place in the Business Design Centre in London" title="Devoxx UK took place in the Business Design Centre in London" width="550" height="367" class="size-medium wp-image-259" /></a><p class="wp-caption-text">Devoxx UK took place in the Business Design Centre in London</p></div>
<p><br clear="none" /></p>
<h4>Deep Learning: The Future of Artificial Intelligence, with Matthew Renze</h4>
<p>In the past, we had to explicitly program a computer step by step to get it to solve a problem (involving if-then statements, for loops and other logical operations). In the future, machines are going to teach themselves how to solve a problem on their own, we just have to provide the data.</p>
<p><br clear="none" /></p>
<p><strong>What is Deep Learning?</strong></p>
<p>Deep Learning is a form of Artificial Intelligence (AI) that uses a type of Machine Learning (ML) called an Artificial Neural Network with multiple hidden layers in attempt to learn hierarchical representations of the underlying data in order to make predictions given new data.</p>
<p>Machine Learning in essence is the application of Statistics to the problems of Artificial Intelligence. We are teaching machines how to solve problems by identifying statistical patterns in data.</p>
<p>Use (existing) <strong>Data</strong> -> to learn a <strong>Function</strong> -> in order to do a <strong>Prediction</strong> (on new data)</p>
<p>A neural network is a ML algorithm based on a very crude approximation of the way how we used to believe the brain and the neurons are working (the brain is still a black box for scientists).</p>
<p>An artificial neuron takes a set of inputs, applies a function to produce a set of outputs. We represent this neuron mathematically (i.e. inputs and outputs are numbers) so we can use it in a computational model.</p>
<p>A neural network is composed of several neurons organized into different layers: the input layer (the data we feed), 1 or more hidden layers and the output layer (the prediction). A deep neural network contains more than one hidden layer. Adding more than one hidden layer essentially allows us to model much more complex function than a simple single layer.</p>
<p><br clear="none" /></p>
<p><strong>An example of Deep Learning</strong></p>
<p>An example of deep neural network is a person recognition model based on a picture. The lower hidden layers represents more abstract shapes like geometric primitives (e.g. horizontal, vertical lines) while the intermediate layers are representing more complex features like specific parts of the body (mouth, nose, eye, etc.) and the highest hidden layer will represent the face and ultimately be able to identify the person. The accuracy is increasing as we are approaching the last layer and ultimately make a prediction.</p>
<p><br clear="none" /></p>
<p><strong>Why are we talking about Deep Learning only now?</strong></p>
<p>After all, the <a href="https://en.wikipedia.org/wiki/Perceptron" target="_blank" title="Perceptron on Wikipedia" rel="noopener noreferrer">first ML algorithm Perceptron</a> was created in 1957, more than 60 years ago!</p>
<ul>
<li>We live in the era of Big Data. In the past 2 years, we have created more data than the entire rest of human history. We never had so much data available, this data is essential to train complex models.</li>
<li>Computers have never been so powerful: faster CPUs, more memory, solid-state drive. We can leverage the power of GPUs, matrix operations is something needed for video game graphics but also for ML. We also have access to distributed computing technologies where we can share the data processing between multiple machines.</li>
</ul>
<p><br clear="none" /></p>
<p><strong>What can we do with Machine Learning?</strong></p>
<ul>
<li>Classification.  We want to predict a discrete variable that can only take on a certain number of values. Is it a cat or a dog? Is this email a spam or not? Does this person have a cancer or not? What is the category of this article?</li>
<li>Regression. We want to predict a continuous variable that has an infinite number of possible values. At what price should I sell this house? What is the credit score of this person?</li>
<li>Text generation. Generate the title of an article, the description of an image based on its content, convert voice to text for automatic subtitles.</li>
<li>Image generation. Simulate face aging, <a href="https://www.youtube.com/watch?v=IuygOYZ1Ngo" target="_blank" title="The Next Rembrandt" rel="nobox noopener noreferrer">paint a new Rembrandt</a> that even expert could not identify as a fake, <a href="https://www.nytimes.com/interactive/2018/01/02/technology/ai-generated-photos.html" target="_blank" title="How an A.I. ‘Cat-and-Mouse Game’
Generates Believable Fake Photos" rel="noopener noreferrer">create celebrities</a> that look familiar but don&#8217;t exist, <a href="https://github.com/hanzhanggit/StackGAN" target="_blank" title="StackGAN: Text to Photo-realistic Image Synthesis" rel="noopener noreferrer">create an image based on a description</a>.</li>
<li>Audio generation. <a href="https://www.youtube.com/watch?v=D5VN56jQMWM" target="_blank" title="Google Duplex: A.I. Assistant Calls Local Businesses To Make Appointments" rel="nobox noopener noreferrer">Make an algorithm talk to a human</a> on a phone call (Google Duplex), <a href="https://www.youtube.com/watch?v=I3l4XLZ59iw" target="_blank" title="#VoCo. Adobe MAX 2016 (Sneak Peeks) | Adobe Creative Cloud" rel="nobox noopener noreferrer">change your voice</a> based on a text (voice editing) to avoid recording your voice again in case you got it wrong.</li>
<li>Video generation. Based on rushes of videos and audios from Barack Obama, create a <a href="https://www.youtube.com/watch?v=9Yq67CjDqvw" target="_blank" title="Synthesizing Obama: Learning Lip Sync from Audio" rel="nobox noopener noreferrer">new video with an AI-powered lip sync</a>.</li>
</ul>
<p>If you have browsed some of the examples above, you will probably find very challenging to differentiate between a real and a computer-generated content. That is quite scary when you think about it and we can barely imagine how it will be in 10 years!</p>
<p><br clear="none" /></p>
<p><strong>How do I get started if I want to do ML in my company?</strong></p>
<p><strong>Option 1 &#8211; Deep Learning as a Service</strong> (Google Cloud, AWS, Microsoft Cognitives, IBM Watson&#8230;)<br />
It involves a 3rd party company that owns the model and the data. Basically, you can query their API with your new data in order to make a prediction.<br />
This option is good for narrow use cases, if you don&#8217;t want to reinvent the wheel and use an already trained model.<br />
Pro: Simple, quick, inexpensive<br />
Cons: Narrow, remote (e.g. you are not protected against network failures or latency), pay-per-use (if your usage increases, so will be the cost)</p>
<p><strong>Option 2 &#8211; Deep Learning platform</strong> (Microsoft Azure, Cognitive Services&#8230;)<br />
This option is good for custom use cases. You upload your data to train the model (transfer learning) then you can query an API to get your predictions.<br />
Pro: Simple, quick, inexpensive<br />
Cons: You need training data to train your model, remote, pay-per-use (per transaction for the prediction but also the transactions for the training)</p>
<p><strong>Option 3 &#8211; Do it yourself</strong> (TensorFlow, Torch&#8230;)<br />
To use if option 1 and 2 fail. You create from scratch your own algorithm, provide the data and host it yourself.<br />
Pro: Custom (you can tune it as you like), local, private (in case you are dealing with sensitive data)<br />
Cons: Complex, labor, expensive</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/AktmFvRVPsI?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Teaching kids about machine learning, with Dale Lane</h4>
<p>Dale has created <a href="https://machinelearningforkids.co.uk/" target="_blank" title="Machine Learning for Kids" rel="noopener noreferrer">a website to teach kids about Machine Learning</a> using the visual programming language platform <a href="https://scratch.mit.edu/" target="_blank" title="Scratch - Imagine, Program, Share" rel="noopener noreferrer">Scratch</a>. Scratch is a way to introduce programming to kids with a simple interface where you can drag and drop blocks representing programming operations (for loops, if-then statements&#8230;) and assemble them to create more advanced logic. Dale is using <a href="https://en.scratch-wiki.info/wiki/ScratchX" target="_blank" title="Experimental Extensions to Scratch!" rel="noopener noreferrer">ScratchX</a> (experimental extensions for Scratch) and has created new blocks related to Machine Learning (using IBM Watson under the hood).</p>
<p><br clear="none" /></p>
<p>He has invented many exercises so the kids can grasp the different concepts of ML using concrete and fun examples. The exercises are mixing text, number and image recognition. Each exercise is usually composed of a phase when you train the model from the web application, then you can evaluate the prediction with Scratch. You can also refine the training set and see the effects on the model predictions.</p>
<ul>
<li>Create a chatbot, e.g. an animal that can answer questions about its species.</li>
<li>Predict the newspaper an article was extracted from based on its title.</li>
<li>Make Pacman avoid ghosts by playing the game multiple times. The more you play and train the model, the better Pacman gets.</li>
<li>Categorize images. Uploading images of cups and cars to train the model, so it can classify a new and unknown image to one of these 2 categories. Uploading images of book cover for different categories (sci-fi, romance, thriller&#8230;) then the model can predict the category of a new cover. To make it more interactive you can also upload images from the webcam, for example take pictures of your hand for the game rock / paper / scissors and play against the computer. The algorithm will recognize the shape you are doing with your hands if you train it enough.</li>
<li>Recognize handwritten postcode to figure out which city the mail should be delivered to. That&#8217;s a good real-life example.</li>
<li>Play where is Wally-like games. The computer automatically detects where Scratch the cat is located in a picture.</li>
<li>And many other exercises.</li>
</ul>
<p><br clear="none" /></p>
<p>Dale also mentioned the problems of AI:</p>
<ul>
<li>Issue with background, weather conditions. If it is obvious for a human, a computer can make silly mistakes if the training set is incomplete.</li>
<li>The Russian tank story where the model was trained with high resolution pictures of American tanks but low resolution and blurry pictures of Russian tanks. It performs really poorly to identify tanks in reality.</li>
<li>Google photo can add automatically text to describe a picture, some black people were categorized as gorillas&#8230;</li>
<li>A model that can advise medicine but is sponsored by a pharmaceutical company. What if the company asks to add more references of its product in the training set, is that something right?</li>
</ul>
<p>There are a lot of important notions around ethics, bias, model overfitting and the quality of the training set. It&#8217;s important that kids understand about these by themselves, and they usually do!</p>
<p><br clear="none" /></p>
<p>At the end, Dale gave use some links to go further:</p>
<ul>
<li><a href="https://machinelearningforkids.co.uk" target="_blank" title="Machine Learning for Kids" rel="noopener noreferrer">Machine Learning for Kids</a> the website of Dale where you can find all the exercises.</li>
<li><a href="https://teachablemachine.withgoogle.com" target="_blank" title="Teachable Machine from Google" rel="noopener noreferrer">Teachable Machine from Google</a> to train a model with your webcam.</li>
<li><a href="https://quickdraw.withgoogle.com" target="_blank" title="Quick, Draw! from Google" rel="noopener noreferrer">Quick, Draw! from Google</a> to recognize a drawing.</li>
<li><a href="https://www.moralmachine.net/" target="_blank" title="Moral Machine - MIT" rel="noopener noreferrer">Moral Machine from MIT</a> to judge different scenario involving a self-driving car.</li>
</ul>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/h2KqwwfKOuY?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Easy Microservices with JHipster, with Sendil Kumar N</h4>
<p>This presentation was a live-coding session. I heard about <a href="https://www.jhipster.tech/" target="_blank" title="JHipster, Generate your Spring Boot + Angular/React applications!" rel="noopener noreferrer">JHipster</a> a while ago but never had the opportunity to see it in action and the fact the project was initiated by a French developer was another reason to go.</p>
<p>JHipster is making the creation of new applications faster by generating the boiler plate code and dealing with most of the configuration (for example the configuration for Kubernetes, Maven POM files, etc.). It is a command-line tool where you can choose to create a monolith application, a microservice or a UAA (User Accounting and Authorizing service for securing your app using OAuth2). Once you have chosen your type of application, there are many options you can choose for your tech stack: frontend, backend, data source, build, logging, deployment CI/CD, service registry, documentation (e.g. <a href="https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/" title="Swagger, the automated API documentation">Swagger</a>), testing frameworks.</p>
<p>For the demo, Sendil has created a gateway application that was querying a microservice application. He ran the app locally and then deployed it on Google Cloud Platform (GCP) via Kubernetes, without having to type a single line of code.</p>
<p>Decide the frameworks and technologies you want to use will probably be the tough part as there are so many options. Also you have to keep in mind you need to fine-tune the configuration (e.g. the default config they provide for Kubernetes may not suit your needs).</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/zW4GOiZUKuE?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Troubleshooting &#038; Debugging Production Microservices in Kubernetes, with Ray Tsang</h4>
<p>Ray shows us a little Guest book application where a user can post a message with a name (Guestbook service) and also get greetings after posting (Hello service). This is a Spring Boot application deployed on Kubernetes, and made of an UI and 2 microservices (each one with multiple instances). A 500 error page was showing up when he tried to access it indicating <code>null</code> and a 404. This time, it was not a demo effect or an illustration of Murphy&#8217;s Law and was part of the presentation. He went through the process of debugging the issue step by step using a <a href="https://cloud.google.com/products/" target="_blank" title="Products and Services provided by Google Cloud" rel="noopener noreferrer">variety of tools provided by Google Cloud Platform</a>.</p>
<p><br clear="none" /></p>
<p>Looking at the logs, he was able to identify 2 instances of the UI service that were having a lot of errors compared to the other instances. Kill/restart them is not the solution as it won&#8217;t prevent the error from happening again. So he decided to get one of the faulty instances out of the load balancer with one command in <code>kubectl</code> (a command line interface for running commands against Kubernetes clusters) by changing the <code>serving</code> flag to false. The idea is to isolate it from production traffic and be free to debug it. Note that by disabling the instance, Kubernetes automatically spins up a new instance of the service. Then he configured the port forwarding on this pod to be able to query this specific instance locally. With Stackdriver Trace, he was able to see the call tracing. Filtering on 5xx errors and the particular instance, he then realized an issue occurred at the Hello service level where the hello endpoint is called but responded with 404. It seemed to be the case when the name was missing. To confirm the behaviour, he added some logging on the fly to display the name, and indeed it was empty and the app was failing. Basically, some validation was missing on the form to make the name mandatory.</p>
<p><br clear="none" /></p>
<p>To recap, we can mention the <a href="https://cloud.google.com/products/operations" target="_blank" title="Monitoring, logging, and diagnostics for applications on Cloud Platform and AWS" rel="noopener noreferrer">4 main debugging tools provided with GCP</a>:</p>
<ul>
<li>Browsing and querying the logs with Stackdriver Logging (a Splunk-like tool)</li>
<li>Tracing all the calls with Stackdriver Trace (a Zipkin-like tool)</li>
<li>Adding debug logs and breakpoints on the fly to a prod instance with Stackdriver Debug</li>
<li>Having the history of errors in the logs plus various metrics on the services (response time&#8230;) with Stackdriver Monitoring</li>
</ul>
<p><br clear="none" /></p>
<p>It was a nice presentation but I can just regret that the title was not mentioning the fact the demo will mainly use Google Cloud commercial tools, I thought it will be more focus on Kubernetes. But still worth it to know what Google is providing. I have to admit that playing with breakpoints and adding logs in the code of a remote prod instance, all from a web interface, was quite impressive.</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/59yCUlQAe-s?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Fully serverless, a case study, with Stephen Colebourne &#038; Chris Kent</h4>
<p>At OpenGamma, they have created a new financial platform built on AWS and decided to use serverless technologies (<a href="https://aws.amazon.com/lambda/" target="_blank" title="AWS Lambda" rel="noopener noreferrer">AWS Lambda</a>).</p>
<p><br clear="none" /></p>
<p><strong>What is serverless and Lambda?</strong></p>
<p>Serverless is basically when the infrastructure is invisible, you don&#8217;t know where the code runs and you don&#8217;t have control.<br />
An AWS Lambda is basically made of 2 classes: a simple interface and its implementation, where you implement the <code>handleRequest</code> method. The Lambda terminates once the method completes.<br />
You package the code in a JAR (that includes all the needed dependencies) and upload it in AWS to be run.</p>
<p><br clear="none" /></p>
<p><strong>How can you trigger a Lambda?</strong></p>
<ul>
<li>You can use <a href="https://aws.amazon.com/cloudwatch/" target="_blank" title="Amazon CloudWatch" rel="noopener noreferrer">CloudWatch</a> (CRON-like).</li>
<li>You can use an event. It can be a REST API call, a file is saved in AWS S3, a message arrives in a queue, a row is added to a table or a call directly from another Lambda.</li>
</ul>
<p><br clear="none" /></p>
<p><strong>Limits, limits everywhere!</strong></p>
<p>When working with Lambdas, you have to be very careful with <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html" target="_blank" title="AWS Lambda Limits" rel="noopener noreferrer">the AWS Lambda Limits</a>.</p>
<ul>
<li>A default timeout of execution: 5 minutes</li>
<li>A maximum amount of memory you can use: 3GB</li>
<li>A maximum size for a JAR file that you can upload: 50Mb</li>
<li>A maximum of disk space you can use: 512Mb</li>
</ul>
<p><br clear="none" /></p>
<p>For some specific heavy processing, they hit most of these limits and they had to find different ways to handle it:</p>
<ul>
<li>Use <a href="https://aws.amazon.com/batch/" target="_blank" title="AWS Batch - Fully Managed Batch Processing at Any Scale" rel="noopener noreferrer">AWS Batch</a> instead which includes serverless features too, the only downside is that they cannot trigger the process instantly, i.e. when you submit a batch job, it will be processed at some point but you cannot assume it will be instant (can be in 2 or even 10 minutes). This limitation was fine for them, obviously this won&#8217;t work for everyone.</li>
<li>Split and pre-process the data as much as possible before passing it to the Lambda. The Lambda should not do any of this time and memory consuming pre-processing. Also as the data is loaded on demand, it introduces some latency but it was acceptable for them.</li>
<li>Instead of passing a copy of the data between Lambdas which can be memory/network consuming and costly, they save the data in S3 and then use the reference to it (metadata).</li>
</ul>
<p>They have ended up with 4 services, formed of a total of 23 Lambdas and 2 Batch.</p>
<p><br clear="none" /></p>
<p><strong>Lessons learned</strong></p>
<p>The automatic scaling with Lambda is the main benefit. It is totally transparent and managed by AWS. When there is a lot of requests, Lambda are created and share the load. When all requests have been processed, the Lambdas are scaling down (to 0 when idle). However, it&#8217;s not a silver bullet because you can have a bottle neck at another level of your system (e.g. your data store is too slow) and you will not be able to fully leverage Lambda scalability.</p>
<p>A downside of the Lambdas is the cold start, it takes time to start. In fact, a Lambda is not really destroyed after it completes, as it can be re-used for the next request, AWS has a keep-alive mechanism, which means Lambdas typically live for few minutes after they execute. They decided to call the Lambda with a bit of code every few minutes to keep it available and &#8220;warm&#8221;. Obviously, it&#8217;s a hack and it&#8217;s not guaranteed that it will still work in the future, but Chris told us it was quite common&#8230;</p>
<p>For the debugging, things are not easy, you need to deploy to AWS to test, it&#8217;s hard to debug. Nowadays there are libraries and frameworks to help you do that.</p>
<p>The logs from the Lambdas are going into AWS CloudWatch Logs. This tool is not great for usability so they have created a Lambda to copy logs from AWS to a dedicated log aggregator tool: <a href="https://www.sumologic.com/" target="_blank" title="Sumo Logic: Log Management and Security Analytics, Continuous Intelligence" rel="noopener noreferrer">Sumo Logic</a>, a Splunk-like tool. For the alerts and monitoring, they use CloudWatch Metrics and they have set up alerts in Sumo Logic too that makes it easier to find the logs.</p>
<p>Building from small simple pieces pushes the complexity elsewhere at the infrastructure level (during build time) and also the interactions between the components (during run time). The monitoring and alerting is also more complex as the system becomes even more fragmented. It is important to keep in mind that a Lambda has very restrictive limits, go above one and your Lambda will be killed. Note that the limits are evolving and are lifted overtime. The technology is still young and the tooling and frameworks available is quite limited, but given the level of excitement around Lambda, it&#8217;s clear that it&#8217;s going to improve.</p>
<p>On the other hand, you don&#8217;t need to think about servers and maintaining them. The scaling is transparent and automatically handles the load. You have large potential cost savings using Lambda, for example, in case your system is country-specific, you know that the traffic will be very limited at night hours. Finally, the programming model is very simple, just a JAR file, just a function.</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/8mj-Q_oknd8?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<p>This second day at Devoxx was great, especially the talks in the morning about Machine Learning. I came out of these 2 days with a lot of innovative ideas. Thanks Devoxx UK and maybe see you next year again!</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00091/devoxx-4.jpg?ssl=1" rel="shadowbox[sbpost-4648];player=img;" title="Closing Keynote - Thanks Devoxx UK!"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00091/devoxx-4-thumbnail.jpg?resize=550%2C367&#038;ssl=1" alt="Closing Keynote - Thanks Devoxx UK!" title="Closing Keynote - Thanks Devoxx UK!" width="550" height="367" class="size-medium wp-image-260" /></a><p class="wp-caption-text">Closing Keynote - Thanks Devoxx UK!</p></div>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/">Devoxx UK 2018 &#8211; Day 2</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/" rel="bookmark" title="Bot Attacks: You are not alone&#8230;">Bot Attacks: You are not alone&#8230;</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/" rel="bookmark" title="Microservices architecture &#8211; Best practices">Microservices architecture &#8211; Best practices</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4648</post-id>	</item>
		<item>
		<title>Devoxx UK 2018 &#8211; Day 1</title>
		<link>https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/</link>
					<comments>https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 21 May 2018 21:46:35 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[devoxx]]></category>
		<category><![CDATA[london]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4587</guid>

					<description><![CDATA[<p>&#160;Version française disponible This year I attended the 2 days of conference at Devoxx UK taking place in London on 10-11th May. This article is a summary of the notes I took during the first day. If you&#8217;re interested in more details in a talk, you can watch the associated video. A Future without Servers, [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/">Devoxx UK 2018 &#8211; Day 1</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/02/20/fosdem-2013-impressions/" rel="bookmark" title="Fosdem 2013 Impressions">Fosdem 2013 Impressions</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2018/05/21/devoxx-uk-day-1/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>This year I attended the 2 days of conference at <a href="https://www.devoxx.co.uk/" target="_blank" title="Devoxx UK" rel="noopener noreferrer">Devoxx UK</a> taking place in London on 10-11th May. This article is a summary of the notes I took during the first day. If you&#8217;re interested in more details in a talk, you can watch the associated video.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00090/devoxx-1.jpg?ssl=1" rel="shadowbox[sbpost-4587];player=img;" title="Devoxx UK took place in the Business Design Centre in London"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00090/devoxx-1-thumbnail.jpg?resize=550%2C367&#038;ssl=1" alt="Devoxx UK took place in the Business Design Centre in London" title="Devoxx UK took place in the Business Design Centre in London" width="550" height="367" class="size-medium wp-image-259" /></a><p class="wp-caption-text">Devoxx UK took place in the Business Design Centre in London</p></div>
<p><br clear="none" /></p>
<h4>A Future without Servers, with Danilo Poccia</h4>
<p><strong>How to build the best software with the best user experience?</strong></p>
<p>Work backwards from the customer and before starting any implementation:</p>
<ol>
<li>Write a Press Release</li>
<li>Write the FAQ</li>
<li>Define the Customer experience</li>
<li>Write the User manual</li>
</ol>
<p>The idea is to get your system simple. A complex system was simple at the beginning, it became complex!</p>
<p><strong>Architecture is changing:</strong></p>
<ul>
<li>10 years ago: we are splitting our monolith applications using XML and SOAP for the communication</li>
<li>5 years ago: we are creating micro services architecture using REST/JSON or binary protocol for the communication</li>
<li>Now: we are building event-driven architecture with ephemeral functions</li>
</ul>
<p><strong>What about the data?</strong></p>
<p>Data repositories are becoming a source of events. Each event is an immutable information about business.</p>
<p>There is a shift from ACID (Atomic, Consistent, Isolated, Durable) to ACID 2.0 (Associative, Commutative, Idempotent, Distributed).</p>
<p>With event-driven design, we think cause / effect instead of triggers: &#8220;Service B is caused by A&#8221; instead of &#8220;Service A triggers B&#8221;. We use notification and acknowledgement mechanism.</p>
<p><strong>So what does the future will look like?</strong></p>
<p>We will write only business logic code!</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/Ztjdnqf-674?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Let&#8217;s Get Lazy: Exploring the Real Power of Streams, with Venkat Subramaniam</h4>
<p>Venkat Subramaniam is a very good speaker. It was the first time I was hearing him and I was impressed by his way of presenting, I suggest you to watch one of his videos.</p>
<p>Haskell is a lazy language by default. With Scala, it&#8217;s possible by using the keyword &#8220;lazy&#8221;. But what about Java? The keyword &#8220;lazy&#8221; doesn&#8217;t exist but it&#8217;s possible with functional code and streams introduced with Java 8.</p>
<p>Imperative code has high ceremony and has accidental complexity. You tell what to do and how to do it.</p>
<p>Functional code has less ceremony and less complexity. You tell what to do. It is very easy to read from top to bottom.</p>
<p>However, if the code is &#8220;cute&#8221;, it may not be sustainable. So what about performance? E.g. Do we compute all the collection to take only the first one? <code>FindFirst()</code> is the terminal operation of execution. Until we call it, nothing (i.e. all the intermediate operations) will be executed.</p>
<p>Stream does not execute a function for every object in the collection, instead it executes a collection of functions for every object, but only as needed.</p>
<p>Stream is not a collection of objects, it&#8217;s a collection of functions.</p>
<p>Lambda are stateless.</p>
<pre class="brush: java; highlight: [3]; title: ; notranslate">
List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3);
Stream&lt;Integer&gt; stream = numbers.stream()
                            .map (e -&gt; e * 2); // This is a lambda
stream.forEach(System.out::println);
</pre>
<p>Closure carry immutable state, be very careful when using them.</p>
<pre class="brush: java; highlight: [4]; title: ; notranslate">
List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3);
final int factor = 2;
Stream&lt;Integer&gt; stream = numbers.stream()
                            .map (e -&gt; e * factor); // This is a closure
stream.forEach(System.out::println);
</pre>
<p>Laziness makes the use of infinite streams possible, otherwise the program below would be an infinite loop.</p>
<pre class="brush: java; highlight: [1]; title: ; notranslate">
Stream&lt;Integer&gt; infiniteStream = Stream.iterate(0, e -&gt; e + 1);
List&lt;Integer&gt; numbers = infiniteStream 
                          .limit(5)
                          .collect(Collectors.toList());
</pre>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/ekFPGD2g-ps?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Kotlin for Java Programmers, with Venkat Subramaniam</h4>
<p>I stayed in the same room as I really like Venkat&#8217;s first talk. With the same way of presenting, this second talk was very good as well.</p>
<p>As I never experiment Kotlin, it was a nice introduction for me. This JVM-based language is really getting popular these days, especially since Jetbrain is pushing it to be the main language for Android programming. Venkat gave us a lot of different tricks to make the code concise and suggest us to play with it ourselves using the REPL (kotlinc). No doubt it is less verbose than Java and comes with very nice features (including null safety and the lazy keyword&#8230;). I will probably give it a try at some point.</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/KvmlP3ReZcA?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>How to use AI and Java to train your application to recognize people by name, with Ruth Yakubu</h4>
<p>Ruth introduced us <a href="https://azure.microsoft.com/en-gb/services/cognitive-services/face/" target="_blank" title="Microsoft Face API" rel="noopener noreferrer">Microsoft Face API</a> running on its cloud computing platform Azure. Face API is one of the &#8220;cognitive&#8221; services Microsoft provides, e.g. there is a service to recognize speech and process natural language.</p>
<p>She showed us an application written with Spring Boot that is interacting with Face API. First, she uploaded a set of pictures of the actor Matthew McConaughey (if you don&#8217;t know him, he was the main character in Interstellar) to train the model. Then she uploaded a new picture of him and his wife that the system did not know yet. The algorithm recognizes that it was the actor with a high precision while it did not know who the woman was but it was able to give an accurate description of her (smiley woman in her thirties, etc.).</p>
<p>It is possible to build your own Machine Learning algorithm with Java, for example using the library <a href="https://deeplearning4j.konduit.ai" target="_blank" title="DeepLearning4J" rel="noopener noreferrer">DeepLearning4J</a>. When creating a model, it is important to separate the data into 2 groups, training data (80%) and test data (20%) so you can verify your model has a good prediction. It is also important to use GPUs not only CPUs to improve the performances, now the libraries are taking advantage of this, including <a href="https://deeplearning4j.konduit.ai/multi-project/explanation/configuration/backends" target="_blank" title="DeepLearning4J using the GPU" rel="noopener noreferrer">DL4J</a>. </p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/bzSqrmefnV0?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Building a self-driving RC car, with Tim van Eijndhoven</h4>
<p>It was an interesting talk to create a self-driving (toy) car based on a Radio Control (RC) kit. They build this prototype as part of a challenge. The idea is to get the car to drive autonomously and follow an itinerary (a path delimited by 2 white lines) with potential curves and obstacles.</p>
<blockquote><p>If Tesla can do it, why not us? At our scale, of course&#8230;</p></blockquote>
<p>On top of the RC kit, they added a Raspberry Pi, a power convertor/supply, a camera and a safe shutdown (useful when the car gets out of range of the WiFi so it doesn&#8217;t crash somewhere&#8230;). The total budget is around 300 euros.</p>
<p>Regarding the technologies they use:</p>
<ul>
<li>Vert.x, reactive application on the JVM, event driven and non-blocking</li>
<li>OpenCV library (Computer Vision) to process the video stream in real-time and make sure the car is following the white lines</li>
</ul>
<p>There are a lot of things to think about, the environment is probably the most challenging. The algorithm can get lost depending on:</p>
<ul>
<li>The surface (patterned carpet, tiles, dark road)</li>
<li>The weather (sunny, rainy, the program is very sensitive to brightness change)</li>
<li>And other random things (window reflection, mirror effect)</li>
</ul>
<p>They have many ideas of improvement for the future:</p>
<ul>
<li>It is not needed to analyze all images coming from the video stream (especially on a straight line). Currently, they analyze one image every 100ms (why 100ms? because it takes this amount of time to process one)</li>
<li>It is not needed to analyze the whole image (some part can be discarded, what is above the horizon is not needed)</li>
<li>Having the computation done on the car itself instead of a laptop over the WiFi, to avoid network latency (however the computational power of Raspberry Pi can be limited)</li>
<li>Use AI and deep leaning algorithm so the car gets better at navigating using a training set: videos when the car is remotely controlled by a human (however it can take ages to build many tracks and take many videos)</li>
</ul>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/oR_YHca8Mt0?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<h4>Cloud Native Java, part deux, with Josh Long</h4>
<p>Josh is Spring Developer Advocate at Pivotal, it was the first time I was attending one of his talk. I really enjoyed it and I was very impressed by the speed of speech and coding simultaneously without forgetting multiple jokes. Such a brilliant speaker.</p>
<p>Josh used <a href="https://start.spring.io/" title="https://start.spring.io/" target="_blank" rel="noopener noreferrer">https://start.spring.io/</a> to generate a little project to manage reservations using <a href="https://spring.io/projects/spring-cloud" target="_blank" title="Spring Cloud" rel="noopener noreferrer">Spring Cloud</a> (built on Spring Boot). Why you should use this online tool to initialize your project? Watch the video to get the answer from Josh, it was hilarious!</p>
<p>He chose Kotlin for the service (because why not?) with some endpoints to get messages and reservations using a MongoDB reactive datastore. The service was loading some data in a react way during the start up.</p>
<p>He chose Java for the client using various technology coming out of the box with Spring (Eureka, Spring security, Hystrix for internal load balancer and fallbacks). The client was able to query the service to retrieve the data.</p>
<p>At the end of the demo, he also shows us some serverless architecture using <a href="https://projectriff.io/" target="_blank" title="RIFF" rel="noopener noreferrer">RIFF</a>, a FaaS for Kubernetes. He wrote a function to make a string uppercase, then using the command line to invoke the function deployed in Kubernetes. He did not have the time to show us the call from a service, but we got the idea.</p>
<iframe loading="lazy" class="youtube-player" width="550" height="310" src="https://www.youtube.com/embed/GW656IAU5ZE?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent" allowfullscreen="true" style="border:0;" sandbox="allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox"></iframe>
<p><br clear="none" /></p>
<p>My first day at Devoxx was great, this year I tried to attend more innovative talks about Serverless and Machine Learning, a mix of live coding and theory. I will post my summary of day 2 soon, so stay tuned!</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00090/devoxx-2.jpg?ssl=1" rel="shadowbox[sbpost-4587];player=img;" title="#DevoxxUK letters in the hall"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00090/devoxx-2-thumbnail.jpg?resize=550%2C367&#038;ssl=1" alt="#DevoxxUK letters in the hall" title="#DevoxxUK letters in the hall" width="550" height="367" class="size-medium wp-image-260" /></a><p class="wp-caption-text">#DevoxxUK letters in the hall</p></div>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/">Devoxx UK 2018 &#8211; Day 1</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/02/20/fosdem-2013-impressions/" rel="bookmark" title="Fosdem 2013 Impressions">Fosdem 2013 Impressions</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4587</post-id>	</item>
		<item>
		<title>Wise, Revolut and Monzo, a small revolution for travelers and expats</title>
		<link>https://blog.fabianpiau.com/en/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/</link>
					<comments>https://blog.fabianpiau.com/en/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sat, 20 Jan 2018 19:06:39 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[bank]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[society]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4444</guid>

					<description><![CDATA[<p>&#160;Version française disponible Update 2024 : Referral links update. June, 11th, 2019 : Curve card enables you to combine all your existing cards in one. April 22, 2018 : Wise is now providing a debit card for its borderless accounts. For this first article of the year 2018, I will present 3 financial services proven [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/">Wise, Revolut and Monzo, a small revolution for travelers and expats</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2014/09/17/choose-the-web-hosting-service-that-fits-your-needs/" rel="bookmark" title="Choose the web hosting service that fits your needs">Choose the web hosting service that fits your needs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/11/01/some-basic-rules-to-prevent-your-accounts-from-getting-hacked/" rel="bookmark" title="Some basic rules to prevent your accounts from getting hacked">Some basic rules to prevent your accounts from getting hacked</a></li>
<li><a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/" rel="bookmark" title="Bot Attacks: You are not alone&#8230;">Bot Attacks: You are not alone&#8230;</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Update </strong><br />
<strong>2024 : </strong> Referral links update.<br />
<strong>June, 11th, 2019 : </strong> Curve card enables you to combine all your existing cards in one.<br />
<strong>April 22, 2018 : </strong> Wise is now providing <a href="https://wise.com/borderless/card" target="_blank" title="Wise debit card" rel="noopener noreferrer">a debit card for its borderless accounts</a>.
</div>
<p>For this first article of the year 2018, I will present 3 financial services proven and used by myself for several months, even years. They allow me to make significant savings on my foreign currency transactions by avoiding the high fees of traditional banks. This article is in no way sponsored, but I have allowed myself to include some referral links.</p>
<p>For those who know me or follow me, it&#8217;s been a while since I live in England, 3 years already! I also travel abroad to discover new countries, new cultures and incidentally escape from the London Fog…</p>
<p>After arriving in England, I quickly needed to open a local bank account where the currency is, of course, not the Euro, but the Pound Sterling.</p>
<p>To deposit money into this account (while waiting for my first pay), I had to transfer money from my French account to my English account. In the pre-Brexit era when the Pound was very strong, it was a little painful… And like if it was not enough, my bank would also take its share with a rather exorbitant fee on my transfer. To avoid being ripped off twice, I looked on the Internet and browsed some forums looking for advice. I quickly decided to choose <a href="https://wise.com/invite/amc/fabianp25" target="_blank" title="Wise" rel="noopener noreferrer">Wise</a> (previously known as TransferWise).</p>
<p><br clear="none" /></p>
<p class="center"><a href="https://wise.com/invite/amc/fabianp25" target="_blank" title="Wise" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Wise" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00089/transferwise.png?resize=565%2C100&#038;ssl=1" alt="Wise" width="565" height="100" /></a></p>
<p>The principle is simple and based on common sense. British people sometimes need euros, for example when they travel in Europe; conversely, European people need pounds when they come to England. Wise allows you to link these requests by acting as an intermediary. The company has accounts in different currencies and distributes the amounts between people. For example, for a transfer of 1000 euros to a British account (so about 900 pounds at the moment), the system may need 2 people (one person who wants to convert 400 pounds in euros and another who wants to convert 500 pounds in euros) or 3 people (who want to convert 300 pounds in euros each) or 9 people (who want to convert 100 pounds each). I guess you understand how the system works!</p>
<p>Once the account of Wise is registered with your traditional bank (this may take some time depending on your bank) and the transfer has been made from your original account, you will receive the money quickly in your destination account (usually in 1 day).</p>
<p>You will not be charged because your original account and the Wise account are using the same currency. It&#8217;s not a big surprise that Wise will charge a fee, but almost insignificant (e.g. 5 euros for a transfer of 1000 euros). You can do a simulation on their site, the fee is proportional to the amount transferred.</p>
<p>More recently, Wise has set up the borderless account. With this &#8220;multi-account&#8221; you can receive transfers in different currencies in a transparent way, you just need a click to activate a currency and get your corresponding local bank details (IBAN / BIC) that you can then forward to to the person who owes you money. Since April 2018, you will receive a debit card so you can use it to pay anywhere with your borderless account.</p>
<p>It is important to note that the transfer is executed at the market rate. Since you decide when you want to make the transfer, it is wise to do it when the rate is the most advantageous for you. In my case, it was much more interesting to make pound-to-euro transfers before Brexit.</p>
<p>Also in my example, I mentioned the Pound and Euro exchange, but many currencies are supported: the Swiss Franc, the US Dollar, the Japanese Yen, etc.</p>
<p>Feel free to look for yourself and use <a href="https://wise.com/invite/amc/fabianp25" target="_blank" title="Wise" rel="noopener noreferrer">my referral link</a> to open your Wise account (and your first transfer will be free).</p>
<p><br clear="none" /></p>
<p>Although they provide a debit card, Wise works best for money transfers between accounts. How can you manage your expenses on the spot when you are travelling around the world? Who has not already paid a high fee when withdrawing abroad or when paying the bill at a restaurant? Who has not already made a large withdrawal at an ATM to avoid fixed costs, taking the risk to walk around with a large amount of money? If your interest is piqued, then carry on reading&#8230;</p>
<p><br clear="none" /></p>
<p class="center"><a href="https://revolut.com/referral/?referral-code=fabianv0x!AUG1-23-AR-H1" target="_blank" title="Revolut" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Revolut" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00089/revolut.png?resize=400%2C125&#038;ssl=1" alt="Revolut" width="400" height="125" /></a></p>
<p>Opening a <a href="https://revolut.com/referral/?referral-code=fabianv0x!AUG1-23-AR-H1" target="_blank" title="Revolut" rel="noopener noreferrer">Revolut</a> account makes perfect sense. It&#8217;s an online bank, which means that you won&#8217;t find any physical offices, you manage everything yourself from the application on your smartphone: from changing the PIN code to the deactivation of the card, or the change of your address. Revolut is free, you just have to pay a small fee (5 pounds or equivalent in your currency) to receive your multi-currency debit card at home, unless you use <a href="https://revolut.com/referral/?referral-code=fabianv0x!AUG1-23-AR-H1" target="_blank" title="Revolut" rel="noopener noreferrer">my referral link</a> to avoid the fees to receive a card.</p>
<p>You can convert currencies in advance from the application to ensure your exchange rate (advanced use) or it will be automatically calculated in the country according to the current rate and usage of your card (personally, I find it sufficient). The exchange rate is very low and matches the interbank rate (it is therefore a very low rate close to the real one without extra fee).</p>
<p>Revolut strongly advises its customer to keep an account in a traditional bank in case the card is not accepted, it is a Visa so it should not be a problem, but you will probably be happy to have a backup plan, just in case.</p>
<p>The mobile application is well made with a breakdown of your expenses by category, an instant notification on your smartphone for each expense (useful for a contactless payment to verify the amount), the possibility of refunding another person instantly or share an expense easily.</p>
<p>I take the example of trips abroad, but nothing prevents you from using it every day by topping up your card regularly. You will be able to see your expenses by category, month after month, and refine your budget.</p>
<p>Wondering where is the scam? Well, it&#8217;s like Wise, there is not really a catch! But there are withdrawal and card payment limits (daily, weekly and monthly). Frankly, unless you travel for 6 months a year or you are really bad at spreading out your expenses, it should be enough for you. It is still possible to subscribe to the premium option to increase the limits and access additional services.</p>
<p>Revolut is a young, fast-growing company available in several countries. New features are added every month (cryptocurrency exchange, insurance, credit, etc.).</p>
<p>Again, feel free to have a look for yourself and use <a href="https://revolut.com/referral/?referral-code=fabianv0x!AUG1-23-AR-H1" target="_blank" title="Revolut" rel="noopener noreferrer">my referral link</a> to open your Revolut account for free. There is very little chance for you to regret it.</p>
<p><br clear="none" /></p>
<p class="center"><a href="https://join.monzo.com/c/6y8bxhq" target="_blank" title="Monzo" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Monzo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00089/monzo.png?resize=500%2C130&#038;ssl=1" alt="Monzo" width="500" height="130" /></a></p>
<p>Monzo is also an online bank. It provides a very similar service to Revolut, but you will receive a Mastercard (not Visa) card to make payments in different currencies at the interbank rate.</p>
<p>I must say that I use it for longer and more regularly than Revolut. Unfortunately at that time, the service is only available in UK. Unlike Revolut, there is no charge to receive the card, there is no premium option available, and it&#8217;s totally free.</p>
<p>Unlike Revolut, Monzo focuses exclusively on the multi-currency expenses and reporting aspect, you won&#8217;t find any insurance, crypto exchange or other services. But what it does, it does it very well! Personally I find the smartphone app a little more convenient. They have limits too, but higher than on Revolut.</p>
<p>In my case, using both services and having 2 debit cards indirectly raise the limits. Also, it is possible that a Revolut card does not work in a place abroad, while it works with Monzo, and vice versa.</p>
<p>Feel free to look for yourself and use <a href="https://join.monzo.com/c/6y8bxhq" target="_blank" title="Monzo" rel="noopener noreferrer">my referral link</a> to open your Monzo account and you will get £5 for free.</p>
<p><br clear="none" /></p>
<p class="center"><a href="https://www.curve.com/join/#EKGQQJQN" target="_blank" title="Curve" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Curve" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00089/curve.png?resize=485%2C111&#038;ssl=1" alt="Curve" width="485" height="111" /></a></p>
<p>Last but not least, Curve is also an online bank. The main benefit of this card is that it allows you to group all your cards in one, like a wrapper. If you do not want to take all your cards with you all the time: Revolut, Monzo or any other professional or personal cards, it is possible to use only one: the Curve card. From the application, a simple tap is enough to select the card that will be active. It&#8217;s efficient and will make your wallet a little lighter. Note that there may be some limitations in case of disputes, but this will be suitable for everyday use. And since it&#8217;s free, why not giving it a try?</p>
<p>You can use <a href="https://www.curve.com/join/#EKGQQJQN" target="_blank" title="Curve" rel="noopener noreferrer">my referral link</a> to open your account and get £5 for free. Use code &#8220;EKGQQJQN&#8221; at sign up.</p>
<p><br clear="none" /></p>
<p>Once is not custom, I did not look at the technical side, but the post is still about new technologies in the banking system, I hope you&#8217;ve found the reading interesting. It also shows that small startups (Fintech) can move the lines of the banking landscape and shape our future. It is critical for traditional banks to constantly innovate to stay in the race, not sure they have all made the shift in time, and the customers of yesterday are no longer the young people of today.</p>
<p>And perhaps you will embrace online banking through your smartphone and even save some money… At least I don&#8217;t see any reason not to try!</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/">Wise, Revolut and Monzo, a small revolution for travelers and expats</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2014/09/17/choose-the-web-hosting-service-that-fits-your-needs/" rel="bookmark" title="Choose the web hosting service that fits your needs">Choose the web hosting service that fits your needs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2020/05/19/flagger-canary-deployments-on-kubernetes/" rel="bookmark" title="Flagger &#8211; Canary deployments on Kubernetes">Flagger &#8211; Canary deployments on Kubernetes</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/11/01/some-basic-rules-to-prevent-your-accounts-from-getting-hacked/" rel="bookmark" title="Some basic rules to prevent your accounts from getting hacked">Some basic rules to prevent your accounts from getting hacked</a></li>
<li><a href="https://blog.fabianpiau.com/en/2021/04/20/bot-attacks-you-are-not-alone/" rel="bookmark" title="Bot Attacks: You are not alone&#8230;">Bot Attacks: You are not alone&#8230;</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2018/01/20/wise-revolut-and-monzo-small-revolution-for-travelers-and-expats/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4444</post-id>	</item>
		<item>
		<title>Autocomplete for Git</title>
		<link>https://blog.fabianpiau.com/en/2017/05/20/autocomplete-for-git/</link>
					<comments>https://blog.fabianpiau.com/en/2017/05/20/autocomplete-for-git/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sat, 20 May 2017 13:27:42 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[git]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4233</guid>

					<description><![CDATA[<p>&#160;Version française disponible Note This tip only works on Unix-based systems (Linux, Mac OS&#8230;) Download the file git-completion.bash from Github. Add this line to your bash profile (e.g. .bashrc), I assume you have copied git-completion.bash at the root of your home folder. source ~/git-completion.bash If .bashrc doesn&#8217;t exist, create it first. This line will load [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2017/05/20/autocomplete-for-git/">Autocomplete for Git</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2011/07/10/save-space-disk-with-chrome-chromium-or-how-not-to-lose-it/" rel="bookmark" title="Save space disk with Chrome / Chromium (or how not to lose it&#8230;)">Save space disk with Chrome / Chromium (or how not to lose it&#8230;)</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/11/11/do-you-need-a-good-cover-for-this-winter-eclemma/" rel="bookmark" title="EclEmma &#8211; Do you need a good cover for this winter ?">EclEmma &#8211; Do you need a good cover for this winter ?</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2017/05/20/autocomplete-for-git/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<div class="info"><strong class="label">Note</strong><br />
This tip only works on Unix-based systems (Linux, Mac OS&#8230;)
</div>
<p class="right" style="padding-left:15px;"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Git logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00088/git-logo.png?resize=200%2C200&#038;ssl=1" alt="Git logo" width="200" height="200" /></p>
<p>Download the file <a href="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash">git-completion.bash</a> from Github.</p>
<p>Add this line to your bash profile (e.g. <code>.bashrc</code>), I assume you have copied <code>git-completion.bash</code> at the root of your home folder.</p>
<pre>source ~/git-completion.bash</pre>
<p>If <code>.bashrc</code> doesn&#8217;t exist, create it first.</p>
<p>This line will load <code>git-completion.bash</code> automatically when you open a bash session.</p>
<p>You will then be able to autocomplete all your Git commands (using Tab), and also access advanced completion e.g. look for local and remote branches by starting typing the name.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2017/05/20/autocomplete-for-git/">Autocomplete for Git</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2011/07/10/save-space-disk-with-chrome-chromium-or-how-not-to-lose-it/" rel="bookmark" title="Save space disk with Chrome / Chromium (or how not to lose it&#8230;)">Save space disk with Chrome / Chromium (or how not to lose it&#8230;)</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/11/11/do-you-need-a-good-cover-for-this-winter-eclemma/" rel="bookmark" title="EclEmma &#8211; Do you need a good cover for this winter ?">EclEmma &#8211; Do you need a good cover for this winter ?</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2017/05/20/autocomplete-for-git/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4233</post-id>	</item>
		<item>
		<title>Swagger, the automated API documentation</title>
		<link>https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/</link>
					<comments>https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/#comments</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Wed, 01 Mar 2017 21:36:26 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[microservices]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[spring]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=4179</guid>

					<description><![CDATA[<p>&#160;Version française disponible IT projects nowadays are mostly based on a microservice oriented architecture, it is not surprising that the different microservices are developed and maintained by different teams. Each service provides an API (private or public) that allows the communication with the outside world while guaranteeing its data integrity. Multiple nested calls between microservices [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/">Swagger, the automated API documentation</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/" rel="bookmark" title="Microservices architecture &#8211; Best practices">Microservices architecture &#8211; Best practices</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/07/02/doing-some-social-rest-with-hateoas/" rel="bookmark" title="Doing some social REST with HATEOAS">Doing some social REST with HATEOAS</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/06/23/api-rest-json-xml-http-uri-what-language-do-you-speak/" rel="bookmark" title="API, REST, JSON, XML, HTTP, URI&#8230; What language do you speak?">API, REST, JSON, XML, HTTP, URI&#8230; What language do you speak?</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2017/03/01/swagger-automated-api-documentation/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>IT projects nowadays are mostly based on<a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/" title="Microservices architecture – Best practices"> a microservice oriented architecture</a>, it is not surprising that the different microservices are developed and maintained by different teams.</p>
<p>Each service provides an API (private or public) that allows the communication with the outside world while guaranteeing its data integrity. Multiple nested calls between microservices make it possible to do more complex processing. It is very important to have an up-to-date documentation for each of your APIs. Who has never heard a developer say to another &#8220;This doc has not been updated for months, look at the code directly!&#8221;.</p>
<p class="left" style="padding-right:15px;"><a href="https://swagger.io/tools/swagger-ui/" target="_blank" title="Logo Swagger" rel="noopener noreferrer"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Logo Swagger" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00087/swagger-logo.png?resize=200%2C200&#038;ssl=1" alt="Logo Swagger" width="200" height="200" /></a></p>
<p><a href="https://swagger.io/tools/swagger-ui/" target="_blank" title="Swagger UI official website" rel="noopener noreferrer">Swagger UI</a> complies with this assertion. Simply annotate your code and the framework will semi-automatically generate all your API documentation. I use &#8216;semi-automatic&#8217; because Swagger cannot guess the business side of your documentation, so you have to write it yourself in a similar way that you are writing Javadoc.</p>
<p>The documentation generated by Swagger is updated at the same time as the code is. For instance, if you add a new parameter to a method that is exposed, it will be automatically taken into account and documented with the appropriate annotations. The documentation is much more than a static HTML file, it allows to act as an HTTP client (there is no need to have <a href="https://www.postman.com/" target="_blank" title="Postman official website" rel="noopener noreferrer">Postman</a> installed for example) to test the various methods exposed by the API.</p>
<p>You can take a look at the <a href="https://petstore.swagger.io/" target="_blank" title="Swagger sample application (Petstore)" rel="noopener noreferrer">official sample application (Petstore)</a> and see by yourself the various supported features, for example OAuth2.0 authentication is supported.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00087/swagger-pet-store.png?ssl=1" rel="shadowbox[sbpost-4179];player=img;" title="Example with Swagger (Petstore)"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00087/swagger-pet-store-thumbnail.png?resize=550%2C507&#038;ssl=1" alt="Example with Swagger (Petstore)" title="Example with Swagger (Petstore)" width="550" height="507" class="size-medium wp-image-257" /></a><p class="wp-caption-text">Example with Swagger (Petstore)</p></div>
<p>If you use Spring MVC in your application, the <a href="http://springfox.github.io/springfox/" target="_blank" title="SpringFox project official website" rel="noopener noreferrer">SpringFox project</a> (Swagger wrapper) makes Swagger integration very simple. In less than an hour, you should be able to generate your API documentation. Then you can add optional annotations to make it even more complete.</p>
<p>By adopting Swagger on all your microservices, it is a good bet that the communication between your different teams will improve. You will have a unique entry point and you can forget that dusty wiki page that was updated once in a while&#8230; Wishing you good documentation!</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/">Swagger, the automated API documentation</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/" rel="bookmark" title="Microservices architecture &#8211; Best practices">Microservices architecture &#8211; Best practices</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/07/02/doing-some-social-rest-with-hateoas/" rel="bookmark" title="Doing some social REST with HATEOAS">Doing some social REST with HATEOAS</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/06/23/api-rest-json-xml-http-uri-what-language-do-you-speak/" rel="bookmark" title="API, REST, JSON, XML, HTTP, URI&#8230; What language do you speak?">API, REST, JSON, XML, HTTP, URI&#8230; What language do you speak?</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4179</post-id>	</item>
		<item>
		<title>Microservices architecture &#8211; Best practices</title>
		<link>https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/</link>
					<comments>https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/#comments</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 03 Oct 2016 06:00:15 +0000</pubDate>
				<category><![CDATA[Agile programming]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[microservices]]></category>
		<guid isPermaLink="false">https://blog.fabianpiau.com/?p=3911</guid>

					<description><![CDATA[<p>&#160;Version française disponible I&#8217;m working on a microservices architecture since quite a long time now and attend many conferences on this topic. I want to gather my experience in this article to give you some feedbacks and also advices. Each title is what you shouldn&#8217;t do followed by a description of what you should do [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/">Microservices architecture &#8211; Best practices</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/" rel="bookmark" title="Swagger, the automated API documentation">Swagger, the automated API documentation</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/07/23/doing-responsive-web-design-yes-but-easily/" rel="bookmark" title="Doing Responsive Web Design: yes, but easily!">Doing Responsive Web Design: yes, but easily!</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2016/10/03/microservices-architecture-best-practices/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>I&#8217;m working on a microservices architecture since quite a long time now and attend many conferences on this topic. I want to gather my experience in this article to give you some feedbacks and also advices. Each title is what you shouldn&#8217;t do followed by a description of what you should do instead. Even if you are already doing microservices on your project, it can still be a nice reading (I hope) and refresh your memory. Also, don&#8217;t hesitate to comment and share your thoughts!</p>
<div class="info"><strong class="label">Disclaimer</strong><br />
You can call it SOA (or call it whatever you want), but I prefer to use the appropriate buzzword for the SEO of my blog. ;)
</div>
<p>Adopting a microservices architecture is not that easy. Writing microservices is not only about code, it is also about the teams and the structure organization.</p>
<p class="center"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Microservices lego" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00086/lego.png?resize=550%2C196&#038;ssl=1" alt="Microservices lego" width="550" height="196" /></p>
<p><br clear="none" /></p>
<h4>Let&#8217;s extract this complex piece of code, it will be more simple in a microservice!</h4>
<p>Usually, it is a bit easier when starting a new project from scratch, if it is your case, then you are lucky! If you want to break down a monolithic application into a set of microservices, don&#8217;t do everything in one go, the big bang is the best way to blow up everything. Try to gather the similar set of functionality that can be included as part of the same microservice. Make sure that all the features you want to extract are tested before refactoring anything. If the coverage is low, you have to start by writing tests. By doing that, you will improve the code from the monolith, and this code will be reused after in your microservice. Keep in mind you are preparing the extraction, this work won&#8217;t be useless.</p>
<p>If you don&#8217;t have enough tests, you will do things blindly and you won&#8217;t be able to ensure that you are not breaking anything, regression is the last thing you want. To recap, write integration tests around the code you want to extract, then you can start to extract some feature to create a microservice. Your integration tests should still pass, but the plumbing behind will have changed.</p>
<p>Start small and easy at first. And don&#8217;t be afraid of duplicating some code. Once your microservice is working fine, you can remove the duplicated code from the monolith. <a href="https://en.wikipedia.org/wiki/A/B_testing" target="_blank" title="A/B testing definition" rel="noopener noreferrer">A/B testing</a> can help, so you can gradually redirect the traffic to the new microservice and see how the system reacts.</p>
<p><br clear="none" /></p>
<h4>The &#8216;micro-monolith-service&#8217; trap</h4>
<p>Keep the microservice quite small and not too complex. There is no magical answer to the question how many lines of code a service should have to be considered as a microservice? But it is more about feeling and great design. If a new joiner needs one day to understand the code and what your microservice is doing, then you probably get it wrong. A few hours should be more than enough.</p>
<p><br clear="none" /></p>
<h4>You need to parse an XML file, let me write a microservice for that!</h4>
<p>On the other extreme, don&#8217;t write a microservice when a library is enough, don&#8217;t over engineer things. You don&#8217;t want to have a call depth too big (number of nested requests). If you have more than 3 nested calls, you are probably doing nanoservices. A call involves network latency and a possible failure. A microservice will have to be deployed with an API, where a library is directly embedded without ops overhead. It is a balance between <a href="https://en.wikipedia.org/wiki/DevOps" target="_blank" title="DevOps definition" rel="noopener noreferrer">DevOps</a> overhead and monolithic complexity.</p>
<p><br clear="none" /></p>
<h4>Sorry, I can&#8217;t help you, I never work on this microservice&#8230;</h4>
<p>It is not possible that all the teams are owning all the microservices. You will have to deal with synchronization and communication between your teams. I heard very often the fact that a team should not own a microservice, and everyone should be able to switch and work on any microservice. Well, in reality, it is not so true, but you can adopt some good practices to make it easier for someone to work on a microservice developed by another team.</p>
<p>In my opinion, a team owns a microservice, which means it is responsible for building and running it. When something wrong happens in production, the team should be the main point of contact. You will have to find the person within the team who will accept a call at 5am&#8230; Just kidding ;)</p>
<p><br clear="none" /></p>
<h4>Spring, Dropwizard, Finagle, Clojure, let&#8217;s try and mix all!</h4>
<p>Try to stick to the same technology stack throughout all your microservices. I know that a nice advantage of microservice is that you can build them with any language you want. Passionate developers will have a tendency to use the latest trendy framework. In the long term and with people turn over, maintaining your microservices will become painful and turns into a nightmare. Switching of microservices between the teams will become very difficult or even impossible. I think it is important to limit to a certain number of technologies. </p>
<p>Many technologies are available to do microservices, you have to use something reliable, well maintained, and so on. Which serialization, text or binary? REST, Thrift, SOAP? An in-house solution, open source framework? There is no best answer. Compare the different technologies, pros and cons, use the most suitable for you.</p>
<p>At the same time, this limitation shouldn&#8217;t prevent you to innovate. Don&#8217;t stick to what you already use and master if you think there is a better solution on the market. Try it on a new microservice (but non-critical to the system) as a POC, then in the case of success, you can propagate it to the whole system.</p>
<p><br clear="none" /></p>
<h4>What about the data stores?</h4>
<p>You can be more flexible about the data store. This is an external dependency, and it can be adapted depending on the needs (relational, noSQL, memory database, read-only access&#8230;). </p>
<p>Keep your data stores independent, each microservice is a data keeper. You should never bypass it by linking a microservice to the data store of another microservice. It will be an extremely bad design. In case you are limited to one database for some reasons, it&#8217;s fine because you can define different schemas and limit access for each microservice.</p>
<p><br clear="none" /></p>
<h4>If one microservice fails, my whole system is down&#8230;</h4>
<p>It is important to design a good architecture. Think about scalability, circuit breaker, service discovery from the start, not one month before going to production with thousands of users. You should always keep this in mind from day 0. Some people may argue that point, and sometimes you may have to convince the product owner that doesn&#8217;t see the real business value. But trust me, the more you wait, the more work it will be and you won&#8217;t be so confident with your architecture until all these technical tasks are complete.</p>
<p>You are dealing with many requests over the network, which is usually not very reliable, you have to imagine a design for failure. This is a mindset the team has to adopt. You have to think about retries (e.g., in the case of failure, you retry on the second instance), idempotent calls and so on. Retry is not as easy as you can explain it, especially when you cannot make the call idempotent. At some point, you will have to fine-tune the retry configuration. E.g. try avoiding retries at the inner level request if there are already retries at the outer level, the timeout at the outer level should be more than the timeout at the inner level, etc. All your microservices should expose a set of health checks URL and other useful metrics that another monitoring tool will use (either on a pull or push model).</p>
<p>It is also important to test the infrastructure. What will happen if this instance of microservice goes down? You should do some <a href="https://en.wikipedia.org/wiki/Monkey_testing" target="_blank" title="Monkey testing definition" rel="noopener noreferrer">Monkey testing</a> (i.e. switch off some microservices randomly), the system should react positively and still be able to handle and serve the requests (in a degraded mode).</p>
<p><br clear="none" /></p>
<h4>All right, let me &#8216;grep&#8217; the log to see what happened yesterday&#8230; Wait&#8230; There are 50 log files here!</h4>
<p>Having many microservices involve lots of interactions, so lots of logging. It will be difficult to debug in case something went wrong in production. Where was it? Which log file? Which environment? Ops can get lost easily&#8230; Try to do accurate logging, and keep a correlation identifier to be able to trace the complete call stack throughout the different log files.</p>
<p>Be proactive and don&#8217;t wait for the customer to complain. Track any stacktrace that can occur, raise alerts and constantly fix all problems until your logs are &#8220;cleaned&#8221; and contains only useful and accurate information. A log monitoring tool (e.g. <a href="https://www.splunk.com/" target="_blank" title="Splunk website" rel="noopener noreferrer">Splunk</a>, <a href="https://www.elastic.co/kibana/" target="_blank" title="Kibana website" rel="noopener noreferrer">Kibana</a>&#8230;) will make sense in a microservices architecture. </p>
<p><br clear="none" /></p>
<h4>We cannot test, the microservice we depend on is still not ready</h4>
<p>When writing integration tests, mock all external dependencies of the microservice. Especially, if a team is still developing a microservice you depend on. You don&#8217;t want to wait for them to finish. E.g. you can take a look at <a href="https://wiremock.org/" target="_blank" title="Wiremock website" rel="noopener noreferrer">Wiremock</a>. On the opposite, for the end-to-end tests, try to provide a good and fast tool to run them locally, the use of embedded servers is a good way to achieve that.</p>
<p>I already mention it, deploy often to production, especially at the beginning, and don&#8217;t wait 6 months before deploying your microservices. Even if they are not useful (yet) from a business value point of view, you will be more confident when working on them, and then you can implement the business logic without worrying too much about the architecture. The earlier you test in production, the earlier you will see bugs and be able to fix them quickly.</p>
<p><br clear="none" /></p>
<h4>Let&#8217;s design the API like that for now, something simple, we will change it later</h4>
<p>It is not easy to be agile when designing an API, especially a public one. Once a version is released and start to be used, any big change will involve an API contract change. You will have to think about versioning your API and ultimately maintain different versions. It is important to spend some time at the beginning to define a good API contract that can evolve without breaking changes (ideally). That sounds waterfall to you? Well, that probably is&#8230; </p>
<p>Always keep in mind to be backward compatible (even if the calls are internal) and use API versioning. For example, don&#8217;t rename a field like that, but follow a longer and safer process, you should add the new field, keep the old one deprecated until all the clients have migrated, then you can delete it.</p>
<p><br clear="none" /></p>
<h4>The ops guys need one day to deploy a couple of microservices, what is wrong with them?!</h4>
<p>The ops team has to change its mindset, instead of deploying and monitoring a big and unique application, they will have to manage many little applications and make sure there are no communication failures. From a couple of manual steps, they are ending up with many tedious steps. They will be quickly overwhelmed if they keep the same habits and spirit, especially the number of microservices will grow over time.</p>
<p>They will need to automatize their work and avoid any manual and error-prone step. Adopting a microservices architecture forces you to do &#8220;real&#8221; DevOps. The developer has to participate in the deployment, it is not about just giving a file anymore and counting on the ops to do the job. The developer has to be involved. Ideally, an ops guy will be dedicated to the team to make sure the network configuration is correct, the health checks are existing and working fine, participate to stand-ups and even seat with the dev team. You will need to start thinking about using a deployment tool such as <a href="https://www.ansible.com/" target="_blank" title="Ansible website" rel="noopener noreferrer">Ansible</a>.</p>
<p><br clear="none" /></p>
<h4>We have spent 6 months on this architecture, it is working very well&#8230; It is just that we have 50 users!</h4>
<p>Last advice, don&#8217;t try to do everything at once. You have to tackle with so many problematics already. You can put aside some stuff like self-healing, service discovery, circuit breaker, auto scaling, etc. The use of retries and multiple instances will be sufficient at the beginning. But keep in mind, you will have to implement them at some point, especially when your system is successful and used by thousands of users.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/">Microservices architecture &#8211; Best practices</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/06/06/devoxx-uk-day-2/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 2">Devoxx UK 2018 &#8211; Day 2</a></li>
<li><a href="https://blog.fabianpiau.com/en/2017/03/01/swagger-automated-api-documentation/" rel="bookmark" title="Swagger, the automated API documentation">Swagger, the automated API documentation</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/07/23/doing-responsive-web-design-yes-but-easily/" rel="bookmark" title="Doing Responsive Web Design: yes, but easily!">Doing Responsive Web Design: yes, but easily!</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2016/10/03/microservices-architecture-best-practices/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3911</post-id>	</item>
		<item>
		<title>FAQ &#8211; Online survey with Google Forms / Drive / Docs</title>
		<link>https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/</link>
					<comments>https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/#comments</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sun, 24 Apr 2016 17:46:07 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[drive]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[survey]]></category>
		<guid isPermaLink="false">http://blog.fabianpiau.com/?p=3567</guid>

					<description><![CDATA[<p>&#160;Version française disponible The article Using Google Forms / Drive / Docs to create an online survey regularly receives comments. I realized that people come across similar issues, so I decided to write this article as a FAQ. I do not consider myself a Google Forms expert and Google can evolve the product at any [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/">FAQ &#8211; Online survey with Google Forms / Drive / Docs</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2012/09/24/using-google-docs-to-create-an-online-survey/" rel="bookmark" title="Using Google Forms / Drive / Docs to create an online survey">Using Google Forms / Drive / Docs to create an online survey</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/01/01/free-online-mongodb-training/" rel="bookmark" title="Free online MongoDB training">Free online MongoDB training</a></li>
<li><a href="https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/" rel="bookmark" title="Should we be wary of Google?">Should we be wary of Google?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/02/22/measure-analyze-website-audience-matomo/" rel="bookmark" title="Measure and analyze your website audience with Matomo">Measure and analyze your website audience with Matomo</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2016/04/24/faq-online-survey-with-google-docs-drive-forms/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p class="right" style="padding-left:15px;"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Survey" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00085/survey.png?resize=244%2C280&#038;ssl=1" alt="Survey" width="244" height="280" /></p>
<p>The article <a href="https://blog.fabianpiau.com/en/2012/09/24/using-google-docs-to-create-an-online-survey/" title="Using Google Forms / Drive / Docs to create an online survey">Using Google Forms / Drive / Docs to create an online survey</a> regularly receives comments. I realized that people come across similar issues, so I decided to write this article as a FAQ. I do not consider myself a Google Forms expert and Google can evolve the product at any time, making my articles outdated. However, you can probably find the answer to your question in this FAQ (hopefully).</p>
<p><br clear="none" /></p>
<h4>When a user wants to respond to the form, he / she has to connect to Google first, is it normal?</h4>
<p>You must disable the option &#8220;Only allow one response per person&#8221; that forces people to connect to their Google account. Be aware that without this option on, people can potentially answer the form several times.</p>
<p><br clear="none" /></p>
<h4>How to prevent a person to answer the survey several times?</h4>
<p>To have more confidence in the results, you can enable the option &#8220;Only allow one response per person&#8221;. Note that users will be asked to log in to their Google Account to view and complete the form, but the actual user name will not be recorded.</p>
<p><br clear="none" /></p>
<h4>I don&#8217;t want to force users to have a Google account, is there an alternative?</h4>
<p>If you do not want to force your users to have a Google account, an alternative is to use <a href="https://support.google.com/docs/answer/2839588?hl=en&#038;topic=1360904&#038;ctx=topic&#038;visit_id=1-636333046820323686-1884541626&#038;rd=1" target="_blank" title="Pre-populate form answers">pre-populate the form</a>.</p>
<p>For example, here are links to pre-populate the field &#8220;name&#8221; in a sample survey:</p>
<ul>
<li><a href="https://docs.google.com/forms/d/e/1FAIpQLSeC8fIptm9xY8Ai1dADB8JxqbzDbQFv4vULOq_vGCK10NWsUw/viewform?entry.1000000=Fabian" target="_blank" title="Form pre-populated with the name Fabian">https://docs.google.com/forms/d/e/1FAIpQLSeC8fIptm9xY8Ai1dADB8JxqbzDbQFv4vULOq_vGCK10NWsUw/viewform?entry.1000000=Fabian</a></li>
<li><a href="https://docs.google.com/forms/d/e/1FAIpQLSeC8fIptm9xY8Ai1dADB8JxqbzDbQFv4vULOq_vGCK10NWsUw/viewform?entry.1000000=Caroline" target="_blank" title="Form pre-populated with the name Caroline">https://docs.google.com/forms/d/e/1FAIpQLSeC8fIptm9xY8Ai1dADB8JxqbzDbQFv4vULOq_vGCK10NWsUw/viewform?entry.1000000=Caroline</a></li>
</ul>
<p>You will notice that the URL changes at the end with an additional parameter. Only one field is pre-populated, but it is very easy to pre-populate several fields (such as name or email). Generate the link from the menu to get the syntax of the parameters and then you can manually change them before sending the link. If you have many links to send, it will take you some time, but it will work.</p>
<p>However, note that it does not prevent the person to modify the pre-populated information (directly from the form, or by changing the URL) or submit the survey multiple times.</p>
<p>It is not possible to hide fields, but there is a workaround! You can add fields you want to hide on a specific section of your form that will never be displayed. You have to use sections in your form and change the navigation to never show the section that contains the hidden fields and go to the next one directly. Read pages <a href="https://support.google.com/docs/answer/2839737?hl=en" target="_blank" title="Add content to your form">Add content to your form</a> to know how to add a section and especially this page <a href="https://support.google.com/docs/answer/141062?hl=en" target="_blank" title="Control navigation to sections of a form">Control navigation to sections of a form</a>.<br />
Again, this will not prevent the user to manually change the URL, but many will not pay attention, especially if you use a URL shortener tool.</p>
<p><br clear="none" /></p>
<h4>Is it possible to include the form in my website?</h4>
<p>Yes, it is possible to include the form in your website as an <code>iFrame</code>. The option is available from the &#8220;File&#8221; menu. The menu generates an HTML code snippet that you can then copy / paste into a page of your site. You can also write the code manually, for example:</p>
<pre class="brush: xml; light: true; title: ; notranslate">
&lt;iframe src=&quot;https://docs.google.com/forms/d/1SEu1y1TvOyPUwkUHcwgC-ky0LIVZXCjjr5ARH_E3mK0/viewform?embedded=true&quot; width=&quot;760&quot; height=&quot;500&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;&gt;Loading...&lt;/iframe&gt;
</pre>
<p>You can change the size of the <code>iFrame</code> and the URL to fit your form.</p>
<p><br clear="none" /></p>
<h4>Is it possible to include the form directly in an email?</h4>
<p>Yes, it is possible. When sending the email (via the &#8220;Send form&#8221; menu), make sure the checkbox &#8220;Include form in email&#8221; is checked.</p>
<p><br clear="none" /></p>
<h4>I would like to get the IP address of each participant. Is it possible?</h4>
<p>No, it is not possible to trace the IP address. You can force the users to authenticate before they can respond to the form, but this requires users to log in with their Google Account.</p>
<p><br clear="none" /></p>
<h4>Is it possible to change the answers after having submitted the form?</h4>
<p>When building the form, there is an option on the confirmation page settings, &#8220;Edit their response: Allows respondents to change their answers to your form&#8221;. If this option is checked, after submitting the form the person will have the confirmation page with a unique link to edit his / her answers. This link is displayed only one time, if the person closes the window, he / she will no longer be able to change his / her answers. You can find more information on the official documentation <a href="https://support.google.com/docs/answer/2839588?hl=en" target="_blank" title="Send your form to respondents">Send your form to respondents</a>.</p>
<p><br clear="none" /></p>
<h4>Is there a maximum number of responses?</h4>
<p>There is no particular limit. However, a spreadsheet has a <a href="https://support.google.com/drive/answer/37603?visit_id=1-636333044310156895-3354812221&#038;hl=en&#038;rd=1" target="_blank" title="Files that can be stored on Google Drive">limit of 2 million cells</a>.</p>
<p><br clear="none" /></p>
<h4>Is it possible to redirect the users to another site once the form is submitted?</h4>
<p>No, that&#8217;s not possible. A good idea may be to change the confirmation page message at the end of your form. Instead of the classic &#8220;Your response has been recorded&#8221;, replace with another sentence inviting the user to click on a link to continue.</p>
<p><br clear="none" /></p>
<h4>Is it possible to not accept new responses after a specific date?</h4>
<p>There is no such feature. But nothing prevents you from adding a free text section at the top of the form to indicate that it will be available until yyyy-mm-dd. And on that date, you <a href="https://support.google.com/docs/answer/139706?hl=en" target="_blank" title="View and manage form responses">close the form</a>. This will have the same effect.</p>
<p>To prevent new answers to be submitted, click the Accepting responses in the toolbar. The button will show &#8220;The answers are no longer accepted&#8221; To reactivate it, click the button again.<br />
When a form is no longer accepting response, users who visit are informed by a message that their answers will not be collected. To customize this message, change the text that appears under the title &#8220;The form has been disabled&#8221; in the top of the form.</p>
<p><br clear="none" /></p>
<h4>Is it possible to create a multilingual survey?</h4>
<p>It is not possible, but there are some workarounds that can more or less suit your needs.</p>
<p>You can create different forms, the link will be different, so as the summary of responses. It will be impossible to merge the results automatically, you will have to rework the table of responses with a spreadsheet tool like Excel (to consolidate the responses).</p>
<p>You can also add a first question that asks the user his/her language, then you can display the relevant sections in the selected language. Compare to the first solution, the link will be identical for everyone (no risk of error). The downside is that the question in French and the one in English will be on different columns (one cell will be always empty), so the summary of responses won&#8217;t match your expectations. Again, you will have to consolidate the responses manually.</p>
<p><br clear="none" /></p>
<h4>Is it possible that a person starts to respond to a form and wants to resume it later?</h4>
<p>No, that&#8217;s not possible. All responses are recorded once when submitting the form.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/">FAQ &#8211; Online survey with Google Forms / Drive / Docs</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2012/09/24/using-google-docs-to-create-an-online-survey/" rel="bookmark" title="Using Google Forms / Drive / Docs to create an online survey">Using Google Forms / Drive / Docs to create an online survey</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/01/01/free-online-mongodb-training/" rel="bookmark" title="Free online MongoDB training">Free online MongoDB training</a></li>
<li><a href="https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/" rel="bookmark" title="Should we be wary of Google?">Should we be wary of Google?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2014/02/22/measure-analyze-website-audience-matomo/" rel="bookmark" title="Measure and analyze your website audience with Matomo">Measure and analyze your website audience with Matomo</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/feed/</wfw:commentRss>
			<slash:comments>232</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3567</post-id>	</item>
		<item>
		<title>QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</title>
		<link>https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/</link>
					<comments>https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Thu, 14 Apr 2016 20:09:40 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jigsaw]]></category>
		<category><![CDATA[qcon]]></category>
		<guid isPermaLink="false">http://blog.fabianpiau.com/?p=3520</guid>

					<description><![CDATA[<p>&#160;Version française disponible Simon Ritter gave a presentation about JDK 9 at QCon London. Java Compatibility Policy He started with an interesting fact: Java has a general and longstanding compatibility policy. If an application uses only supported APIs on version N of Java, it should work on version N+1, even without recompilation. That&#8217;s why, to [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>Simon Ritter gave a presentation about JDK 9 at QCon London.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00084/jdk9-qcon-london.png?ssl=1" rel="shadowbox[sbpost-3520];player=img;" title="QCon London 2016 - Project Jigsaw in JDK 9 - Modularity comes to Java by Simon Ritter"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00084/jdk9-qcon-london-thumbnail.png?resize=550%2C365&#038;ssl=1" alt="QCon London 2016 - Project Jigsaw in JDK 9 - Modularity comes to Java" title="QCon London 2016 - Project Jigsaw in JDK 9 - Modularity comes to Java" width="550" height="365" class="size-medium wp-image-257" /></a><p class="wp-caption-text">QCon London 2016 - Project Jigsaw in JDK 9 - Modularity comes to Java</p></div>
<p><br clear="none" /></p>
<h4>Java Compatibility Policy</h4>
<p>He started with an interesting fact: Java has a general and longstanding compatibility policy.<br />
If an application uses only supported APIs on version N of Java, it should work on version N+1, even without recompilation.<br />
That&#8217;s why, to date there are: </p>
<ul>
<li>23 classes, 18 interfaces and 379 methods that have been deprecated</li>
<li>And none have been removed.</li>
</ul>
<p><br clear="none" /></p>
<h4>JDK 9 brings breaking changes</h4>
<p>The JDK has been heavier and heavier over the years. With the version 9, things are going to change. For the first time, JDK 9 will bring incompatibilities.</p>
<ul>
<li>A small number of supported API will be removed</li>
<li>The binary structure of the JRE and JDK will change (see details below)</li>
<li>It is not allowed to use a single underscore <code>_</code> as a variable name. It is now a reserved keyword.</li>
<li>There will be a new version scheme so that it is easier to distinguish major, minor, and security-update releases, e.g. Java 9.1.2.1. The old versioning format is difficult to understand, e.g. 8h51 and 8u60 are not very meaningful.</li>
</ul>
<p>The JDK structure is changing. The JRE folder is removed, <code>tools.jar</code> and <code>rt.jar</code> are no longer present, as there was some duplication between them.</p>
<div style="max-width: 372px" class="wp-caption aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Pre-JDK 9 structure" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00084/pre-jdk9-structure.png?resize=362%2C357&#038;ssl=1" alt="Pre-JDK 9 structure" width="362" height="357" /><p class="wp-caption-text">Pre-JDK 9 structure</p></div>
<p>To have a complete understanding of the pre-JDK 9 structure, you can read <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jdkfiles.html" target="_blank" title="JDK and JRE File Structure" rel="noopener noreferrer">JDK 8 and JRE File Structure</a>.</p>
<div style="max-width: 384px" class="wp-caption aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" title="JDK 9 structure" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00084/jdk9-structure.png?resize=374%2C192&#038;ssl=1" alt="JDK 9 structure" width="374" height="192" /><p class="wp-caption-text">JDK 9 structure</p></div>
<p>The JDK 9 structure is much cleaner.</p>
<p><a href="http://openjdk.java.net/jeps/260" target="_blank" title="JEP 260 proposal" rel="noopener noreferrer">JEP 260 proposal</a> is at the heart of JDK 9 and Jigsaw.</p>
<p>The idea is to make most of the JDK&#8217;s internal APIs inaccessible by default but leave a few critical, widely-used internal APIs accessible, until supported replacements exist for all or most of their functionality.</p>
<p>The goal is to encapsulate all deprecated API in a module, then eventually getting rid of it in the future (JDK 10?).</p>
<blockquote><p>
Since JDK 8, a command line tool exists to analyze the dependencies of your JAR or class: <a href="https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool" target="_blank" title="Jdeps" rel="noopener noreferrer">jdeps</a>. Give it a try! It can be useful to discover if you are using JDK-internal APIs, you should avoid using these dependencies as they may be removed in the future.
</p></blockquote>
<p><br clear="none" /></p>
<h4>Jigsaw and modules</h4>
<p>We talk about module just before, but what is it?<br />
Jigsaw brings modularity to the JDK. It makes Java more scalable and flexible, it also improves security, maintainability and performance.<br />
The JDK is split up into modules, and then we take only what we need.</p>
<p><strong>Module</strong></p>
<p>A module is a grouping of code (collection of packages), it can also contain:</p>
<ul>
<li>Native code</li>
<li>Resources</li>
<li>Configuration data</li>
</ul>
<p><strong>My first module</strong></p>
<p>To define a module, you need to create a <code>module-info.java</code> file, including (for example):</p>
<pre class="brush: java; light: true; title: ; notranslate">
module com.company.mymodule { 
  requires com.company.myothermodule; 
  requires java.sql; 
}
</pre>
<p>You can have transitive dependencies (a bit like Maven) thanks to the keyword <code>public</code>.</p>
<pre class="brush: java; light: true; title: ; notranslate">
module java.sql { 
  requires public java.logging; 
}
</pre>
<p>This means if I have a dependency on the module <code>java.sql</code>, I will have access to all classes included in <code>java.logging</code> (as long as the types are <code>public</code>).</p>
<p>We now have a module dependency graph.</p>
<p><strong>Package visibility</strong></p>
<p>Use of the keyword <code>exports</code>.</p>
<pre class="brush: java; light: true; title: ; notranslate">
module com.company.myothermodule { 
  exports com.company.myothermodule.alpha;  
  exports com.company.myothermodule.beta; 
}
</pre>
<p>What is exported is visible, by default it&#8217;s not!</p>
<p>In Java 9, we have to redefine the keyword <code>public</code>, it comes in different flavours:</p>
<ul>
<li>Public to everyone</li>
<li>Public, but only to specific modules</li>
<li>Public, only within a module</li>
</ul>
<p>Public does not mean necessary accessible anymore, that&#8217;s a fundamental change.<br />
You can read the <a href="http://openjdk.java.net/projects/jigsaw/spec/sotms/" target="_blank" title="Jigsaw specification" rel="noopener noreferrer">Jigsaw specification</a> to know more.</p>
<p><strong>Compilation and execution with module path</strong></p>
<p>Forget about the <code>classpath</code> parameter, there is a new <code>modulepath</code> parameter (or <code>-mp</code>) in the <code>javac</code> / <code>java</code> command line. Its value is one or more directories that contain modules that are required to compile / execute your application.</p>
<p>Also, note there will be default module for the JAR files that are not module-compatible yet (automatic module).</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/06/computing-jobs-simplified-overview/" rel="bookmark" title="Computing jobs simplified overview">Computing jobs simplified overview</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" rel="bookmark" title="QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3520</post-id>	</item>
		<item>
		<title>QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</title>
		<link>https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/</link>
					<comments>https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 23:49:30 +0000</pubDate>
				<category><![CDATA[Event]]></category>
		<category><![CDATA[qcon]]></category>
		<category><![CDATA[spring]]></category>
		<guid isPermaLink="false">http://blog.fabianpiau.com/?p=3441</guid>

					<description><![CDATA[<p>&#160;Version française disponible Juergen Hoeller, the co-founder of the Spring framework was doing a presentation last week at QCon London. Some history background first, the Spring framework has been created in 2002 with a first release in 2004 (yes, it was 12 years ago!), quite a long time for a framework which is still widely [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/" rel="bookmark" title="QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>Juergen Hoeller, the co-founder of the <a href="https://spring.io/projects/spring-framework" target="_blank" title="Spring Framework" rel="noopener noreferrer">Spring framework</a> was doing a presentation last week at <a href="https://qconlondon.com/" target="_blank" title="QCon London website" rel="noopener noreferrer">QCon London</a>.</p>
<div style="max-width: 560px" class="wp-caption aligncenter"><a href="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00083/spring-5-qcon-london.jpg?ssl=1" rel="shadowbox[sbpost-3441];player=img;" title="QCon London 2016 - Spring Framework 5 - Preview &#038; Roadmap by Juergen Hoeller"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00083/spring-5-qcon-london-thumbnail.jpg?resize=550%2C365&#038;ssl=1" alt="QCon London 2016 - Spring Framework 5 - Preview &#038; Roadmap" title="QCon London 2016 - Spring Framework 5 - Preview &#038; Roadmap" width="550" height="365" class="size-medium wp-image-257" /></a><p class="wp-caption-text">QCon London 2016 - Spring Framework 5 - Preview & Roadmap</p></div>
<p><br clear="none" /></p>
<p>Some history background first, the <a href="https://spring.io/projects/spring-framework" target="_blank" title="Spring Framework" rel="noopener noreferrer">Spring framework</a> has been created in 2002 with a first release in 2004 (yes, it was 12 years ago!), quite a long time for a framework which is still widely used and under development. The adoption and the number of projects within Spring has never stopped growing since. At the beginning, Spring was created to manage POJOs in a lightweight container by using dependency injection (following the <a href="https://en.wikipedia.org/wiki/Inversion_of_control" title="Inversion of Control definition" target="_blank" rel="noopener noreferrer">Inversion of Control</a> or IoC principle), Spring was an alternative to heavy JEE containers such as GlassFish or WebSphere.</p>
<p><br clear="none" /></p>
<p>Spring has now become a set of projects that are available to fulfill many requirements when building an application. Spring is like a set of <em>Lego</em> bricks, you can pick and assemble these compatible sub-projects to build something bigger.</p>
<ul>
<li>Imagine you want to use a database, you can use <a href="https://projects.spring.io/spring-data/" target="_blank" title="Spring Data" rel="noopener noreferrer">Spring Data</a></li>
<li>You need to secure your application, just use <a href="https://projects.spring.io/spring-security/" target="_blank" title="Spring Security" rel="noopener noreferrer">Spring Security</a></li>
<li>You want to be able to login to your application through social networks, <a href="https://docs.spring.io/spring-social/docs/current/reference/htmlsingle/" target="_blank" title="Spring Social" rel="noopener noreferrer">Spring Social</a> is here for you</li>
<li>And so on</li>
</ul>
<p>You can take a look at the <a href="https://spring.io/projects" target="_blank" title="Spring projects" rel="noopener noreferrer">full list of Spring projects</a>.</p>
<p><br clear="none" /></p>
<h4>Spring 4.3</h4>
<p>Before jumping to Spring 5, Juergen talked about Spring 4. When I write this post, the current version is 4.2.5. A release candidate (RC) of Spring 4.3 will be available in March 2016 followed by a General availability (GA) one in May 2016. This version will include a couple of handy changes:</p>
<ul>
<li>In Spring Framework core:<br />
The <code>@autowired</code> annotation used to inject a dependency will be implicit so will become optional</li>
<li>In Spring MVC (part of the core):<br />
The declaration of a MVC controller is refined. Before, <code>value</code> was the attribute name:</p>
<pre class="brush: java; light: true; title: ; notranslate">
@RequestMapping(value = &#039;/mypath&#039;, method = RequestMethod.POST)
</pre>
<p>After, we use a more meaningful name <code>path</code>:</p>
<pre class="brush: java; light: true; title: ; notranslate">
@RequestMapping(path = &#039;/mypath&#039;, method = RequestMethod.POST)
</pre>
<p>There are even new annotation shortcuts to avoid specifying the HTTP <code>method</code> attribute. And even the attribute name is optional, so it becomes very simple.</p>
<pre class="brush: java; light: true; title: ; notranslate">
@PostMapping(&#039;/mypath&#039;)
</pre>
<p>And the equivalent for a <code>GET</code></p>
<pre class="brush: java; light: true; title: ; notranslate">
@GetMapping(&#039;/mypath&#039;)
</pre>
</li>
</ul>
<p><br clear="none" /></p>
<h4>Spring 5.0 announced</h4>
<p>Then, Juergen announced that Spring 5.0 will be available sometime in 2017 and compatible with JDK 8 and 9. On the roadmap, the GA should be available in March 2017 (at the same time the JDK 9 will be released). In case JDK 9 release is delayed, Spring 5.0 will be probably delayed too.</p>
<p><br clear="none" /></p>
<h4>What are the major updates in Spring 5?</h4>
<p>There are 3 key infrastructure themes:</p>
<ul>
<li>JDK 9 and Jigsaw modules</li>
<li>Servlet 4.0 and HTTP/2</li>
<li>Reactive architecture</li>
</ul>
<p><br clear="none" /></p>
<h4>JDK 9 and use of Jigsaw</h4>
<p>In short, <a href="http://openjdk.java.net/projects/jigsaw/" target="_blank" title="Jigsaw" rel="noopener noreferrer">Jigsaw</a> brings modularity to the JDK. The JDK is split up into modules and you can pick up only the ones you need to make your application works. </p>
<p>The JDK will come with a set of modules, but you can also define your owns. To define a module, you need to create a <code>module-info.java</code> file:</p>
<pre class="brush: java; light: true; title: ; notranslate">
module my.app.db {
  requires java.sql;
  requires spring.jdbc;
}
</pre>
<p>Inside a module, you specify the modules you need with the keyword <code>requires</code>. Modules are managing transitive dependencies, a bit like Maven. If I use the module <code>my.app.db</code> above, I will be able to access any classes coming from the <code>java.sql</code> module. The main benefit is that it makes your application more modular relying on a subset of modules instead of a full JDK.</p>
<p>All the jars for Spring 5 will come with Jigsaw metadata out of the box, the module name will follow the Maven Central jar naming to avoid confusion (spring-context, spring-jdbc, spring-webmvc&#8230;). It will be very easy to build your applications by specifying the Spring modules you need.</p>
<p><br clear="none" /></p>
<h4>HTTP/2</h4>
<p>HTTP/1.1 is an old protocol (1999) and has some limitations. In the front-end world, we are using some workarounds, but it is not ideal. For example, to avoid overloading the server with multiple requests when a page contains a lot of images, we use CSS sprites (i.e. combine these images into one single file that we then split on the client side via CSS). With HTTP/2, the protocol is faster as it allows concurrency requests and removes the &#8220;head-of-line blocking&#8221;. There are other benefits that you can read on the <a href="https://http2.github.io/faq/" target="_blank" title="HTTP/2 Frequently Asked Questions" rel="noopener noreferrer">HTTP/2 Frequently Asked Questions page</a>.</p>
<p>As Juergen stated, &#8220;We need to embrace HTTP/2 in the Java land as well!&#8221;</p>
<p>To achieve that, Spring 5 will use the latest version of the Servlet library, <a href="https://web.archive.org/web/20210508034255/https://blogs.oracle.com/theaquarium/servlet-40" target="_blank" title="Servlet 4.0" rel="noopener noreferrer">Servlet 4.0</a> that:</p>
<ul>
<li>Enforces support for HTTP/2 in servlet containers</li>
<li>Gives API features for Stream priorization and push resources</li>
</ul>
<p><br clear="none" /></p>
<h4>Reactive programming</h4>
<p>Another big announcement was the creation of a new Spring project called Spring Reactive. It will be a Spring MVC-like endpoint based on a reactive foundation.</p>
<ul>
<li>Reuses Spring MVC programming model style</li>
<li>But accepting and returning reactive streams (e.g. <a href="https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html" target="_blank" title="Reactor Mono publisher" rel="noopener noreferrer">Mono</a> &#8211; 1 element, <a href="https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html" target="_blank" title="Reactor Flux publisher" rel="noopener noreferrer">Flux</a> &#8211; list of elements)</li>
</ul>
<p>Spring Reactive will be based on <a href="https://github.com/reactor/reactor" target="_blank" title="Project Reactor Github" rel="noopener noreferrer">Project Reactor</a>, a set of foundational libraries for building reactive cloud-ready applications on the JVM. This new project is not stand-alone and will be included in the Spring Framework core at some point.</p>
<p>Juergen reminds us that &#8220;Reactive is coming&#8221;:</p>
<ul>
<li>No blocking thread involved</li>
<li>Reactive datastore drivers become available (PostgreSQL, Mongo, Couchbase&#8230;)</li>
<li>Reactive HTTP client (Netty, Jetty, OkHttp&#8230;)</li>
</ul>
<blockquote><p>Note for myself and maybe for you as well, it is important to read some materials on Reactive and get familiar with the concepts, it will probably spread in the following years.</p></blockquote>
<p><br clear="none" /></p>
<p>Last but not least, Spring 5 will use all the latest features introduced with Java 8:</p>
<ul>
<li>Lambdas, method reference, default methods in interfaces</li>
<li>Ability to expose JDK 8 API types in core interfaces and classes: <code>java.util.Optional</code>, <code>java.util.function</code>, <code>java.util.stream</code></li>
</ul>
<p><br clear="none" /></p>
<p>As a matter of fact, Spring 5 will require Java 8. If your project is still using an older version, you will have to use Spring 4.X. The good news is that Spring 4 will have an extended support until 2020, so you will still have some time to migrate!</p>
<p><br clear="none" /></p>
<p>Slides of the presentation are available on the <a href="https://qconlondon.com/london-2016/system/files/presentation-slides/juergenhoeller-springframework5_0.pdf" target="_blank" title="Slides - QCon London 2016 - Spring Framework 5 - Preview &amp; Roadmap" rel="noopener noreferrer">QCon website</a>.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/">QCon London 2016 &#8211; Spring Framework 5 &#8211; Preview &#038; Roadmap</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2016/04/14/qcon-london-2016-project-jigsaw-in-jdk-9-modularity-comes-to-java/" rel="bookmark" title="QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java">QCon London 2016 &#8211; Project Jigsaw in JDK 9 &#8211; Modularity comes to Java</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/12/27/a-java-11-migration-successful-story/" rel="bookmark" title="A Java 11 migration successful story">A Java 11 migration successful story</a></li>
<li><a href="https://blog.fabianpiau.com/en/2011/10/13/java-ee-cdi-vs-spring/" rel="bookmark" title="Java EE &#038; CDI vs. Spring">Java EE &#038; CDI vs. Spring</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/05/21/devoxx-uk-day-1/" rel="bookmark" title="Devoxx UK 2018 &#8211; Day 1">Devoxx UK 2018 &#8211; Day 1</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2016/03/15/qcon-london-2016-spring-framework-5-preview-and-roadmap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3441</post-id>	</item>
		<item>
		<title>The best free and online tools for testing and optimizing an application or website</title>
		<link>https://blog.fabianpiau.com/en/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/</link>
					<comments>https://blog.fabianpiau.com/en/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/#comments</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Sun, 15 Nov 2015 17:58:52 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[online tool]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[web]]></category>
		<guid isPermaLink="false">http://blog.fabianpiau.com/?p=3201</guid>

					<description><![CDATA[<p>&#160;Version française disponible In this article, I will give you some useful online tools to ensure your website is efficient, does not contain errors and is optimized for search engines (SEO). These three characteristics are very important because they form a virtuous circle by mutually reinforcing each other. None should be overlooked. Performance After analyzing [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/">The best free and online tools for testing and optimizing an application or website</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/" rel="bookmark" title="Tips to make your WordPress website secure">Tips to make your WordPress website secure</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/06/10/watin-an-automation-web-testing-tool/" rel="bookmark" title="WatiN, an automation web testing tool">WatiN, an automation web testing tool</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/15/optimize-your-website-for-print-in-5-minutes/" rel="bookmark" title="Optimize your website for print in 5 minutes">Optimize your website for print in 5 minutes</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p>In this article, I will give you some useful online tools to ensure your website is efficient, does not contain errors and is optimized for search engines (SEO). These three characteristics are very important because they form a virtuous circle by mutually reinforcing each other. None should be overlooked.</p>
<p><br clear="none" /></p>
<p class="right" style="padding-left:15px;"><a href="https://gtmetrix.com/" target="_blank" title="GTMetrix" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" title="GTMetrix" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00082/speedometer.png?resize=175%2C175&#038;ssl=1" alt="GTMetrix" width="175" height="175" /></a></p>
<h4>Performance</h4>
<p>After analyzing your website, <a href="https://gtmetrix.com/" target="_blank" title="GTMetrix" rel="noopener">GTMetrix</a> will give you valuable tips to improve its performance.</p>
<ul>
<li>Minimize the amount of resource to reduce the number of HTTP requests (using <a href="https://spritegen.website-performance.org/" target="_blank" title="CSS sprites" rel="noopener">sprites</a>, merging files)</li>
<li>Reduce the size of your resources. There are very good online compressors for <a href="https://tinypng.com/" target="_blank" title="TinyPNG" rel="noopener">images (TinyPNG)</a>, <a href="https://www.toptal.com/developers/cssminifier/" target="_blank" title="CSS minifier" rel="noopener">CSS</a> and <a href="https://www.toptal.com/developers/javascript-minifier/" target="_blank" title="JS minifier" rel="noopener">Javascript files</a>.</li>
<li>Specify image dimensions, the browser does not need to do this calculation</li>
<li>Use the browser cache</li>
</ul>
<p><br clear="none" /></p>
<p class="right" style="padding-left:15px;"><a href="https://seositecheckup.com/" target="_blank" title="SEO SiteCheckup" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" title="SEO SiteCheckup" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00082/seo.png?resize=500%2C208&#038;ssl=1" alt="SEO SiteCheckup" width="500" height="208" /></a></p>
<h4>Search Engine Optimization &#8211; SEO</h4>
<p>You can check your ranking with <a href="https://seositecheckup.com/" target="_blank" title="SEO SiteCheckup" rel="noopener">SEO SiteCheckup</a>. This tool will give you valuable information to improve your site&#8217;s visibility on the Internet.</p>
<ul>
<li>Using the basic HTML tags and attributes (title, description, h1, h2, alt&#8230;)</li>
<li>Creation of the sitemap file</li>
<li>Detection of broken links</li>
<li>Detection of the social activity linked to your website, your presence on social networks</li>
</ul>
<p><br clear="none" /></p>
<p class="right" style="padding-left:15px;"><a href="https://www.w3.org/developers/tools/" target="_blank" title="Outils W3C" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Outils W3C" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00082/analytics.png?resize=300%2C200&#038;ssl=1" alt="Outils W3C" width="300" height="200" /></a></p>
<h4>Technical validators</h4>
<p>You should also make sure your site is valid from a technical point of view. I recommend the <a href="https://www.w3.org/developers/tools/" target="_blank" title="W3C developer tools" rel="noopener">official developer tools provided by the World Wide Web Consortium (W3C)</a>. Each tool is specific for a particular purpose. For example, you will find a tool to validate:</p>
<ul>
<li><a target="_blank" href="https://validator.w3.org/" title="HTML validator" rel="noopener">HTML files</a></li>
<li><a target="_blank" href="https://jigsaw.w3.org/css-validator/" title="CSS validator" rel="noopener">CSS files</a></li>
<li><a target="_blank" href="https://validator.w3.org/checklink" title="Link checker" rel="noopener">Links</a></li>
<li><a target="_blank" href="https://validator.w3.org/feed/" title="RSS validator" rel="noopener">RSS newsfeed</a></li>
</ul>
<p>It is not necessary to validate every page one by one. The validation of the homepage is usually sufficient.</p>
<p><br clear="none" /></p>
<p class="right" style="padding-left:15px;"><a href="https://www.mail-tester.com/" target="_blank" title="Mail tester" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Mail tester" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00082/email.png?resize=150%2C150&#038;ssl=1" alt="Mail tester" width="150" height="150" /></a></p>
<h4>Email</h4>
<p>Your application is sending emails? With <a href="https://www.mail-tester.com/" target="_blank" title="Mail tester" rel="noopener">Mail tester</a>, you can test the relevance and format of your emails. This tool will let you know if the emails you are currently sending are considered as spam and also give you advice to avoid such a situation.</p>
<ul>
<li>The content should adapt to the size of the screen (responsive design)</li>
<li>An alternative raw text format should be attached for email clients that cannot render HTML</li>
<li>The authentication of your emails should be properly configured (SPF, DKIM)</li>
</ul>
<p class="center"><a href="https://www.w3.org/developers/tools/" target="_blank" title="Outils W3C" rel="noopener"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Outils W3C" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00082/responsive.png?resize=273%2C160&#038;ssl=1" alt="Outils W3C" width="273" height="160" /></a></p>
<p><br clear="none" /></p>
<p>To give you an idea of your site&#8217;s performance compare to others, most of the tools quoted in this article will give you a score, now you have to increase it!</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/">The best free and online tools for testing and optimizing an application or website</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2010/04/04/maven-site-one-step-further/" rel="bookmark" title="Maven Site, one step further">Maven Site, one step further</a></li>
<li><a href="https://blog.fabianpiau.com/en/2018/10/10/tips-to-make-your-wordpress-website-secure/" rel="bookmark" title="Tips to make your WordPress website secure">Tips to make your WordPress website secure</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/06/10/watin-an-automation-web-testing-tool/" rel="bookmark" title="WatiN, an automation web testing tool">WatiN, an automation web testing tool</a></li>
<li><a href="https://blog.fabianpiau.com/en/2013/09/15/optimize-your-website-for-print-in-5-minutes/" rel="bookmark" title="Optimize your website for print in 5 minutes">Optimize your website for print in 5 minutes</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2015/11/15/the-best-free-and-online-tools-for-testing-and-optimizing-an-application-or-website/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3201</post-id>	</item>
		<item>
		<title>Should we be wary of Google?</title>
		<link>https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/</link>
					<comments>https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/#respond</comments>
		
		<dc:creator><![CDATA[Fabian Piau]]></dc:creator>
		<pubDate>Mon, 25 May 2015 21:22:03 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[privacy]]></category>
		<guid isPermaLink="false">http://blog.fabianpiau.com/?p=3122</guid>

					<description><![CDATA[<p>&#160;Version française disponible Google is part of our daily lives Countless news reports are chronicling the hegemony of the US firm. Google&#8217;s success fascinates, irritates and sometimes scares. Like most Internet users, it is difficult to spend a day without using one of the services provided by Google. At some point, you ever : Browsed [&#8230;]</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/">Should we be wary of Google?</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2012/09/24/using-google-docs-to-create-an-online-survey/" rel="bookmark" title="Using Google Forms / Drive / Docs to create an online survey">Using Google Forms / Drive / Docs to create an online survey</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/" rel="bookmark" title="FAQ &#8211; Online survey with Google Forms / Drive / Docs">FAQ &#8211; Online survey with Google Forms / Drive / Docs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/07/25/open-street-map-better-map-than-google-maps/" rel="bookmark" title="Open Street Map, better map than Google Maps?">Open Street Map, better map than Google Maps?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/08/19/google-wave/" rel="bookmark" title="Google Wave">Google Wave</a></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p><a class="lang" href="https://blog.fabianpiau.com/fr/2015/05/25/should-we-be-wary-of-google/" title="Lire en français"><strong class="labellang"><span class="fr">&nbsp;</span>Version française disponible</strong></a></p>
<p><br clear="none" /></p>
<p class="center"><img data-recalc-dims="1" loading="lazy" decoding="async" title="Google logo" src="https://i0.wp.com/blog.fabianpiau.com/wp-content/uploads/post/00081/google-logo.png?resize=550%2C242&#038;ssl=1" alt="Google logo" width="550" height="242" /></p>
<h4>Google is part of our daily lives</h4>
<p>Countless news reports are chronicling the hegemony of the US firm. Google&#8217;s success fascinates, irritates and sometimes scares. Like most Internet users, it is difficult to spend a day without using one of the services provided by Google. At some point, you ever :</p>
<ul>
<li>Browsed the web with Google Chrome</li>
<li>Searched the Internet with Google Web Search</li>
<li>Read your emails with Gmail</li>
<li>Organized your appointments with Google Calendar</li>
<li>Managed your photo albums with Picasa</li>
<li>Chatted with your friends with Google+ or Google Hangouts</li>
<li>Watched videos with YouTube</li>
<li>Read books with Google Books</li>
<li>Managed your documents with Google Docs</li>
<li>Translated an article with Google Translate</li>
<li>Planed your moves with Google Maps</li>
<li>Managed your phone, contacts or alarm clock (and more) with Android</li>
<li>And even more&#8230;</li>
</ul>
<p>The giant has diversified and is now competing on all fronts (automation, robotics, automotive&#8230;). Its strategy is still focusing on individuals and how to improve everyday life. You can read this <a target="_blank" href="https://en.wikipedia.org/wiki/List_of_mergers_and_acquisitions_by_Google" title="List of mergers and acquisitions by Google">list of mergers and acquisitions by Google</a> to convince yourself.</p>
<p><br clear="none" /></p>
<h4>One search may hide another</h4>
<p>Did you know that Google is gathering and storing all your searches? Google is able to time travel in your search history, to the nearest second. The fact that you have searched for information on your future trip to Thailand on August 10th, 2005 at 10:05 may not be very useful to you, but this information among other represent a goldmine for Google, in order to establish your very detailed profile. It is however possible to disable this feature if you go to your account&#8217;s advanced settings. This is not something that an average user does. This is not a coincidence if this setting is enabled by default. A Google search may be trivial at first, but imagine that you&#8217;re looking for:</p>
<ul>
<li>Cars and brand comparison, Google will determine that you will change your car soon</li>
<li>Fashion and clothing throughout the year, Google will determine that you are working in this sector</li>
<li>A disease and related remedies, Google will determine that you have this disease</li>
<li>Tips to save money, Google will determine that you are barely making ends meet at the end of the month</li>
</ul>
<p>Jobs, places, favourite musics, movies, cooking, hobbies or political views. These examples are fairly simple, but it can goes very far when overlapping the information. It becomes possible to tell very accurately the events of a lifetime. If you think that Facebook is the biggest player, you&#8217;re probably wrong.</p>
<p><br clear="none" /></p>
<h4>You&#8217;re the product</h4>
<p>Google is continuously collecting huge amount of data from and about its users. It builds and consolidates complete profiles of our lives, and probably knows you better than your own mother or even yourself. Google&#8217;s services are free in exchange of your personal data. It is an implicit contract that you agreed (not necessarily read) when creating your account. The data collected can be sold and used for targeted marketing campaigns, statistics, etc. After all, it is fair game!</p>
<p><br clear="none" /></p>
<h4>Smile, you&#8217;re on filter</h4>
<p>The search engine displays a customized list of results, showing only the results that are relevant to your profile. You can do this simple experiment at home: run several searches with the same set of keywords but using different Google accounts. The list of results will probably be slightly different, especially if people are different (e.g. different gender or generation). The fact that the results are relevant to the connected user is a positive aspect, but it can also be a disadvantage. The primary purpose of the Internet is to make the universal knowledge accessible with a censorship as limited as possible. If you add an intelligent filtering system on your searches, there will be articles or even entire sections of the internet that you&#8217;ll never be aware of, simply because Google has decided so. Somehow, the knowledge and access to the information become limited or even incorrect.</p>
<p><br clear="none" /></p>
<h4>I&#8217;m not anti-Google</h4>
<p>Do not be mistaken, this article is not a pamphlet against Google. I am a very satisfied user for years and it will be probably painful to navigate the web without their services. This is more of a wakeup call. It is worth to spend some time to set up your account rather than letting Google decide for you. Unfortunately, I don&#8217;t know any magic tricks to continue using Google while preserving your privacy. However, I can advise you an alternative search engine <a target="_blank" href="https://duckduckgo.com/" title="DuckDuckGo search engine">DuckDuckGo</a>. This search engine has gained great popularity by focusing on the respect of your privacy without neglecting the relevance of the results.</p>
<p>The article <a href="https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/">Should we be wary of Google?</a> was written by Fabian Piau.</p>
<div class='yarpp yarpp-related yarpp-related-rss yarpp-template-list'>
<!-- YARPP List -->
<h3>Related posts:</h3><ol>
<li><a href="https://blog.fabianpiau.com/en/2012/09/24/using-google-docs-to-create-an-online-survey/" rel="bookmark" title="Using Google Forms / Drive / Docs to create an online survey">Using Google Forms / Drive / Docs to create an online survey</a></li>
<li><a href="https://blog.fabianpiau.com/en/2016/04/24/faq-online-survey-with-google-docs-drive-forms/" rel="bookmark" title="FAQ &#8211; Online survey with Google Forms / Drive / Docs">FAQ &#8211; Online survey with Google Forms / Drive / Docs</a></li>
<li><a href="https://blog.fabianpiau.com/en/2012/07/25/open-street-map-better-map-than-google-maps/" rel="bookmark" title="Open Street Map, better map than Google Maps?">Open Street Map, better map than Google Maps?</a></li>
<li><a href="https://blog.fabianpiau.com/en/2009/08/19/google-wave/" rel="bookmark" title="Google Wave">Google Wave</a></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.fabianpiau.com/en/2015/05/25/should-we-be-wary-of-google/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3122</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced (DONOTCACHEPAGE constant is defined) 
Minified using Disk
Database Caching 2/203 queries in 0.225 seconds using Disk (Request-wide DONOTCACHEDB constant defined)

Served from: blog.fabianpiau.com @ 2026-01-19 12:30:33 by W3 Total Cache
-->