Build Incremental Architecture Through Microservices with Modern Languages — Casavo’s Case Study

PropTech company Casavo has committed to the highest technology standards to build incremental microservices architectures.

Codemotion
13 min readNov 12, 2020

Table Of Contents

Casavo began as a real-estate instant buyer and has already leveraged the traction gained through this service to become a technological leader in the real estate sphere, building a tech-offer for all actors involved in a real estate transaction. The company’s ambition is to become a technological reference point in the real estate world, offering many vertical solutions beyond the Instant Buyer function (especially around the microservices world).

“Moving house is one of life’s most overwhelming events, often causing months of stress and uncertainty”, Casavo’s CTO Francesco Dominidiato explains. “We started Casavo in late 2017 with a mission to simplify home buying and selling. Since then, we have executed nearly 1,000 transactions for homeowners who have bought and sold homes with Casavo”.

An Instant Buyer is an operator who uses large amounts of data and technological tools to drastically reduce the time required to sell a property. Instant Buyer directly submits purchase offers for a property, revolutionizing the traditional buy/sell process by introducing a simpler, faster and often more convenient paradigm.

“Casavo offers the freedom to move whenever you want, on your own terms. If you’re selling, it can help you to sell your property at a competitive price in just thirty days, eliminating the hassle of showings and the months of uncertainty.

If you’re buying, Casavo makes it incredibly easy to find and purchase the perfect home. Wherever you are in your home-ownership journey, a dedicated Casavo expert will guide you every step of the way”.

Casavo has a clear vision to simplify the real estate buying process. Let’s see how this is achieved with respect to the company’s values and stakeholders, customers included.

Reasons for change: towards microservices

Casavo’s platform was essentially born in PHP, with an architecture fully based on this programming language. This proved to be a good solution, and it’s no secret that many companies develop their business in PHP.

However, Casavo also wanted to “refresh” its core architecture. Moving towards a microservices architecture was a natural choice for these new advances, and the team decided to opt for different modern programming languages, among which is the focus of this article — Elixir.

At the end of 2019, the company started redesigning its technological stack, with one major constraint — changes must be incremental. The information system can never be restarted from scratch in this business. We’ll return to this particular aspect of the development process later.

The differences between PHP and Elixir can’t be detailed in just a few words, but some points can be outlined in brief; in PHP, every request generates a void process to be managed through a simple request/response model. Elixir, on the other hand, is based on its own runtime — this software component and some services stay active forever. This approach pushes performances to the top and offers a memory of past executions.

Elixir and DDD, the double divine strength

There is a need for a more modern and agile approach to software development, in order to speed up progress towards a given goal.

Why Elixir?

Elixir offers an honest and manageable technological ramp. Its adoption is not a free process, but it can be managed step by step, a little at a time.

For those who are not familiar with this language, it all started with Erlang, a language developed by Ericsson’s engineers back in the mid-80s to manage highly concurrent telecommunication systems with extremely high reliability.

Erlang achieved concurrency without hassle. Elixir was born from Erlang in 2012, adding a more familiar development environment to Erlang, among many other things.

If used for writing sequential code in a single process, the language itself is simple and the generated code is easily readable. This makes it perfect for those who are taking their first steps in learning how to use it.

Multiple processes can be coordinated with Elixir, but this is a more complex task, to be mastered further down the track.

Elixir is flexible: a project, even an elaborate one, is rarely difficult to achieve easily. Honestly, it takes time to fully master Elixir, but each step to the top is nonetheless productive.”

Francesco Dominidiato, CTO at Casavo

Stress and success of microservices

“Elixir has been accepted by Casavo’s developers with great enthusiasm and productivity, said Dominidiato. “In just a few months, four services have been deployed, with a fifth service at the end of the pipeline as we speak” (July 2020).

All the services developed in this time, once deployed, worked immediately. To our utmost amazement, moreover, they did not require further adaptations in the subsequent months.”

