Customizing the User Experience of your product with Open Source Tech

Otávio Machado
6 min readNov 12, 2018

--

I am going to start very concisely:

Image from the TV show Futurama: Professor Farnsworth saying "Good News, Everyone"

You don't have to be Google, Facebook or even have big data to serve personalized content. You also don't have to spend millions on doing so.

Got curious? Awesome. Follow me as we dive into a wonderful world of data.

The buzzword you are looking for is CDP

Customer Data Platform. CDP for short. It can be a little bit redundant, but it's basically a platform that captures customer data.
Ok, I will dive in a little bit further:

The idea is that you can understand who your user is. With anonymous — but identifiable — data. Protecting their privacy. And there are lots of ways of doing that.

The most used one is capturing user events from your system. Every time a user uses something in your product, you can save it in a database. The things you want to save are business specific: Facebook probably wants to know who are the people you interact the most. Youtube wants to know the kind of videos you watch the most. Ebay wants to know the kinds of products you buy the most.

If you sell clothes, for example, you can start tracking how many dresses everyone searches and/or buys, following this logic, right?

After you have this data, it's probably easy to assume that if someone has searched for dresses more than 100 times and bought more than 5, this is someone who:

  1. Likes dresses! (You don't say?)
  2. Is a woman; (With some degrees of certainty. After all, we are not our clothes and clothes do not have gender. But statistically, that is still true to some level)
  3. Is a heavy user of your product; (Well, it depends on your traffic and your understanding of heavy)

It's fair to assume that you will make that person's job easier if you showed them dresses in the front page or in a hypothetic "recommended" section of your e-commerce.

It is also fair that you will probably increase your revenue by doing that, because now it's easier for your customers to find what they want.

This means that, with some degrees of certainty, you can also show things that are statistically more used by women or by heavy users.

If you have a more specialized product, it's fair to assume that after someone has used your product for more than a year, you can start showing your clients more advanced stuff right in the front page, instead of just showing the basics.

Searching for dresses more than 100 times is called a rule. Being a heavy user, a dress-liking person or a woman are called segments in this world. These are the classifications you have for your users, and they can literally be anything created by the most simple to the most complex rules.

"Segment all the things" meme created using imgflip.com

Whatever is your product, being able to personalize it for your user is always a good thing. But it has always been also an expensive thing, since usually these Data Platforms are expensive black boxes.

Here comes Apache Unomi

From this specific need of segmenting users based on their specific behavior, Apache Unomi (source code) was created. It is still an incubated project, which means it's still finding its way until being one hundred percent consolidated.

But Unomi was already thought to be customizable. It has the whole CDP workflow implemented by default, but it was implemented as an OSGi platform, which basically means it's modular, so you can change any of the lego puzzles you feel like, if it's going to make it fit more perfectly to your already built ecosystem.

Image showing Standard Unomi Architecture (available in their home page)

In a high-level overview, it works like the following:

– Every time a user starts using your product, your product will have a specific unique identification of your user (in a web page, for example, it would be a session id automatically generated) and it will send it to Unomi searching for any possible segments a user could have and return them to the product, so you can do whatever you want with it.

– You can define different kinds of user events that will be sent to Unomi via an embedded code in your product.

– You can define different rules and actions that will interact with those User Events and define segments — using simple conditions, or even intelligent models.

As I said, being modular means you can change whatever you want about it. They implement a Persistence module with ElasticSearch, but you can change that for any other database you want. They provide you, apart from the user events api, another API where you can update profile information instead of sending user events, define new rules and segments in runtime.

List of Unomi modules

For example, if you want to start receiving user events asynchronously with the help of some Message Queue platform (like Kafka, RabbitMQ) instead of using an API, that could be done with basically no code change inside Unomi.

Also, Unomi runs with Apache Karaf, an OSGi container that lets you deploy new features, like rules, segments and actions with zero downtime. (aka hot deployment)

You can make infinite combinations with those lego pieces, and I can't talk about all of them in one article, but if you are having trouble with yours, leave me a comment so we can discuss it in more detail.

It is not a silver bullet

Unomi is not perfect, though.

They are still in incubating-mode within apache, which means it is a relatively new tool.

There is not a big community around it, even though it is a business problem that I think a lot of companies can benefit from.

They can't deal, as of today, with a big traffic of users. User events are handled sequentially in the code, and their User Events API can deal with around one thousand requests in parallel without starting to error out.

It's a Java project and it uses a lot of other apache tools. Even though they use Java 8, I feel that the apache tools bring a lot of xml configurations that could be changed by more current tools. (Warning, this may be a rant from a youngster that is used to more recent tooling.)

There is a good documentation if you are looking for a business perspective. If you want to get a good understanding on how to create rules, segments, actions and conditions, you won't get that.

It took me a couple of days of despair trying to find them in the documentation, until I accepted I had to debug the actual Unomi implementation and understand what they were doing inside the code. From that point on, using the code to understand the way things work turned into a common thing — which is good, but not optimal and has a lot of space to improve.

Parting Thoughts

All in all, Unomi is a good open source tool that solves a problem usually solved by proprietary tools. Yes, it has lots of places to improve, but if you are thinking about creating your own CDP from the scratch or you are already full of dealing with the third-party black-boxes that are in the market, it seems reasonable to join efforts with the Unomi group and make it better for everyone.

If it is still not clear to you how you can personalize your product using apache Unomi, Serge did a 50 minutes presentation at ApacheCon about Unomi, with a simple personalization demo included!

I am also writing a more technical view on Unomi, with hands-on examples to quickstart your journey using it. The are all listed in this article.

--

--

Otávio Machado

Works in tech for 10+ years, learning to be the best engineer and the best leader I can be as I go. When in doubt, choose to be kind.