Blog / Data

Analytics by design: how iti revolutionized the way it works, with help from data

The four pillars that guided how iti’s data platform was built, from the first data pipeline on Lambda to fraud models on every transaction.

· 10 min read · with Marcelo Sousa

In early 2019, we were given the mission of building a data platform for a new Itaú product that was still being conceived: iti, Itaú’s digital bank. It was created to transform people’s relationship with money, to make easy what is difficult and bureaucratic today, and to make the expensive affordable. Its main pillars and ambitions include simplicity and the democratization of financial services for the part of the population that lives on the margins of today’s financial system, whether by choice or not. At iti, we work to go far beyond what big banks and fintechs offer today: we want to serve, and understand in depth, customers who have no credit history, because we know the value these people bring to the economy and the difficulties they face. In this context, using data at scale plays an essential role in helping iti reach its goal of being a democratic financial platform.

As data engineers, passionate about technology and excited by this challenge, we started out by designing the best possible solution with every resource available: real-time processing, an MLOps pipeline, a sandbox for data scientists, scalable data pipelines, and so on. But we soon paused and asked ourselves: do we really need all of this from the start? The answer, confirmed now that we are more than a year and a half into the journey, was: no. We do not need all of that. We have managed to create a lot of value with very little, by following these pillars:

  1. 01Business-driven incremental deliveryevery release driven by a goal
  2. 02Analytics by design, built on a data‑driven culturedata is born with the feature
  3. 03Analytics is codethe same rigor as a backend
  4. 04Governance, privacy, and quality as valuesnon-negotiable, above any target

Business-driven incremental delivery

It’s no secret that every technology initiative should have a well-defined business goal and should evolve through incremental releases. What isn’t always clear to companies, or simply gets overlooked, is that the same logic must be applied, just as rigorously, to foundational initiatives such as building a data platform.

Every step in building and evolving the platform has to be guided by a business goal, and its releases should drive that goal’s results. In other words, you need to keep a close eye on the famous OKRs (objectives and key results): the data platform team should have objectives aligned with the business strategy and key results that make it possible to measure and track the progress of each release and the value it creates. Without a clear measure of the value created for the business, you run the risk of building technology for technology’s sake rather than something that actually pays off. Don’t make the mistake of setting goals for technical improvements that have nothing to do with the product strategy.

From goal to release: the OKR cascade on the data platform A three-level flow from left to right. The first level holds the business goals: grow active customers and extend credit to those without access to it. Both converge on the second level, the data team’s OKRs, with objectives aligned with strategy and key results that measure the value created. The second level leads to the third, the platform releases: incremental releases, every six months, with no Big Design Up Front. Below, a dashed line runs back from the releases to the data team’s OKRs as measured value. BUSINESS GOALS Grow active customers Extend credit to those without it DATA TEAM OKRS Objectives aligned with strategy Key results that measure value PLATFORM RELEASES Incremental releases, every six months no Big Design Up Front measured value
Every platform release starts from a business goal and comes back as measured value.

People who love technology often want to build elegant solutions that are as close as possible to the state of the art. That is great, and it should serve as a benchmark for ensuring quality releases, but the team cannot lose sight of what really matters (and OKRs help a lot here)—creating value for our customers. OKRs also help us avoid Big Design Up Front (BDUF): with six-month and annual goals, the platform build should focus on that horizon, rather than spending too much energy designing for a distant future.

Analytics by design, built on a data-driven culture

For any data initiative to succeed, you first need to create an environment where everyone understands the importance of data and recognizes the value of using it. So everyone should know the data journey, from conception to use.

The first step in building that environment must come from senior leadership: executive sponsorship and advocacy for this culture are essential for every area of the company to adopt it. And that sponsorship and advocacy must mean total commitment from senior leadership, expressed in actions, not just words.

With that in place, you have fertile ground for creating a data strategy and adopting the concept of analytics by design, in which the product features themselves are born integrated with the data platform, sending relevant information in a format that makes it usable for analytics. All of this is only possible with a mature data‑driven culture, in which product teams see value in using data and care about it, too.

Before × by design: how data reaches analysis A comparison in two horizontal lanes between the usual way and analytics by design. In the first lane, the usual way goes through five steps: the feature ships to production, someone needs the data, a request goes to the data team, extraction and ETL, and the data becomes available for analysis, with a long lead time of weeks. In the second, shorter lane, analytics by design goes through four steps: the feature is designed with its events, the event schema is declared as an acceptance criterion, the integration is ready before going live, and the data is available the day the feature is born, with a very short lead time. THE USUAL WAY Feature ships to production Someone needs the data Request to the data team Extraction and ETL Data available for analysis long lead time: weeks ANALYTICS BY DESIGN Feature is designed with its events Event schema declared (acceptance criterion) Integration ready before going live Data available the day the feature is born very short lead time
By design, data is born with the feature instead of being requested afterward.

