Usually we organize our javascript apps either by what they are or by what they do. The first is like rails: separate directories like componentscontainersreducers, etc. And the second more or less like feature/DDD: usercart, and so on. Tho both of these options are very mainstream and solid they contain some constraints.

When you structure the code files tree by what they are you tend to keep every component of the same feature so distant that it’s very difficult to connect the pieces. Therefore you dive into some troubles like the path hell; a lot of require('../../../etc') in your code. And everything is extremely coupled to the directory structure.

In the other hand, when you are driven by what they do everything is more isolated and maintainable. But there’s a lot of duplication. And the communication between the features either is based on a weak contract or depends upon some infrastructure. Both of these options are prone to raise some bugs.

Pods it’s an evolution of the last one. You can think about pods like the microservices of the front applications. A pod is an isolated and completely independent microapp which can communicate 100% with other pods. Therefore, you get code base which is composable, extendable, reusableand extremely easy to test. Tho, the main benefit is that you completely erase the inter components side effects. Once a pod is failing you are totally sure that it’s because itself has something wrong; not an external piece.

A pod is an isolated and completely independent microapp which can communicate 100% with other pods

The unique requirement of the pods is to driven all the pods intercommunication through an event bus. If you’re already using any Flux pattern, lib or framework it’s gonna be very easy to lead this communication to the dispatcher; which is actually a single point for the events.

For a pod is not mandatory to have the logic, presentational and communication layers. Can have all of just one of them. Imagine a router pod. It has the logic and communication layer but doesn’t expose any view. Or the opposite, a form pod which only exposes a presentational layer and depends 100% on the arguments received (see React props).

Because every pod acts like and independent application we place the tests inside them. This means two things: stop duplicating the files tree, and making code coverage meaningful. When you have 100% coverage with a pod you know that it won’t fail. No side effects.

In a nutshell, by working with pods you get a secure and very flexible structure. Very easy to test and without side effects. It scales from 0 to millions without worrying about big refactors due to the fact that every pod is isolated but available to communicate with all the other pods.

In case you want to see some code here’s a Github repository with a simple pod architecture. Give it a look and check the benefits the pods can offer. If you have some doubts or proposals don’t hesitate to open an issue or comment here. This is a living pattern. We’re using the pods at Ulabox and they’re proving to be the solution to a lot of structural codebase problems. Tho, we’re willing to listen about your thoughts and concerns.

The journey is long, take some pods.

Previous ArticleNext Article

Leave a Reply

Your email address will not be published. Required fields are marked *


VCs come into action — Breakdown of Spanish investment activity of January 2018

January closes with €195.3 million investments in Spanish startups within 24 operations

  • The Spanish entrepreneurial ecosystem is maturing thanks to investment rounds of more than €10 millions.
  • Barcelona and Madrid continue leading the Spanish ecosystem.

This is the first in a series of posts in which we will do an analysis of the Spanish startup investment landscape. We will look at the overall funding numbers and trends in the country month by month and compare it with data of the previous year.

What are the Spanish investment activities like on a month to month basis? What deals and volumes are we talking about? At what stages are startups prone to search investment and which regions in Spain attract the most funding?

The year 2017 brought us plenty in terms of innovation and investment activity within the area of technological startups, although Spain has been driven by political problems. The developments we have seen in 2018 so far are picking up at just the same fast pace.

January has closed with €195.3 million investments in Spanish startups within 24 operations. Of these funding rounds, highlights are the round of Cabify, Hawkers and Redpoints :

  • Cabify: The ride-hailing app that competes against Uber, has raised €143.3 million ($160) Series E funding round from a mix of previous and new investors, including Rakuten Capital, TheVentureCity, Endeavor Catalyst, GAT Investments, Liil Ventures and WTI, as well as prominent local investors from Spain and Latin America.

When analyzing the structure of financing deals, the increase in venture capital activity in Jan-18 is noticeable in comparison with Jan-17.

#Deals and volume in the Spanish startup investment landscape in January

In terms of the number of deals closed, we have seen a slight downward trend in the country. With a broad participation of Venture Capital, there have been less deals but more capital invested in each transaction. The reason for such a boost is mostly the gigantic financing round of Cabify with participation of giants’ VCs like Rakuten Capital, TheVentureCity and others.

The entry of European, American and Japanese funds investing in Spanish startups are accounting for a large percentage of the growth of the investments in Spain. At the same time, this global investment rise is making the average value of the financial rounds soar up to more than 1.5 times that of the previous year (without taking account of Cabify’s investment, that would turn this factor to more than 6 times the previous year)

The differences between January-2017 and January 2018 in terms of the increase in venture capital activity is shown below:

Startup investment deals by size of round

As we expected to see, the number of operations closed by investment size tends to a larger number in larger deals. While the number of deals of €500k or less have decreased considerably, the number of larger deals have gone up notably. This might be understood as an increasing number of companies maturing and reaching later stages of funding.

To properly ensure the aforementioned, in the following figure we show the breakdown of the investment activity by year of foundation of the company:

Startup investment activity (Jan-18) by year of foundation

Our previous statement is reinforced by this figure. The large transactions take place on established companies. In general, the more years a startup survives, the more established it is. As we observed, in average, the startups that were previously founded are those who raised more funding. That makes sense because normally an older startup has a bigger team and unless it has reached breakeven, it will need more funds to survive.

Startup investment deals by Region

Regarding the breakdown of startup investments by region, Barcelona, Madrid and Valencia bolster their position in the top of Spanish regions:

  • Cataluña (mostly in Barcelona) stands with 9 deals closed and an investment of €19 millions
  • Madrid gathers 7 deals and an investment of €148 million (€143 million in Cabify)
  • Valencia up to 3 deals and €23 million (€20 million in Hawkers)

Operations January 2018: