🚀Live Coding Session: Simple Real-Time Analytics with KafkaRegister Now
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?
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.