Event Sourcing is not a messaging integration pattern

Different Architectural Styles

tl;dr: If you are sending messages to RabbitMQ to communicate one application to another, you are not doing Event Sourcing. You’re just doing messaging ;)

In the last two months, I’ve seen different nice talks using DDD, CQRS or Event Sourcing in the talk title. However, after watching the content, I think there are some general misunderstandings about some of the concepts. The most important one, in my honest opinion, is calling Event Sourcing to sending messaging to other applications using a broker. Event Sourcing is not about that. Let me explain a bit more.

Continue reading

Some “basuritas”: PHP, list() and objects

I was just playing around with the Symfony Expression Language Component. Suddenly, I started to play with list() and some objects and this example came up. You can use list() and $this for assigning fields. I would not recommend it, but it just funny.

class BasuritasTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     * @dataProvider validUsersDataProvider
     * @param $id
     * @param $name
     */
    public function listForObjects(int $id, string $name)
    {
        $user = new User($id, $name); 
        $this->assertSame($id, $user->id());
        $this->assertSame($name, $user->name());
    }

    public function validUsersDataProvider()
    {
        return [
            [1, "Carlos"],
            [2, "Christian"],
            [3, "Keyvan"],
            [4, "Ricard"]
        ];
    }
}

class User
{
    private $id;
    private $name;

    public function __construct($id, $name)
    {
        list($this->id, $this->name) = [$id, $name];
    }

    public function id() : int 
    {
        return $this->id;
    }

    public function name() : string
    {
        return $this->name;
    }
}

The interesting thing is the line 34. The output:

PHPUnit 5.4.8 by Sebastian Bergmann and contributors.

....                                          4 / 4 (100%)

Time: 56 ms, Memory: 4.00MB

OK (4 tests, 8 assertions)

That’s it. Happy Friday.

What happens if we don’t do it? – 4 ways to speed teams up

Screen-shot-2012-07-18-at-12.02.16-PM

I became Certified Scrum Master (CSM) on 2010. I took a CSM course at beautiful Oporto. My instructor was Mitch Lacey (https://www.mitchlacey.com/). Amazing instructor. If you can attend any of his courses, go ahead. On 2012, he published an amazing book about Scrum, I totally recommend, “The Scrum Field Guide: Practical Advice for Your First Year” (http://www.amazon.com/Scrum-Field-Guide-Addison-Wesley-Signature/dp/0133853624). So practical, so full of examples to understand how to properly apply Scrum and get most of it.

During the CSM training session, when talking about INVEST (https://en.wikipedia.org/wiki/INVEST_(mnemonic)) in your product backlog, value of User Stories and priorities he said, “the first question to ask yourself about a user story, task or process is what happens if we just don’t do it?”. Everyone laughed. Not doing something useless you were supposed to do, it’s a high productive activity.

The more I meet teams, project managers, developers, sysops, etc., the stronger my feeling is that we always try to improve things adding stuff not removing waste. More process, more abstraction, more code, more tools. My recommendation is that the best way to speed teams up is to remove useless or low value things. Let’s see some suggestions.

Continue reading

Hi @xing_bcn and @xing_de!

xing-logo

After leaving Atrápalo, it’s time to jump to a new challenge. As I explained, I need to get out of my confort zone and check other things that will make me learn new things. Some of you already know, but for the rest, the chosen company is Xing. So, I’m more than happy to announce that I’m the next B2B Head of Engineering at @xing. I’d like to share some thoughts about the reasons that took me here.

Continue reading

Adiós Atrápalo

10256834_309920905799307_2027411388540523420_n

Después de más de 2 años trabajando en Atrápalo, ha llegado el momento de partir a nuevos horizontes. Los que ya me conocéis un poco sabéis cómo soy: llegar, simplificar y marchar. Mis objetivos se han cumplido y es hora de ayudar a otros equipos. Después de estos dos años, Atrápalo es una compañía respetada técnicamente por la comunidad de Barcelona. En 2015, consiguió se le premiara por esa evolución.

Cada integrante del equipo técnico ha hecho un trabajo increíble adoptando las nuevas dinámicas y prácticas de trabajo, tanto en desarrollo, UX y Sistemas. Casi siempre, un equipo grande es una desventaja, normalmente es lento, pero me ha sorprendido cómo un equipo de casi 100 personas, aplicando Scrum, eXtreme Programming y otras buenas prácticas ha conseguido reducir deuda técnica muy rápidamente. Lo que me lleva a la frase que repito entre amiguetes: “There is no legacy code, just legacy teams”.

Continue reading

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!

Continue reading

First tests with #PHP7 in production at @AtrapaloEng

php7

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/). 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.
Continue reading

RESTGames – More than katas

1453093897_Brain-Games-grey

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?

Continue reading