Analytics is code

Data engineering and data science should be held to the same rigor as, say, the backend development of a transactional system. In other words: analytics is code like any other, and it must be treated as such. This means that building an ETL pipeline or creating a model cannot be treated as work that is handcrafted, one-off, slow, and impossible to replicate. On the contrary, pipelines and models need to be agile, replicable, and easy to develop.

For example, a mature data platform needs a DevOps and MLOps pipeline with all the gates you would expect of one, infrastructure as code, and a portfolio of development accelerators, such as building blocks and scaffolds. The goal is to reach the point where it is easy, fast, and safe to build on and for the platform.

The code pipeline for data and models An ETL pipeline and an ML model both enter the same linear software delivery pipeline: they go through versioned code with GitFlow and GitLab, CI/CD tests and gates in GitLab CI, and infrastructure as code with Terraform, and they reach production on AWS. Python accelerators, with building blocks and scaffolds, span the first three stages and shorten the path. Nothing handcrafted, one-off, or impossible to replicate. WHAT GETS BUILT ETL pipeline ML model GITFLOW Versioned code GITLAB CI Tests and gates TERRAFORM Infra as code AWS Production Accelerators: Python building blocks and scaffolds
Analytics is code: pipelines and models go through the same delivery pipeline as any other software, with nothing handcrafted, one-off, or impossible to replicate.

Governance, privacy, and quality as values

Everything presented so far is enough for this endeavor to succeed, as long as we treat the platform’s data in a way that ensures its governance, privacy, and quality. We believe these points are so important that they should be treated as values, to the point that no business goal, for example, can override the safe and governed use of the platform and its data. As for quality, the maxim “garbage in, garbage out” speaks for itself: if you don’t know your data or can’t guarantee a minimum level of service, chances are high that it will create more problems than value.

That is why it is so important to have tools and processes that ensure these three values, right from the platform’s conception. And, of course, if the whole team does not recognize them as values, no tool or process will make this endeavor a success.

Using a data catalog, defining the products’ data schemas right at ingestion, and segregating data access at a granular level, along with traceability logs and data lineage, are some examples of features that help ensure adherence to these principles.

Sounds good, but what about in practice?

Now you might be asking yourself: how did we manage to apply all these pillars in practice, given all the difficulties and complexities of large technology initiatives?

When we started developing the data platform at iti, with these pillars already in mind, we made the following technical decisions: (1) go 100% serverless, using only what our cloud provider (AWS) had to offer; (2) do all development, without exception, with GitFlow, CI/CD, and infrastructure as code—in this case, GitLab, GitLab CI, and Terraform.

These technical decisions, and all the others we made afterward, were always guided by the goals defined for and by the data team. We built and validated those goals together with iti’s business team. For example, some of our goals were to increase the number of active customers and to expand our ability to offer credit to the part of the population that currently has no access to this kind of service. That way, the whole engineering team keeps coming back to one question: how can the data platform help achieve these goals?

Staying focused on incremental delivery and keeping an eye on our goals, we chose to run our first data pipeline on Lambda, with storage in S3, and to build all the surrounding tooling: Terraform modules, a GitLab CI pipeline, and Python building blocks. As a result, in less than a month, we had a first working version of the platform, with timely data pipelines and our users running queries in Athena.

The evolution of iti’s data platform, step by step A staircase with four steps. Step 1, early 2019, in under a month: the first data pipeline with Lambda and S3, queries in Athena, Terraform, GitLab CI, and Python building blocks. Step 2, under a month later: the first models in production, packaged as Lambda functions, for customer activation and churn and for the onboarding experience. Step 3, a mature platform: a layered data lake and data marts, online and batch pipelines with data quality, online and batch machine learning, MLOps and a sandbox, and fraud models on every transaction. Step 4, the next one, in progress: expanding to open‑source tools, beyond AWS. EARLY 2019 IN UNDER A MONTH First data pipeline Lambda + S3 queries in Athena Terraform, GitLab CI Python building blocks UNDER A MONTH LATER First models in production light models on Lambda activation and churn onboarding experience MATURE PLATFORM Data across the product data lake + data marts online/batch pipelines with data quality ML, MLOps, sandbox fraud models on all transactions NEXT STEP Beyond AWS open‑source tools
The platform grew one step at a time, always driven by a business goal. We did not need all of that from the start.