This success was underlined by the particular stress conditions to which the system was subjected. One event in particular suddenly increased website visits and therefore requests for new microservices: an advertising campaign on a satellite television channel.

As soon as these services were deployed, the company purchased advertising space on the Sky TV chain. That promotion dramatically increased the number of contacts with the site, putting stress on both old and new services, which were fully capable of scaling up without any problems.

“But is it still up?” was the frequent, astonished question of all the developers involved in the creation of each service.

Casavo’s custom microservices: EventStore, Pond, Carol, Worms

Let’s now look at the main characteristics of each of the developed services. Each microservice, in particular:

  • has its own responsibilities;
  • has its own internal databases which are not published externally;
  • exposes an API;
  • uses events to communicate important facts to the outside world.

All events, collected in the EventStore, are available via API to each user interface (reading clients), which can be written in any language.

As previously stated, Casavo deals with real estate. Each property must be associated with many pieces of information, each one of a very different type as required by the kind of services offered by the agency. Let’s imagine what has to be done when selling an apartment:

The system not only has to cope with the description of the apartment, but — to offer a simple example — also the property’s availability for viewing, in order to keep the visiting schedule up to date for possible buyers. The amount of information needed is very large and each service wants to see and edit only the small slice that it is directly concerned with.

As a result, previously each service that had to enter valuable information did so independently and without any coordination. The number of examples is very large. Marketers want to see a return on their advertising investment and be helped to make related choices.

Pond Microservice

Casavo has created a unique repository, a really comprehensive land registry, which has the capacity to gather together the information from each individual sector of activity. Internally they call this microservice, and their other main services Pond.

Casavo’s listing engine, a part of the existing architecture, is itself now a Pond customer.

However, no single system can manage all these views at the same time. Time offers a fundamental point of view, but is difficult to manage on a classic database. Casavo is developing an event architecture that relies on transactional workflow. In particular, Dominidiato underlines: “Our event store will be centralized, agnostically decoupled with respect to the service that will issue the event and with a ledger — an historical archive whose elements can be sent by topic”.

Carol Microservice

Data publication is entrusted to Carol, a new microservice written in Elixir.

At first glance, Pond and Store may seem to implement no more than a traditional access provision for a database. However, the logic behind them is much better, and the APIs they exhibit are very different from — and far more functional — than in any traditional approach.

Worms Microservice

Worms stands for ‘WORkflow Management System’, and it represents Casavo’s core ambition for the next year.

The scope of this microservice will be huge, describing the overall transactional flow from lead acquisition to property resale. It will also facilitate direct and seamless communication between all stakeholders involved, both internal and external. In terms of architectural patterns, Worms follows the CQRS/ES paradigm, as it perfectly fits the specificities of the product and really adapts to the characteristics of transactional workflow.

Casavo and Elixir, a perfect marriage

The choice of the Elixir language was one of the reasons behind the success of the new technology stack adopted by Casavo.

The adoption of the Elixir technology has offered great advantages. In particular, it reduced the number of bugs by a factor of more than ten. “Where we normally find about one hundred mistakes, here we only found two or three that were easily identifiable and then easy to amend”, explains Dominidiato.

Furthermore, Casavo has become an even more sought-after workplace for software developers.

Such a positive result brings with it a deeper search for the causes of the situation than is often found in similar scenarios.

To summarize the three main reasons for their success in a few words, Lana suggests that:

  • Elixir is cool;
  • we were good at introducing it;
  • our PHP programmers were good at figuring it out.

The result may therefore be repeatable in other contexts, but only with attention paid to the boundary conditions.

Casavo’s Technology Radar

The company has taken their commitment to technology seriously, analysing all technologies relevant to their business and making the best decision after a thorough evaluation. The switch to Elixir also followed this path.

Much work has been done to formalize knowledge analysis. The result is Casavo’s Technology Radar, a target-like synthesis of technologies’ positions with a 4-way categorisation.

