May 11, 2023

Building privacy-first native app telemetry with Guilherme Oenning

Guilherme Oenning left his job to create Aptabase, a platform for mobile and desktop app developers to build telemetry and analytics using simple SDKs. We sat down with Guilherme to talk about building Aptabase and why he chose Tinybird over Postgres, BigQuery, and ClickHouse Cloud.
Tinybird
Team

Tinybird: Guilherme, welcome to the most recent installment of Developer Q&As with Tinybird! Why donā€™t you introduce yourself.

Guilherme: Hi, Iā€™m Guilherme Oenning (or @goenning on Twitter/GitHub). Iā€™m originally from Brazil, but now Iā€™ve set up shop in Ireland!

My career as a software engineer has spanned over 15 years and a few different companies, and in February of this year I made one of the biggest decisions of my life: I quit my job and started building my own stuff. In March, I launched Aptabase.

ā€

Tinybird: What is Aptabase?

Guilherme: Aptabase is a telemetry and analytics service for developers to monitor the performance of their desktop, mobile, and web apps.

The Aptabase homepage

Tinybird: Whatā€™s your goal with Aptabase, and how is it different from anything else out there?

Guilherme: The first product I ever built was a desktop app called Aptakube. I built it for a pretty niche group within the developer community, and for the first 9 months that it was live, I had absolutely zero telemetry on it.

I didnā€™t have even the most basic insights into how people were using the app. I couldnā€™t answer simple questions like ā€œWhatā€™s the most used OS?ā€ or ā€œWhere are my users?ā€ or ā€œWhatā€™s the most popular feature?ā€

I wanted to add some telemetry for it, but I also wanted something open source and privacy-focused; it needed to be 100% anonymized.

Well, the market is flooded with privacy-first telemetry/analytics tools for websites, but thereā€™s basically nothing like that for mobile and desktop apps.

So, I did what most developers would do when they canā€™t find the right tool for their needs: I built my own!

The mission for Aptabase is to help developers build better native apps without privacy-invading tracking.

Aptabase helps native app developers build better apps by giving them simple SDKs to track usage events and run analytics on user behavior while respecting user privacy.

ā€

Tinybird: And - spoiler alert - you used Tinybird to help you build it. But before we get there, tell us more about the problem you faced that ultimately led you to Tinybird.

Guilherme: So from the first day I was thinking about scalability. Analytics products can easily grow to billions of records. Of course, thatā€™s a problem that I would absolutely love to have (who wouldnā€™t?), but I donā€™t want to get blindsided when Aptabase starts growing.

I needed an analytics platform or database that could handle potentially massive volumes of data while processing queries in real time.

That said, I wanted to be able to start small. I didnā€™t want to have to stand up a database or data warehouse and all the infrastructure associated with it. I really just wanted to focus on building my core product.

I needed a database that could handle billions of rows, but I wanted to be able to start small without standing up infrastructure.

ā€

Tinybird: How did you find Tinybird?

Guilherme: My first thought was Postgres, because everybody starts with Postgres. But I knew that it couldnā€™t be an option for this kind of thing. Itā€™s just not built for analytics.

I tried out BigQuery, but it wasnā€™t quite real-time, and like most data warehouses it limits query concurrency so itā€™s not great for building apps on top of.

I discovered ClickHouse, and I knew it would be a good technical fit, but I didnā€™t want to host it. Hosting a database is a massive responsibility. You have to handle all the maintenance operations, backup, DR, patches, etc. I didnā€™t want to deal with that. I wanted to focus on building. So I just googled ā€œserverless ClickHouseā€ and Tinybird popped up.

Hosting a database is a massive responsibility. I didn't want to deal with that. I wanted to focus on building.

ā€

Tinybird: What about Tinybird caught your attention?

Guilherme: It ticked all the technical boxes. Essentially it was a serverless ClickHouse, which is what I needed. But compared to something like ClickHouse Cloud, it also offered all of these great features on top of the database that would help me prototype and deploy much faster.

Compared to ClickHouse Cloud, Tinybird offered all these great features on top of the database that helped me prototype and deploy much faster.

ā€

Tinybird: What does the current architecture for Aptabase look like?

Guilherme: First of all, the project is open source, so you can check out the code here.

Essentially, mobile app developers can use the Aptabase SDKs (available for Swift, Kotlin, Flutter, Nativescript, Tauri, JavaScript, .NET MAUI with several more on the way) to instrument their app with some tracking code.

Aptabase currently offers online tracking SDKs for 7 languages, with many more in the works.

These SDKs make it really easy for developers to track events with a small amount of code, for exampleā€¦

All those events get sent to a Tinybird Data Source called events using a combination of the Events API and an AWS SNS connection, which was super easy to set up.

The Data Source has the following schema:

The app uses the Tinybird Query API to construct queries from the frontend to populate the analytics dashboard, which is built with TypeScript. I also use Postgres for auth, and Iā€™ll expand that later for things like team management and custom dashboard config.

Aptabase provides SDKs for mobile and desktop app developers to capture events data, which gets sent to Tinybird for analytics.

I opted for a monolithic architecture where both the backend and frontend run in a single container. This means it can be hosted pretty much anywhere. Since itā€™s an open source project, I wanted people to be able to easily self host it, so that was an important decision I made upfront. I opted for AWS AppRunner because it provides a great combination of containerization and serverless.