As for culture, today it is safe to say that iti, both as a product and as a team, lives and breathes data: launching new features already integrated with the platform, running data analyses to shape strategy, and putting advanced analytics models to use. This level of maturity was reached, first of all, through the sponsorship and engagement of our business and technology leaders, who made sure from the very beginning that the data discipline was treated as a priority and an integral part of the product, not as “a service provider.”

With that backing, the data team was able to positively influence the entire iti team, for example by making integration with the data platform an acceptance criterion for every new feature: today, every feature sends us events designed for use on the platform. This allows a very short lead time between extraction and use, since the data was designed from the start for this use and integrated before the feature even went into production.

Two important strategies we have followed since the platform’s early days have kept us consistently aligned with our values of governance, privacy, and quality: defining event schemas and governance by exception. As another acceptance criterion, every event sent to the data platform must have its schema declared, not only with its layout and data types, but also with business descriptions of the fields and a flag for PII (personally identifiable information). This schema is used at three different stages: to register the event in our data catalog, to reconcile received vs. expected events, and, finally, to anonymize PII fields. The catalog ensures governance and one facet of quality by making our data easy to find and understand; reconciliation ensures the technical quality of the events; and anonymization ensures privacy, and governance too. Anonymization makes it possible to create a layer with all of the data, minus anything that identifies our customers, which allows safer and more controlled use of that data. We made this layer the starting point for exploration. And it is worth remembering that all data capture and every grant of access to the platform comply with Brazil’s General Data Protection Law (LGPD)—with its principle of minimization, the deletion and purging of data, and the requirement to justify any use with a stated reason and purpose.

One schema, three uses The event schema—with layout, data types, business descriptions of the fields, and a PII flag, required as an acceptance criterion for every event—is reused at three stages: the entry in the data catalog, which ensures governance and one facet of quality; the reconciliation of received vs. expected events, which ensures technical quality; and the anonymization of PII fields, which ensures privacy and governance and feeds the de-identified customer data layer, the starting point for exploration. Everything operates under the principles of the LGPD, Brazil’s data protection law: minimization, deletion, and purpose. EVENT SCHEMA · layout · data types · field descriptions · PII flag acceptance criterion for every event Entry in the data catalog governance + one facet of quality Reconciliation:received × expected technical quality Anonymization of PII fields privacy + governance STARTING POINT FOR EXPLORATION De-identified customer data layer ALL UNDER LGPD: MINIMIZATION, DELETION, PURPOSE
A single contract per event ensures governance, quality, and privacy all at once.

Success stories

By now, you have seen how we put all of this into practice. Next, we will share a few examples that show how successful this strategy has been at iti, enabling the data team to deliver enormous value to our customers.

  • in the first monthModels in productionfrom customer activation and churn prediction to the onboarding experience
  • on every transactionFraud preventionevery transaction scored by models, with minimal impact on customers
  • in critical flowsFailures anticipatedan SRE engine that predicts failures in onboarding and transactions

Very early in our story, when our CI/CD pipeline only supported deploying Lambda functions, we created a process that packaged our lightest models so they could run inside them. This opened up a whole range of possibilities, and less than a month in, we had models in production, ranging from predicting customer activation and churn to models that customized our onboarding experience.

Today, with our platform mature, we support a number of critical areas at iti. One example is our financial transaction flow, in which every transaction is scored by our models to identify potential fraud. And the best part: with minimal impact on our customers. In addition, our SRE (site reliability engineering) team relies on an engine that, also using models, anticipates possible failures in our main flows, such as onboarding and transactions. That cuts our failures, and their impact, dramatically.

Conclusion

Today, the data platform offers a wide range of capabilities, such as a layered data lake, data marts, online and batch data pipelines with data quality checks, online and batch machine learning models, an MLOps pipeline, a sandbox for data scientists, and more. We are also constantly reviewing and realigning our goals and technical decisions. One example of this practice is that we no longer restrict our development to AWS services, and we are expanding into open‑source tools.

In short, by following this approach of incremental releases driven by business-aligned goals, with a strong data culture that underpins analytics by design, and by valuing governance, quality, and privacy, we have been able to create a great deal of value for iti. As a consequence, and not as an end in itself, we have built a cutting-edge data platform with advanced capabilities that we are very proud of today. It has been a challenging but deeply rewarding journey, one that involved the entire iti team. A journey of constant learning that is far from over. With all this in mind, we would like to leave you with one last thought: at iti, we are passionate about technology, technology that makes sense and creates value for our customers, technology that relies on a data‑driven culture to deliver services that just keep getting better!

Originally published in Portuguese on ititech (Medium), Dec 7, 2020.