Sunday, June 24, 2018

Good talks/podcasts (May 2018 II)



These are some interesting talks/podcast that I've seen/heard during this month:

Saturday, June 16, 2018

Pamplona Software Crafters 2018

This post is in Spanish because this conference and all the content was in Spanish.

Otro año más (y van tres), he tenido la gran suerte de poder asistir a la conferencia Pamplona Crafters. Esta conferencia mezcla charlas preestablecidas con open space y este año, muy acertadamente, también han incluido una serie de talleres.

Aunque en todas las conferencias a las que voy, aprendo y disfruto mucho, tengo que confesar, que en estos últimos dos años, la Pamplona Software Crafters es la que más me gusta. Supongo que es la combinación de la gente que vamos, las charlas y la tematica, con que me gusta Pamplona y por supuesto la impecable organización de los amigos de 540.



En cuanto a la conferencia en si, he asistido a las siguientes charlas/talleres:

  • Modelos mentales, complejidad y software (Arturo Herrero) (Video) Esta es una de las charlas que más me gustaron de toda la conferencia. Es un tema que me interesa, puesto que al igual que a Arturo he descubierto que el tema de interesarme por la complejidad y los modelos mentales me permite entender y relacionarme mucho mejor. Arturo ha escrito un muy interesante blogpost al respecto, incluyendo las slides que utilizo: https://arturoherrero.com/mental-models-complexity-and-software/ 
  • One Page Product Design (Jorge Barroso flipper83) Interesante charla sobre las ventajas de compactar, visualizar, gran cantidad de información mediante diagramas, screenshots, diseños en una única página/diagrama de forma que la podamos pegar por las paredaes, poner en alguna zona de paso, y la riqueza de conversaciones e impacto que esto genera… Una imagen vale más que mil palabras, y esa imagen pegada al lado de la máquina de café 
  • Sobreviviendo en producción. Construyendo una cultura de aprendizaje. (eferro) A petición de Modesto San Juan, propuse esta sesión para el Open Space. En ella, hable de como generar una cultura de aprendizaje comenzando a partir de la gestión de las inicidencias y usando como el Blameless Incident Report como medio. Esta aproximación la he usado en TheMotion y ahora en Nextail y la verdad es que ha funcionado muy bien. Tengo pendiente un blog post al respecto.
  • Taller Refactoring, aprendizaje y economía (Luis Artola, Guillermo Galmazor). Disfrute mucho en este taller, puesto que por necesidad temporal no le estoy pudiendo dedicar mucho tiempo al desarrollo, asi que cualquier oportunidad de hacer algo técnico lo disfruto muchisimo. El taller en si pretendia resolver la kata trivia de Jbrains (https://github.com/jbrains/trivia) aplicando Golden Master o Subclasses.  Como siempre con Luis y Guille, el disfrute viene de lo didacticos que son. Me gusto mucho y me quede con varias notas sobre la estrategia Golden Master para cuando tienes código legado cuyo compartamiento sólo puedes observar viendo su salida por consola.
  • El código como una forma de expresión (patxangas) Divertidisima e interesante charla sobre el uso creativo del código como medio de expresión. Muy impactante. Me trajo muchos recuerdos e ideas a la cabeza (Demoscene, videoarte, música experimental, etc). Además del contenido, siempre me encanta como se expresa y trasmite @patxangas sobre los temas más variopintos. Slides: https://slides.com/interzonas/el-cdigo-como-una-forma-de-expresin#/
  • Mide más y sufre menos (Modesto San Juan) Charla introductoria sobre la necesidad de instrumentar nuestro software de forma que dispongamos de información real para tomar decisiones. Quizás se me quedo algo corta, pero por lo que comente con Modesto, yo no era el público objetivo puesto que ya estoy convencido. En cualquier caso es importante que se mande de forma continua este mensaje ya que muchos de los desarrolladores se centran sólo en la parte funcional sin tener en cuenta que eso es sólo una parte de su trabajo.
  • Evolutionary Architecture (María Gómez) Esta charla me gusto mucho en contenido. Complementa desde un punto de vista algo más práctico a las charlas relacionadas de algunos de sus compañeros de ThoughtWorks. La charla se basa en lo descrito en el libro Building Evolutionary Architectures  (http://evolutionaryarchitecture.com/).
  • Cómo no ser un tech lead (Gamarra). Esta sesión de open space se organizó como una charla abierta en la que se comentó algunas ideas sobre cómo incentivar una a tus compañeros a formarse, crecer, etc. Cogi algunas ideas interesantes de lo que estaban haciendo en Tuenti y en Liferay, que espero poder poner en práctica.
  • ¿Arquitectura sin arquitectos? (German Del Zotto) Esta sesión planteo varias decisiones y balances que se tienen que tomar cuando estamos deciendo temas de artquitectura. German los describio como desciones a tomar, no por un arquitecto, sino como un habilidad que deberian poseer cualquier desarrollador. Me quede con ganas de más, pero seguro que puede quedar con German y profundizar en el tema. :)



Como siempre lo que más me ha gustado y lo que más me ha enriquecido han sido las grandes converaciones. Me vienen a la cabeza unas cuantas:

  • Con cataflu durante uno de los desayunos (además es una gran desvirtualizacion). 
  • Con nabaroa durante las cervezas del jueves (otra genial desvirtualización). Además hizó una impresionante lightning talk  acerca de las subidas y bajadas que experimentamos durante nuestra carrera y de cómo las ha gestionado ella.
  • Con Arturo Herrero sobre el mercado para desarrolladores de software en UK y sobre el value investing.
  • Con Helder y Marco Alacot sobre aprender/enseñar a programar, agilidad, y otras hierbas.
  • Con bberrycarmen  después de la sesión de Arturo sobre modelos  mentales. Con luisrovirosa sobre la charla que dio Martin Fowler en Madrid la semana anterior y de cómo “hemos sido engañados” con el tema de la agilidad, puesto que podemos resumirla en XP+DevOps.

Me resulto gracioso que rafaoe y algún que otro “milenial” tuviese curiosidad de cómo desarrollabamos en los 90s. :)
También disfrute de largas e interesantisimas conversaciones con jaceguzigiella, y mucha más gente…

