Replacing Kafka with… SQLite?

Glauber CostaGlauber Costa
Cover image for Replacing Kafka with… SQLite?

Kafka is a well-known building block for building real-time and streaming applications. But it is not without its drawbacks.

The first is that while databases are something that most, if not all, backend developers are comfortable with and have very well understood semantics, Kafka is a more specialized tool. More importantly, Kafka by itself is little more than a backbone of communications. Once you need to manipulate the data, you need to start worrying about adding connectors. Complexity rises, and it makes you wonder: why not just use a database?

BÆRSkin Tactical Supply Co. did just that: they replaced their Kafka setup with SQLite, powered by the Turso Cloud, seeing their rate of lost events drop to zero, and gaining agility for their engineering team.

#The problem

Founded in 2019, BAERSkin Tactical Supply Co. crafts outdoor gear that's built for those who brave the wild. From their 10-pocket BÆRSkin Fleece hoodies to their BÆR-Kit modular system, they make gear for guys who need their equipment to be as reliable as they are. No fashion statements. No disposable junk. Just bombproof gear that guarantees wild comfort.

Kafka was used to ingest events about user interactions on their website. According to CTO Gus Fune, 6% of events were lost, causing lost revenue and decreased customer satisfaction. While it was clear that proper usage and tuning of Kafka would be able to resolve the problem, Gus questioned why they wouldn’t go for a simpler solution instead.

“Our team understands databases. We already have databases in many other parts of the stack. The extra system, which is far from a zero-shot solution, added a large amount of complexity with dubious gains”

The reason teams reach out for Kafka to begin with is to guarantee scalability. So there was a concern about whether a relational database could do the job. Kafka achieves architectural scalability by naturally partitioning the data in multiple partitions and topics.

#SQLite as the solution

For this reason, BÆRSkin Tactical Supply Co. chose an architecture where each Kafka partition was represented by a separate SQLite database. This architecture maintains the best features of Kafka, while allowing infinite scalability, as new partitions can be added on demand.

Each SQLite database can be queried naturally in a relational manner, doing away with the need for connectors. In principle, this setup could be replicated with any relational database. But the choice of SQLite allowed BÆRSkin Tactical Supply Co. to pursue this architecture while keeping costs in check: the setup is cheaper than their previous Kafka setup, saving them more than 60% in direct infrastructure costs, plus extra savings in eliminating and operating the intermediate storage layer.

“For a team as focused as ours, having fewer components allows us to focus on our core activities. Simply using a SQLite database per partition allowed us to not worry about lost events anymore, while decreasing our costs by 60%. All of that by using a component that everybody already understands” – Gus Fune, CTO.

#Conclusion

BÆRSkin Tactical Supply Co.'s journey from Kafka to SQLite demonstrates the versatility of SQLite-based solutions. With the cost of creating a database and leaving it around set at zero, it is posible to pursue novel architectures that combine the familiarity of well-known database systems with the power of more specialized tools.

By replacing a complex streaming infrastructure with SQLite databases powered by Turso Cloud, they achieved reliable event ingestion, 60% cost savings on infrastructure, and reduced operational complexity, all while using technology their team already understood.

This case study challenges the assumption that streaming platforms are always necessary for event processing. For teams comfortable with relational databases and facing moderate scale requirements, a well-designed SQLite architecture can deliver superior results with less complexity. Ready to simplify your own infrastructure? Start your journey with Turso Cloud today and discover how SQLite can power your next-generation applications.