<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Edu Luz on Medium]]></title>
        <description><![CDATA[Stories by Edu Luz on Medium]]></description>
        <link>https://medium.com/@oniroide?source=rss-49280e130e36------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PNrKG96zhXNDiH9BmGDtEQ.jpeg</url>
            <title>Stories by Edu Luz on Medium</title>
            <link>https://medium.com/@oniroide?source=rss-49280e130e36------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 13:45:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oniroide/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Memorize tudo]]></title>
            <link>https://medium.com/@oniroide/memorize-tudo-9e30da635a6b?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e30da635a6b</guid>
            <category><![CDATA[asynchronous]]></category>
            <category><![CDATA[memoization]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[cache]]></category>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Thu, 05 Apr 2018 04:07:54 GMT</pubDate>
            <atom:updated>2018-04-05T12:14:30.765Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZNKtOH48Z7BzyVMCiKuiQ.jpeg" /><figcaption>a nave mãe</figcaption></figure><p>Imagine um cenário apocalíptico e fabuloso onde exista uma nave de emergência para as vítimas de um cataclisma.</p><p>O problema: a nave mãe possui capacidade de atendimento limitada e que antes era protegida por outras pequenas naves de apoio que não conseguiam levar os sobreviventes a esta principal para obter a tão sonhada informação que é fonte de vida aos sobreviventes.</p><blockquote>Poucos sabiam que a nave mãe não poderia atender a tantos pedidos de socorro</blockquote><p>Partindo deste ponto da história em meio ao caos que reinava no planeta, alguns nobres guerreiros foram contruindo novas e performáticas naves de apoio e conseguiram levar os sobreviventes a nave mãe mas foram avisados que a tão sonhada <strong>Nave </strong>não poderia atender à todos os resgatados por falta de recursos.</p><p>Nesse cenário de pânico, vozes clamaram por socorro e num retumbar de trombeta uma lembrança trouxe uma simples solução: <strong><em>Fibonacci e </em></strong><a href="https://en.m.wikipedia.org/wiki/Memoization"><strong><em>memoization</em></strong></a>.</p><p>A sequência <a href="https://pt.wikipedia.org/wiki/Sequ%C3%AAncia_de_Fibonacci">Fibonacci</a> consiste em uma sequência de números inteiros na qual, cada termo subsequente corresponde à <strong>soma</strong> dos dois anteriores.</p><h4>E qual a relação com a fábula anterior?</h4><p>O que poucos sabem é que em termos programação, a sequência pode ser facilmente resolvida ou pode ser resolvida com bastante processamento computacional que acaba sendo ruim para quem consome o algoritmo.</p><p>Função Fib não performática:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0856aada02e573af724101db0fb41546/href">https://medium.com/media/0856aada02e573af724101db0fb41546/href</a></iframe><p>É bem verdade que o código acima resolve o problema mas poucos sabem que para valores maiores, o cálculo pode levar bastante tempo; utilizando a função acima temos os tempos de resposta para os valores inteiros de exemplo 3,4 e 39:</p><pre><em>3: calcula fib em (1ms)</em></pre><pre><em>4: calcula fib em (1ms)</em></pre><pre><em>39: calcula fib em (</em><strong><em>895ms</em></strong><em>)</em></pre><p>Esses valores podem ser obtidos através de <em>console.time</em> e <em>console.timeEnd</em> do seu navegador ou REPL nodeJS.</p><p>Agora vem a seguinte pergunta à mente: por que há esse tempo de execução divergente entre um cálculo e outro? O valor de fib(39) levou 894 vezes mais tempo que fib(4).</p><p>Veremos:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JEjYHwY-NUYXRoGA5Sgx8Q.jpeg" /></figure><p>A imagem acima pode ser avaliada com uma árvore binária de execução da função acima para o valor 4. Note quantos nós são criados.</p><p>São 9 para o valor 4, 17 para o valor 5 e 27 para o valor fib(6). Estes nós refletem a quantidade de chamadas à função na solução recursiva acima.</p><p>Note também que muitos nós ao serem resolvidos tem como resultado os mesmos valores. Agora imagine o número de chamadas para o valor 39 e entenderá a diferença no tempo de execução, uma vez que o valor 39 com a função acima gerará muitos nós.</p><p>O nome disso é <a href="https://en.wikipedia.org/wiki/Time_complexity#Exponential_time"><strong>Exponential Runtime</strong></a>.</p><p>Abaixo veremos como tornar nosso algoritmo mais performático entregando um <a href="https://en.wikipedia.org/wiki/Time_complexity#Logarithmic_time"><strong>Logarithmic runtime</strong></a>.</p><h4>Então por que executar as mesmas chamadas novamente?</h4><p>Para evitar este problema vamos alterar um pouco a função acima e adicionar memoization ou uma camada de “cache” em memória.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/240b41e31e12648ed190831412168730/href">https://medium.com/media/240b41e31e12648ed190831412168730/href</a></iframe><p>Note que a versão acima possui uma função <em>mem</em> e cria um simples “<em>mapa</em>”(poderia utizar um Map ou Set) chamado cache que recebe os argumentos passados ao mesmo através de ES 6 destructuring e os utiliza como chave. Se o valor já existe no mapa não é necessário efetuar uma nova chamada a função através do apply ou call, o que é feito é a utilização do que está na memória. Utilizando como exemplo o valor 4, o número de chamadas utilizando esta versão do algoritmo seria reduzido a 6.</p><p>Para exemplificar a alteração em termos de tempo de execução vamos utilizar os mesmos números de exemplo:</p><pre>3: calcula fib em (1ms)</pre><pre>4: calcula fib em (1ms)</pre><pre>39: calcula fib em (1ms)</pre><blockquote>Note a diferença dos tempos de execução para a versão sem memoization e a atual para o valor de fib(39).</blockquote><p>Após esta alteração poderíamos até considerar agora o exemplo como uma virtual binary tree em termos de execução.</p><p>Um vídeo interessante sobre VBT/Immutable data é esse</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWo0qiGPSV-s%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWo0qiGPSV-s&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWo0qiGPSV-s%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b261fb2137a0163f23e5a9a5559a83a/href">https://medium.com/media/4b261fb2137a0163f23e5a9a5559a83a/href</a></iframe><p>e dá uma ideia do que é o core utilizado no algoritmo de reconciliação do React.</p><h4>E qual a relação com o conto acima?</h4><p>Podemos utilizar a mesma ideia para requisições que são efetuadas em paralelo ou concorrentes a serviços que tenham tempos de execução/resposta lentos.</p><p>Num cenário como esse, essas requisições acabam não utilizando o cache de resposta uma vez que a primeira requisição ainda não foi respondida, ou seja, a(s) requisição/requisições posteriores irão direto na fonte da informação que já está sobrecarregada.</p><p>Neste ponto é importante utilizar o conceito de memoization mas num contexto de semáforo de chamadas a API. Sim, colocaremos um semáforo nas chamadas que são assíncronas(geram <a href="https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promises</a> ou Futures em Python), colocando-as em “cache” de memória utilizando como chave os argumentos destas chamadas: com isso as chamadas subsequentes ficarão em espera até que a primeira seja respondida e as posteriores utilizarão estes resultados para suas respostas dentro de um <a href="https://pt.wikipedia.org/wiki/TTL">TTL</a> especificado.</p><p>No contexto de aplicação NodeJs que utiliza <a href="https://github.com/axios/axios">axious</a>, existe uma lib de apoio chamada <a href="https://www.npmjs.com/package/cachios">cachios</a> que é a implementação sugar para a ideia acima. A explanação pode utilizar outras libs ou ser implementada from scratch.</p><p>O objetivo aqui não era de traçar métricas de throughput e latência mas sim apresentar um pequeno paliativo para bottlenecks de sistemas diversos.</p><p>É importante salientar que as propostas técnicas acima apenas retardarão o real problema, sendo necessário foco total na raiz do mesmo para evitar que um próximo cataclisma ocorra. Isso fará toda a diferença entre jogar uma partida para ganhar e jogar para não perder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*W50YL5wUwLI6W7UxhBPOpQ.jpeg" /><figcaption>Antes de quebrar as regras é importante conhecer suas bases</figcaption></figure><p>Se quiser saber mais sobre assincronicidade eu comecei uma pequena série sobre Streams:</p><p><a href="https://medium.com/@oniroide/stop-freaking-memory-release-the-javascript-streams-api-part-i-85223808d33b">Stop freaking memory! Release the JavaScript Streams API — Part I</a></p><p>Para dúvidas, ajustes e sugestões estamos aí!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e30da635a6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop freaking memory! Release the JavaScript Streams API — Part I]]></title>
            <link>https://medium.com/@oniroide/stop-freaking-memory-release-the-javascript-streams-api-part-i-85223808d33b?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/85223808d33b</guid>
            <category><![CDATA[iteration-protocol]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ecmascript]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Mon, 02 Apr 2018 03:27:47 GMT</pubDate>
            <atom:updated>2018-04-02T03:27:47.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmjxJl4e89aFYBGA1V8xTQ.jpeg" /></figure><p>Some time ago in the dark age of the web, everything was synchronous. It was necessary to wait for the whole page to download to see a text, an image, etc.</p><p>But it changed!<br>Fortunately for us as user/developer, some browsers have recently added support for Readable Streams.</p><p><strong>What are Streams? <br></strong>Streams are data sources that can be manipulated in small parts called chunks and provide an interface for reading and writing that parts instead of getting the whole data buffered and processed before delivery, which causes a lot of memory consumption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*wrofsWXmebGJ_UG-wYcNyg.gif" /><figcaption>Source: <a href="https://jakearchibald.com/2016/streams-ftw/">https://jakearchibald.com/2016/streams-ftw/</a></figcaption></figure><p>A chunk can be a single byte or something larger, as long as all the chunks are the same size. When I say “something”, it is because it can handle <a href="https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/TypedArray">Typed Array</a>s and a single Stream can work with different chunk sizes and types.</p><p>Another benefit is that it can handle backpressure. For example, if a consumer doesn’t have optimized throughput or it is slow processing those chunks it can notify a producer to smooth the flow of data delivered. Backpressure solves this kind of problem by moving from one process to another draining data from the internal queue and yes, there is a queue and queuing strategies to work with chunks — , although this should be explained in depth in another post.Why is it important?</p><p>Streams had never been available to JavaScript before, so our software needs to receive the entire file, and process the whole file to a buffer or blob. With streams we can detect the start/end, chain chunks, handle errors and cancel when required.</p><p>In fact, there is an economy of resources: less memory consumed and less battery consumed on devices which delivers a better user experience.</p><p>As JS developers we’ve got a lot of support for synchronous iteration in ES6. We got a lot of choices: <em>for…of</em>, Spread operator, <em>Array.from</em>, etc.</p><p>An Iterator is an object that knows how to iterate over a list of items from a collection. It must implement the <em>@@iterator method which key is the constant Symbol.iterator, a next</em> method that returns the following item in the sequence as an object with attribute ‘done’, which is Boolean, and ‘value’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*U8FzjhjB95vHhCsvEoG76Q.png" /><figcaption>Source: <a href="https://developer.mozilla.org/">https://developer.mozilla.org</a></figcaption></figure><p>Using a typed notation, a structure of an iterator can be shown like below:</p><pre>interface Iterable { <br>  [Symbol.iterator]() : Iterator; <br>} </pre><pre>interface Iterator { <br>  next() : IteratorResult; <br>} </pre><pre>interface IteratorResult { <br>  value: any; <br>  done: boolean; <br>}</pre><h4>Generators</h4><p>Generators are a special type of function, a factory of iterators that keeps track of its own state an can be paused/resumed via methods (<em>yield</em>/<em>next</em>) returning synchronously a Generator object, simplifying the work with Promises.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HHDy1pFUV0FeV2ohNL8zw.png" /><figcaption>Source: <a href="https://codeburst.io/generators-in-javascript-1a7f9f884439">https://codeburst.io/generators-in-javascript-1a7f9f884439</a></figcaption></figure><h4>Why is it important talking about generators and iterables?</h4><p>Since Browsers added support for Readable Streams it could be awesome if it is possible to iterate asynchronously over those chunks. How can we do that?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*cOlGgP-0YNS8BuXOZrn-rg.jpeg" /></figure><h3>Asynchronous Iteration with for-await-of</h3><p>The <strong><em>iterable</em></strong> protocol allows JavaScript objects to define or customize their iteration behavior. The <strong><em>iterator</em></strong> protocol defines a standard way to produce a sequence of values.</p><h4><em>But what we want?????</em></h4><p><em>A way iterate over async iterables. With for await of, Javascript provides a way to iterate over async iterables and sync as a fallback since for…of iterates only with sync data.</em></p><p>A typed notation of async iterable can be show below:</p><pre>interface AsyncIterable {<br>    [<strong>Symbol</strong>.asyncIterator]() : AsyncIterator;<br>}<br>interface AsyncIterator {<br>    next() : <strong>Promise</strong>&lt;IteratorResult&gt;;<br>}<br>interface IteratorResult {<br>    value: any;<br>    done: boolean;<br>}</pre><p>Note that this version of the code has Symbol.<strong><em>asyncIterator</em></strong> instead of Symbol.<strong><em>iterator </em></strong>and the method <em>next</em> returns a <em>Promise&lt;IteratorResult&gt;, not the value itself. S</em>o each time next is called the Promise returned from the iterator is “awaited”. Each part of the iterable object will be queued, clearing the main thread to process another task/microtask until the promise is resolved.</p><p>In this post, I wanted to show the basics of the Language to deal with collections of data. In the next post, I will show an example of Streams API and Reactive Programming as an alternative to async iteration.</p><p>Let me know for any doubt, typo or improvement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85223808d33b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple introduction to React Fiber]]></title>
            <link>https://medium.com/@oniroide/simple-introduction-to-react-fiber-9dbf3f2e8c0d?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dbf3f2e8c0d</guid>
            <category><![CDATA[scheduling]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-fiber]]></category>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Fri, 31 Mar 2017 02:34:06 GMT</pubDate>
            <atom:updated>2017-05-25T22:46:43.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfVVqnuU0qPDegHEwQ-KOw.jpeg" /><figcaption>Fiber virtual stack frame</figcaption></figure><p>When you render an app, a tree of nodes that describes the app is saved in memory and every change in state forces a new tree to be generated. React uses reconciliation to discover which parts of the tree need to be re-rendered, so reconciliation and render are separated phases and enable more render “engines” like <a href="https://facebook.github.io/react-native/">React Native</a> and <a href="https://github.com/facebook/react-vr">React VR</a>.</p><p>What facebook is doing right now is reimplementing the reconciler. React Fiber the new experimental version algorithm of reconciliation.<br>It uses a fiber that is a unit of work(<em>simple plain object</em>) to be done on the window.requestAnimationFrame and window.requestIdleCallback.</p><p>Actually React walks recursively in the stack and call render functions of the whole updated tree, in the future it will delay some updates to avoid the drop of frames.</p><p>Fiber will take advantage of scheduling that is the process of determining when a work(<em>any computation, result of a State change</em>) should be done.</p><p>So React uses <a href="https://developer.mozilla.org/pt-BR/docs/Web/API/Window/requestIdleCallback">requestIdleCallback</a> to low priority fibers because this unit of work will be queued to be called during the browser’s idle periods and <a href="https://developer.mozilla.org/pt-BR/docs/Web/API/Window/requestAnimationFrame">requestAnimationFrame</a> for priority tasks. It is the reimplementation of the stack for React components, something like a virtual stack frame.</p><p>We can expect some support for Promisse async components… maybe</p><p>Here you can see the difference between the actual React Stack vs Fiber:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQu_6ItnlDQg%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQu_6ItnlDQg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQu_6ItnlDQg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ee93dd6e08aeced7adfb2b819af9ccb/href">https://medium.com/media/2ee93dd6e08aeced7adfb2b819af9ccb/href</a></iframe><p><strong>More about fiber:</strong></p><ul><li><a href="https://github.com/acdlite/react-fiber-architecture">https://github.com/acdlite/react-fiber-architecture</a></li><li><a href="https://www.youtube.com/watch?v=ZCuYPiUIONs">https://www.youtube.com/watch?v=ZCuYPiUIONs</a></li></ul><p>Let me know your thoughts…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dbf3f2e8c0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nuts about alpine image size optimization]]></title>
            <link>https://medium.com/@oniroide/nuts-about-alpine-image-size-optimization-7ffcd53cce71?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ffcd53cce71</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[alpine]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Tue, 11 Oct 2016 02:19:26 GMT</pubDate>
            <atom:updated>2019-03-02T09:49:18.558Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Update</strong>: Since version 17.05, docker provided a simple way to build smaller image sizes <a href="https://docs.docker.com/develop/develop-images/multistage-build/">https://docs.docker.com/develop/develop-images/multistage-build/</a></p><p>We were running our development environment with a very heavy debian image of 890MB. So, we tried to use alpine linux for a lightweight image. Our first build was a 360mb but alpine perspective promise sizes between 50~70mb.</p><p><strong>Tip 1</strong>: this will be the last improvement but the simplest one, join every <strong><em>RUN</em></strong> inside one instruction saving up some layers</p><pre>RUN apk update</pre><pre>RUN apk add libmemcached</pre><pre>RUN apk add curl</pre><p>to</p><pre>RUN apk update &amp;&amp; add libmemcached curl</pre><p>If you need to break line for better understanding, it can be done this way:</p><pre>RUN apk update &amp;&amp; add libmemcached \</pre><pre>curl &amp;&amp; wget <a href="http://speedtest.ftp.otenet.gr/files/test100k.db">http://speedtest.ftp.otenet.gr/files/test100k.db</a></pre><p><strong>Tip 2</strong>: apk –virtual and del</p><p>Separate needed libs for your image from needed libs only for compilation with the virtual flag and give a name to this group of packages:</p><pre>RUN apk add autoconf gcc make g++ zlib-dev file g++ libc-dev pkgconf libmemcached-dev </pre><p>to</p><pre>RUN apk add --virtual .build-deps autoconf gcc make g++ zlib-dev file g++ libc-dev pkgconf libmemcached-dev \<br>&amp;&amp; <strong>apk del .build-deps &amp;&amp; rm -rf tmp/*</strong></pre><p>The last instruction will remove the package group and temp files.</p><p><strong>Tip 3</strong>: Any download and compilation must be executed inside <strong>/tmp</strong></p><pre>sed -i &quot;s/\ \-n\ / /&quot; $(which pecl) &amp;&amp; <strong>cd /usr/local</strong> <br>&amp;&amp; pecl download memcached &amp;&amp; tar -xf $(ls -1 memcached*); cd &quot;$(ls -d ./memcache*|grep -v &quot;\.tar&quot;)&quot; &amp;&amp; phpize &amp;&amp; ./configure --disable-memcached-sasl --with-php-config=/usr/bin/php-config --includedir=/usr/include --with-libdir=/usr/include --enable-memcached &amp;&amp; make &amp;&amp; make install</pre><p>to</p><pre>sed -i &quot;s/\ \-n\ / /&quot; $(which pecl) &amp;&amp; <strong>cd /tmp</strong> <br>&amp;&amp; pecl download memcached &amp;&amp; tar -xf $(ls -1 memcached*); cd &quot;$(ls -d ./memcache*|grep -v &quot;\.tar&quot;)&quot; &amp;&amp; phpize &amp;&amp; ./configure --disable-memcached-sasl --with-php-config=/usr/bin/php-config --includedir=/usr/include --with-libdir=/usr/include --enable-memcached &amp;&amp; make &amp;&amp; make install</pre><p>At this moment the image size is about 294mb, but alpine promises extreme reduction. Investigating our compilation we find that original path was <strong><em>/usr/local</em></strong><em>, so we changed to </em><strong><em>/tmp</em></strong></p><p><em>For every instruction not cleaned, each layer replicates those files like a </em>domino effect inflating image size and duplicating it when using FROM to extend with new features. After that change, the image size is about amazing <em>56.99mb</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*odTRsI2VOx1l5FG87FyBow.png" /></figure><p>Simple hints that make all the differences when working with multiple containers.</p><p>repository: <a href="https://github.com/luzeduardo/alpine-php-fpm">https://github.com/luzeduardo/alpine-php-fpm</a></p><p>For any doubt, correction and improvement let me know</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nhsmWMJuKoyAe5Jg8YDz6Q.jpeg" /><figcaption>You only live once so just go nuts</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ffcd53cce71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rescuing a declarative mindset]]></title>
            <link>https://medium.com/@oniroide/rescuing-a-declarative-mindset-e7ccd93fce6f?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7ccd93fce6f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Mon, 26 Sep 2016 02:42:02 GMT</pubDate>
            <atom:updated>2017-02-09T00:58:03.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday you were a simple <a href="https://en.wikipedia.org/wiki/Imperative_programming">imperative</a> developer.</p><p>Nowadays you need to be <a href="https://en.wikipedia.org/wiki/Pure_function">pure</a>, <a href="https://en.wikipedia.org/wiki/Referential_transparency">referentially transparent</a>, <a href="https://en.wikipedia.org/wiki/Immutable_object">immutable</a>, <a href="https://en.wikipedia.org/wiki/Monad_%28functional_programming%29">monad</a> and a lot more of things just to be better <a href="https://en.wikipedia.org/wiki/Functional_%28mathematics%29">functional</a>.</p><p>In fact, this old/new paradigm lives inside your brain, just think about math and everything will be more “vanilla sky”.</p><p>It will be a long and fun road, but I expect to take a picture like this in the future</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*Lt7ENCbbRuwL0WDHdP_x9Q.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7ccd93fce6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Liberdade]]></title>
            <link>https://medium.com/@oniroide/liberdade-c6a9196ca915?source=rss-49280e130e36------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6a9196ca915</guid>
            <dc:creator><![CDATA[Edu Luz]]></dc:creator>
            <pubDate>Mon, 05 Sep 2016 00:14:43 GMT</pubDate>
            <atom:updated>2016-09-05T00:14:43.145Z</atom:updated>
            <content:encoded><![CDATA[<p>E quando o fim chegar o que mais quero é descansar nas raízes de uma árvore centenária pra continuar vivendo na natureza, alegrando o sorriso de cada um a vislumbrá-la.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6a9196ca915" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>