Tools and languages, frameworks, platforms, and techniques are placed clockwise on the quadrant. Distance from the axes is determined by relevance (hold, access, trial, and adoption): the closer to the target, the more relevant the technology is to the company.

The Casavo Technology Radar is a remarkable synthesis of the company’s determination to take the necessary steps to become a major player and once there, to hold that position for a long, long time.

Moreover, this approach to technology evaluation is part of an even bigger plan, including such facets as company ethics and values. Let’s dive into this:

casavo tech radar

Doing business with company values and life principles

People’s quality of life is the most important thing to pursue. Software will be increasingly present in everybody’s future. People’s quality of life will increasingly be affected by the quality of the software they interact with.

Its’ safe to say that good software contributes to improving people’s quality of life just as bad software contributes to making it worse.

“Think of purchases, reservations, call centers, but also electromedical technologies and even car brakes”, says Francesco Dominidiato, “all of these services are assigned to software, whose quality has an effect on the quality of our lives”. The range of examples spans from simple things such as a home-banking system to more risky situations, and as far as our security, both logical and physical.

“For us, the quality of life of individuals is the first priority. We put all possible effort into improving the software we write every day”. An obligation to avoid developing bad software exists; that’s why the caliber of the whole technical staff is a big consideration for Casavo.

Casavo searches for excellence in tech people, pays attention to their interactions and health, and gives them the best possible environment to express their potential. Training is one of the keys to continuous improvement.

The company’s management is also dedicated to building a strong, agile company in order to give all employees psychological safety and a fearless approach to organisation.

Values

Dominidiato believes that corporate values and good principles are the real guides to getting the best results — not only in business but also in your life.

Doing technology wrong has consequences that we know well; to write good software you need good programmers and good, well-coordinated processes. Bad developers, although they may be highly coordinated, will not write good software; poorly coordinated programming luminaries will never complete good software projects.

Casavo tech strategy microservices

Casavo’s tech team values are clearly laid out in one important slide. A focused vision becomes a well-defined mission statement that sets down eleven specific values.

Vision

Technology is the key to simplifying all processes — making it very accessible to everyone makes life easier. Casavo aims to turn the transactional process into a commodity.

To make their vision real, they have embarked on a mission: maximize prediction accuracy and minimize human assistance with an eye to minimizing user-experience friction.

The values on the tech team list are sometimes familiar and sometimes cleverly re-imagined. It’s clear from Casavo’s work that lead time is the main key to implementing their mission. They also experiment, but only if the result is compatible with the Clean Code approach.

The most important word may be hidden in the final line: “Together”. It’s not a question of being typed with an uppercase T or not: all stakeholders are thoroughly evaluated in this time-organising project, where lead time is key; all developers are asked to be learners, according to the data-driven approach, and there is a strong user focus.

Constant training: a developer’s career grows with technical knowledge

“The next career step of a good programmer is to become an excellent programmer,” explains Casavo’s CTO, “and this extends to data scientists, DevOps, and any kind of technical expertise as well”.

Software development is creative knowledge working: the more you know, the more you are worth. “Casavo invests heavily in internal training and promotes internal careers”, Dominidiato continues — a viewpoint that to some extent goes against the current in the managerial world.

“It is important for us that a good developer evolves vertically in his sector, certain also to acquire greater relevance in the company and a higher salary”. The evolution of the developer and all other tech people does not necessarily involve a managerial career, as often happens in the market.

Casavo does however offer tech people the possibility of switching into a managerial career, but this is considered a distinct career ladder, rather than the natural evolution of a technical career.

career ladder microservices

“The truth is different: the quality of the software depends heavily on the quality of the developers”, Dominidiato says. No quantity of junior programmers can compensate for the loss of a senior’s skill, or GAFA (Google, Amazon, Facebook and Apple), as well as many other big organisations, would already have tried this.

