Working at the same time in a project and its dependencies: Composer and path type repository
With the Domain-Driven Design, Microservices and API explosion, I see more teams working in a base project, such as a Web, and integrating other private packages they develop in a different repository. For example, working on the Web and an API client for a external REST service at the same time.
For example, at @AtrapaloEng, our sales development team (checkout process, purchases, orders, payments, etc.) integrates different payment methods into the web so users, specially Latam ones, can be happier using their preferred payment methods. They create a repository for each of the new payment methods we support as a external package. Sometimes a developer in the team must work with different projects at the same time, the Web and the payment method in development.
In this scenario, one option is work on the payment package, tag, push, go to the base project and update dependencies with Composer. As you can see, it’s a bit slower, how we can improve this process? Composer to the rescue!
First tests with #PHP7 in production at @AtrapaloEng
On Monday, Badoo blogged about its migration to PHP7 (https://techblog.badoo.com/blog/2016/03/14/how-badoo-saved-one-million-dollars-switching-to-php7/</a>). Those are great results! At @AtrapaloEng, we’re running already tests in production to perform the same step. We could have started some months before, but we’ve been struggling with the php-msgpack extension and its (un)support for PHP7. We hope to deploy PHP7 in all our server during this week but we would like to share with you what we have seen so far. What we have done is adding another FPM node with the same capabilities as the current ones running in production with PHP 5.6. The new node is getting the same amount of traffic as the other ones. No special configurations or tweaks such as Huge Pages, just PHP7 upgrade. Data after more than 24 hours running.
RESTGames – More than katas
Today, Christian (@theUniC) and I (@buenosvinos) would like to introduce you “REST Games“: Games based in REST Services for learning and practicing coding.
Its goal is to provide some coding challenges that go beyond katas. You will have to implement a small JSON REST API that will play a well known multiplayer game, such as battleship, connect-4, tic-tac-toe, etc. The best part comes when two mates develop the same JSON REST API and you can use our referees programs two make them play one against the other. Who will win?
Rendimiento con Domain Events, Proyecciones y principios de CQRS
Cuando desarrollamos una aplicación nueva, todo va muy rapidito. Hay poco tráfico, pocas queries y si hay alguna más “dura” usamos alguna cache como Memcached o Redis. Pero a medida que agregamos más funcionalidad a una página, el número de queries a base de datos u otras infraestructuras va creciendo. Hasta que sin saber cómo, haces 300 queries, y no es broma, en la ficha de algún producto.
El problema es que estamos acostumbrados a hacer muchas queries de lectura y muy pocas de escritura en estructuras bastante normalizadas. Eso escala mal en base a nueva funcionalidad. Un buen approach en busca del máximo rendimiento es la consistencia eventual, estructuras desnormalizadas y proyecciones.
Os dejo el video de la formación de @AtrapaloEng sobre cómo el uso de Eventos de Dominio y el uso de conceptos de CQRS nos pueden ayudar enormemente a mejorar el rendimiento de nuestras aplicaciones.
Setup your MacOS (or other OS) development team with Ansible
Imagine that a new developer joins your team, installing everything needed for developing, including the application being developed is not an easy o fast task. I’m sure you have a wiki process, a markdown file in your repo or something similar. For a normal PHP web application, there is so much to do: installing PHP, composer and global tools, npm and/or bower, mysql, redis, etc. or setting up you Docker/Vagrant environment if you choose an isolated environment.
I remember when GitHub released Boxen in 2012. A tool for managing Mac development boxes with love. It’s based in Puppet. The main idea is use Puppet for provisioning not remote machines or servers but you local Mac. Let’s see a silly idea about how to do it with Ansible.
3 commands for working with remote machines
These days I’m playing a bit with 5 Raspberries 2B (4 cores and 1 GB of RAM) in order to build a Docker cluster. There are different options: Docker Swarm over Consul/Etcd/Zookeper, Kubernetes by Google, etc. I just want to share some interesting commands for working with remote machines that have helped me to build such a cluster: ssh-copy-id, nmap and csshx.
Doctrine 2.5, DDD, Entities and Identities
If you’re developing applications in a Domain-Driven Design style and using Doctrine 2.5, you may be struggling with implementing your entities identities, I mean, UserId, ProductId, and so on. Embeddables are cool, but limited. Surrogates are not necessary anymore. Here are some short tips and examples about how to proceed.
Guía para el Desarrollo Profesional PHP (edición 2014)
Rascando por Youtube, encontré este vídeo de 2014, de una presentación que hice en LaSalle inspirada por otra que hice en Castellón en 2011. La idea es hacer un overview del ecosistema PHP y puntos importantes a la hora de montar un ciclo de desarrollo basado en esta tecnología. Que la disfrutéis.
Deploying Symfony (and PHP) apps with Ansistrano
For a long time, Capifony was, without any doubt, the facto option for deploying Symfony2 applications. Capifony is a ruby gem based in Capistrano v2, an open source tool for running scripts on multiple servers with a deployment flow built-in. It’s primary use is for easily deploying applications. While it was built specifically for deploying Rails apps, it’s pretty simple to customize it to deploy other types of applications. At that time, alternatives were shell scripting or Fabric. Now there’s a better one, Ansistrano.
Domain-Driven Design: Logging with Domain Events Webcast at @AtrapaloEng (Spanish)
Cuando trabajamos con aplicaciones DDD-style (aunque para las otras también aplica), una de las preguntas clásicas es como ejecutar tareas relacionadas con infraestructura desde las zonas más internas como Value Object o Entidades, sin violar la dependencias hacia capas superiores e incluso el SRP. Un ejemplo es logar información como acciones de usuario (tipo intento de acceso al sistema, alta de usuario, baja de usuario, etc.). El pasado Viernes, orientamos la formación de @AtrapaloEng sobre este tema. Os dejo el video y los ejercicios. Formación práctica basada en el proyecto de LastWishes con múltiples ejercicios resueltos in live coding.