The SaaS version of Aptabase is deployed to both EU and US, and they run completely isolated from each other.

ā€

Tinybird: You mentioned that you evaluated Postgres, BigQuery, and ClickHouse Cloud. Why did you end up choosing Tinybird?

Guilherme: Ultimately it came down to technical ability, cost, and support. I could have started with hosted Postgres on AWS, but I knew that Iā€™d eventually have to migrate at scale and I didnā€™t want to deal with that.

BigQuery was out due to the concurrency issues I mentioned earlier.

ClickHouse Cloud was actually the first thing I tried, but it wasnā€™t cost-effective for my use case. I spent almost $0.10 to run just 7 insert queries!

I knew Postgres wouldn't scale, BigQuery couldn't handle concurrency, and ClickHouse Cloud was too expensive. Tinybird gave me what I needed with a pricing model that made sense for my project.

So I ended up choosing Tinybird becauseā€¦

  1. It gave me the database I needed for analytics
  2. The free tier was generous so it was very easy to get started and validate
  3. The usage-based pricing model made sense for my project

I should also add that the support from Tinybird has been amazing. I recently tweeted about how great the Tinybird Slack community has been. I love when dev-focused companies set up these open communities. I set up a Discord server for Aptakube, which has been a big success, and I plan to launch one for Aptabase shortly.

Being able to get all your users in one place talking about needs and goals is very good not only for the users but for the builders as well. Plus it just creates a really supportive community that you know you can go to when you get stuck.

ā€

Tinybird: What has impressed you most about Tinybird?

Guilherme: Definitely the support and community, to start with. But as a platform, Tinybird has also been incredible. Itā€™s way more than just a hosted ClickHouse. You get these amazing features like Pipes, Data Flow diagrams, one-click APIs, etc.

The support is amazing, but also as a platform,Ā Tinybird is incredible.

I can essentially use it as a hosted ClickHouse in its most basic form, but I get all these incredible abstractions on top that make it so much easier to work with.

At the end of the day, Tinybird gives me a worry-free, super fast, and scalable data store for my analytics. I can focus on building the product and know that Tinybird is taking away all of the complexities of setting up and maintaining a complex database.

I was able to build the entire MVP for Aptabase in 2 weeks. Without Tinybird, thereā€™s absolutely no way I would have done that. Itā€™s the most critical component of this product, and itā€™s the one Iā€™m least worried about.

ā€

Tinybird: Whatā€™s next for Aptabase? Can you give us a peek at the roadmap?

Guilherme: Simplicity is core to Aptabase, so Iā€™m doing my best to avoid feature bloat. My next big priority is to allow developers to customize their dashboards.

I also have 5 more SDKs in the works (React Native, Electron, Capacitor.js, Unity, and Unreal Engine), and I want to add more features to the 7 SDKs we already have.

Fortunately, Iā€™ve been getting great support from the community. The Android (Kotlin) and NativeScript SDKs were both external contributions by Dylan Llewellyn and Nathan Walker, so big thanks to them.

ā€

Tinybird: How does Tinybird factor into your plans?

Guilherme: I want to start using Pipes. Iā€™ve just been using the Query API so far, but I want to use Pipes so that I can leverage Materialized Views to boost query speeds.

Iā€™m still amazed at what you can do with Materialized Views in Tinybird and how they constantly update as new data is ingested. My prior understanding of Materialized Views was from using Postgres, where you have to trigger an update every time. Having ingest-triggered updates is amazing.

ā€

Tinybird: Who would you say benefits most from Tinybird, and what advice would you give them?

Guilherme: Tinybird is for anyone who needs to store a lot of data and still be able to run really fast queries. But itā€™s also for people like me who just want to build product and need a good abstraction of an OLAP datastore.

As far as advice, I would say that the first thing you should do is start pushing data into Tinybird. Even if you donā€™t understand the concepts of Pipes, Materialized Views, Endpoints, etc., just start sending data to Tinybird. You can start with the Query API (like I did) to get data out of it, and in that sense, it works just like a hosted database.

Then as you start to better understand the access patterns for your Data Source, you can turn your attention to building Pipes and Materialized Views. If you already have a good feel for how the data will be accessed, it will make building those real-time pipelines much easier and faster.

ā€

Tinybird: What would you tell somebody who is on the fence about using Tinybird?

Guilherme: First of all, stop using Postgres for OLAP! Itā€™s not built for that šŸ˜‰. Second, just try Tinybird. It costs nothing to start and it really only takes a few minutes to figure out the basics.

ā€

Do you like this post?

Related posts

Building an enterprise-grade real-time analytics platform
Simplifying event sourcing with scheduled data snapshots in Tinybird
Chatting GraphQL with Jamie Barton of Grafbase
Tinybird
Team
Apr 24, 2023
Why iterating real-time data pipelines is so hard
More Data, More Apps: Improving data ingestion in Tinybird
Tinybird expands self-service real-time analytics to AWS
Tinybird connects with Confluent for real-time streaming analytics at scale
Tinybird
Team
Jul 18, 2023
We have released a stable version of the Tinybird CLI
Real-time Databases: What developers need to know
Automating customer usage alerts with Tinybird and Make

Build fast data products, faster.

Try Tinybird and bring your data sources together and enable engineers to build with data in minutes. No credit card required, free to get started.
Need more? Contact sales for Enterprise support.