“The GAFA hiring process requires numerous steps over a total duration of several weeks or months, just to better evaluate the candidate’s skills. If there was a possibility, even a small one, to replace the quality of individuals with superior management of processes and projects, therefore using only poor programmers, they would do it!”

A better programmer increases the quality of the software written by his working group. But even in the software world, there are several levels of quality.

Nonetheless, despite being many corporations’ most precious resource, the talents of developers are all too often squandered. Collectively, companies lose upward of $300 billion a year paying down “technical debt” as developers pour time into maintaining legacy systems or dealing with the ramifications of bad software.

Some tasks need more quality than others. It is not always necessary to solve a new problem, which requires the highest quality, or to better solve a problem that already has a solution. In many cases, a pre-existing software configurator and limited customization capability are sufficient.

A typical example is the core business of an average web agency, scaling perfectly well with mid-level programmers capable of managing the entire life cycle of one or more CMS (content management systems).

The bottom line here is that a good developer is not required to become a manager if they want a better career — at least, not at Casavo.

Quality management and fast delivery

Casavo’s goal is to deliver quality quickly. The classic “quick and dirty” paradigm is a false idol that can be broken. Relationships between individuals are key here.

The interest of each individual is well-being; emotional intelligence is the tool that allows you to achieve it. Eliminating toxic relationships greatly accelerates the speed of delivery of quality software, thus obtaining “quick and clean” results, combining the best of two worlds.

Quality is not always correctly assessed within companies. As William Gaybrick, former CFO and now CPO of Stripe, a very successful payment platform, has said, “Tech’s ultimate success: Software developers are now more valuable to companies than money”.

“At Casavo, we are very much in agreement with this statement and therefore we want to keep good developers in the company, indeed improve them and attract new talents”, Dominidiato points out.

“That’s why in order to have career growth, the ability our developers need is not the knack for managing more people, but the talent to develop quality software.” The company has repeatedly demonstrated their commitment to this ideal. Casavo was ranked fourth in the 2019 Italian list of the ‘Best places to work’. A year later, they ranked first in LinkedIn’s 2020 Top Startups Italia.

The bottom line is that quick and clean is possible. It’s up to you to choose this way — and be game enough to reach this goal!

Casavo’s Career Ladder

“To evaluate the quality of our programmers, we have developed a suitable methodology”, Dominidiato explains. “We appreciate lean and agile approaches, and the concepts of XP — Extreme Programming.

We also follow the advice of Clean Code according to the well-known vision of ‘Uncle Bob’, a.k.a. Robert C. Martin.

We developed a competency matrix, also known as a career ladder, based on a 10x7 matrix. Seven dimensions, ranging from tech specific skills to business & community impact, span over 10 tiers.”

This methodology is open to each of our tech people. If someone believes they are more capable, they can fill in the forms and provide evidence (projects, events) to a commission, which evaluates the submission, and if their self-evaluation is accurate, provides for the adjustment of duties and wages.

When we hire people, we always evaluate the value they can add, without considering the salary (low or high) that they had in their previous / current job.”

Another interesting aspect is the flexibility given to employees in terms of space and timing of work. Certainly today this is of topical relevance, given the consequences of the Coronavirus: in the company, they are all remote until the end of 2020. Nonetheless, gathering opinions and preferences from all levels, with the purpose of maximising the positive takeaways from the lockdown in terms of productivity and work-life balance, while at the same time recognising the need to maintain collaborative physical connection with the rest of the company, Casavo has already set up a policy for the “new normal” that will allow everybody to exercise the right of up to 18 days of smart working per month.

You can read the orginal version of this article at Codemotion.com, where you will find more related contents. https://www.codemotion.com/magazine/dev-hub/backend-dev/casavo-incremental-microservices/

--

--

Codemotion

We help tech communities to grow worldwide, providing top-notch tools and unparalleled networking opportunities.