Por supuesto disfrute como un enano con tejones como Saski, Fran Ortiz, amigotes de Alea como Apa, Ruben y Nestor y con muchisima gente más (sharpbitesalfredodev, Toño, jorgeuriarte, alfredocasado, ...)
Me quedé con pena por no haber podido hablar y disfrutar con todos, pero llega un punto en el que es prácticamente imposible.

He estado repasando la lista de asistentes (https://twitter.com/pamplonaswcraft/lists/asistentes-2018) y he estado tentado de pegarla por aquí, puesto que compartir tiempo con todos ellos ha sido un autentico placer...


Bola extra:
Este año no he podido ir con familia, lo que por un lado me da algo de pena, pero que por otro lado me ha permitido aprovechar el viaje de otra forma. Me he organizado para poder ir con Alberto Paz, Modesto San Juan y Jerolba. La verdad que ha sido como tener dos dias más de confencia…  Grandes conversaciones y mucho aprendizaje.

Foto de @benjymontoya (usada con autorización)

Muchas gracias a los organizadores (@wricka69, @pabloalbizu, @gorkma, Mikel Ros) … Sois muy Top!!!

PD: Iré actualizando el post según vaya recopilando recursos.

Saturday, June 02, 2018

Immutable infrastructure (tech pill)

Immutable infrastructure is a pattern to change/evolve processes without modifying the running code, actual configuration, and the base components (library, auxiliary processes, SO configuration, SO packages, etc).  In summary, avoid any manual or automatic configuration change to the running systems.
But if we don't allow changes, how can we evolve our application and service?  Easy, change the whole piece (function, container, machine) in one shot...



So to make any kind of change (code, configuration, SO) we don't connect to the target box to execute commands, we "cook" a new artifact (container image or machine image) and use it to create a new instance (container or machine) with the changes. In the past, the cost/time to create a new instance was huge, so in order to optimize the process, we tend to execute the minimal change needed to run the new version. I mean, use a manual or automatic process to ssh to the box, install the needed packages, change the configuration, update the code, etc.

But...
¿What happens when the ssh dies in the middle of an update?
¿And if we have a problem installing a package?
¿How can we be sure about the actual state of a machine?
¿How can we calculate the changes to execute if we are not sure about the actual state of a machine?

Making changes in a machine using ssh, is not a transactional operation so we can have a failure in the middle of the process.

The solution, Immutable Infrastructure...
Create a new artifact and run it. Without intermediate states. Only "Not Ready" or "Ready". Simple.  And if something is wrong, destroy the artifact and try again.

This pattern is at the core of the principals container-orchestration systems and PaaS (kubernetes, swarm, mesos, heroku, open shift, Deis, etc).

Why is a good idea

  • Simplicity. Is an order of magnitude easier to destroy a resource and create a new one from scratch than to calculate the deltas to apply and execute them. 
  • If we need scalability we need to support this patter anyway.
  • Right now is easy to implement with the help of the different clouds and PaaS providers.
  • Very easy to return to the previous version.
  • Very easy to troubleshoot a problem, because there are no intermediate states. You can know the exact content of a running version (the SO state, the concrete conf, the concrete code, etc).
  • With this approach, there is no difference between languages and running environment (python, jruby, java, all the same...).  Is a general solution for all the technology your systems requires.

What are the downsides

  • In some cases, the bootstrapping/setup time to use a new machine is larger than modifying an existing one. But the time is improving continuously and if we have a scalable architecture we already are dealing with it. Another solution is to use the patter at a different level, for example, functions or containers instead of at the machine level.
  • This pattern requires more and longer steps that the classic approach so it is not practical to do it without automation. But not automatize this kind of task is shooting in your foot anyway.

Implementation Samples

As a general implementation strategy we need to be capable to make the following steps:
  1. Start a new running process (without processing workload).
  2. Detect when this running process is ready to accept real workload.
  3. Connect the running process to start processing workload.
  4. Disconnect the old running process to stop receiving new workload.
  5. The old running process completes the workload that already has.
  6. Detect that all the pending workload of the old process is completed.
  7. Destroy the old process.


If we talk about web servers the steps can be:
  1. Start a new machine/container running the web server in an internal endpoint.
  2. Detect when the web server is ready using the health check endpoint.
  3. Connect the new web server internal endpoint to the load balancer with the external endpoint.
  4. Inform the old web server to stop processing new traffic and disconnect from the load balancer.
  5. Detect when the old web server finished.
  6. Destroy the old web server.
If we talk about a background queue job processor the workflow can be:
  1. Start a new machine/container running the background queue job processor.
  2. Detect that the new machine is processing jobs from the queue.
  3. Inform the old background queue job processor to not get new jobs.
  4. Detect when the old background queue job processor has completed its pending work.
  5. Destroy the old background queue job processor.
We can think similar steps for other kinds of processes.

Design Notes

As we can see, this pattern requires collaboration from our code and support from the platform, but I assume that this is part of designing scalable systems that make great use of the capabilities of the cloud. For a good reference about designing applications for the cloud, please read The 12 Factor Apps

We can apply the same pattern at different levels. Virtual machines, Containers, Functions... The ideas are the same but the granularity is different.

Using Infrastructure as Code is recommended prerequisite to implement this pattern.

Conclusions

  • The platforms are going in this direction so they have a lot of help to implement it.
  • This is the fundamental pattern for:
    • Scale up and down in the cloud.
    • Advance patterns for deploy with zero downtime (blue-green deploy, rolling deploy, canary releasing, etc).

Other tech pills: