Show HN: Trench – Open-source analytics infrastructure (❄️ Score: 150+ in 4 days)
Link: https://readhacker.news/s/6gRu4
Comments: https://readhacker.news/c/6gRu4
Hey HN! I want to share a new open source project I've been working on called Trench (https://trench.dev). It's open source analytics infrastructure for tracking events, page views, and identifying users, and it's built on top of ClickHouse and Kafka.
https://github.com/frigadehq/trench
I built Trench because the Postgres table we used for tracking events at our startup (http://frigade.com/) was getting expensive and becoming a performance bottleneck as we scaled to millions of end users.
Many companies run into the same problem as us (e.g. Stripe, Heroku: https://brandur.org/fragments/events). They often start by adding a basic events table to their relational database, which works at first, but can become an issue as the application scales. It’s usually the biggest table in the database, the slowest one to query, and the longest one to back up.
With Trench, we’ve put together a single Docker image that gives you a production-ready tracking event table built for scale and speed. When we migrated our tracking table from Postgres to Trench, we saw a 42% reduction in cost to serve on our primary Postgres cluster and all lag spikes from autoscaling under high traffic were eliminated.
Here are some of the core features:
* Fully compliant with the Segment tracking spec e.g. track(), identify(), group(), etc.
* Can handle thousands of events per second on a single node
* Query tracking data in real-time with read-after-write guarantees
* Send data anywhere with throttled and batched webhooks
* Single production-ready docker image. No need to manage and roll your own Kafka/ClickHouse/Nodejs/etc.
* Easily plugs into any cloud hosted ClickHouse and Kafka solutions e.g. ClickHouse Cloud, Confluent
Trench can be used for a range of use cases. Here are some possibilities:
1. Real-Time Monitoring and Alerting: Set up real-time alerts and monitoring for your services by tracking custom events like errors, usage spikes, or specific user actions and sending that data anywhere with Trench’s webhooks
2. Event Replay and Debugging: Capture all user interactions in real-time for event replay
3. A/B Testing Platform: Capture events from different users and groups in real time. Segment users by querying in real time and serve the right experiences to the right users
4. Product Analytics for SaaS Applications: Embed Trench into your existing SaaS product to power user audit logs or tracking scripts on your end-users’ websites
5. Build a custom RAG model: Easily query event data and give users answers in real-time. LLMs are really good at writing SQL
The project is open-source and MIT-licensed. If there’s interest, we’re thinking about adding support for Elastic Search, direct data integrations (e.g. Redshift, S3, etc.), and an admin interface for creating queries, webhooks, etc.
Have you experienced the same issues with your events tables? I'd love to hear what HN thinks about the project.
RIP botsin.space (Score: 150+ in 9 hours)
Link: https://readhacker.news/s/6h7wH
Comments: https://readhacker.news/c/6h7wH
What happens when people with acute psychosis meet the voices in their heads? (Score: 150+ in 19 hours)
Link: https://readhacker.news/s/6h4Nu
Comments: https://readhacker.news/c/6h4Nu
Improving Xwayland window resizing (Score: 150+ in 1 day)
Link: https://readhacker.news/s/6h38P
Comments: https://readhacker.news/c/6h38P
Vector databases are the wrong abstraction (Score: 150+ in 8 hours)
Link: https://readhacker.news/s/6h69i
Comments: https://readhacker.news/c/6h69i
The unnecessary decline of U.S. numerical weather prediction (Score: 151+ in 1 day)
Link: https://readhacker.news/s/6gYVA
Comments: https://readhacker.news/c/6gYVA
Standardizing Automotive Connectivity (Score: 150+ in 1 day)
Link: https://readhacker.news/s/6h2Ru
Comments: https://readhacker.news/c/6h2Ru
GitHub Cuts AI Deals with Google, Anthropic (🔥 Score: 162+ in 1 hour)
Link: https://readhacker.news/s/6h6nv
Comments: https://readhacker.news/c/6h6nv
New Mac Mini with M4 (🔥 Score: 154+ in 49 minutes)
Link: https://readhacker.news/s/6h5Vz
Comments: https://readhacker.news/c/6h5Vz
What's New in POSIX 2024 (Score: 151+ in 12 hours)
Link: https://readhacker.news/s/6h3UF
Comments: https://readhacker.news/c/6h3UF
Debian's "secret" sauce (❄️ Score: 150+ in 4 days)
Link: https://readhacker.news/s/6gQeT
Comments: https://readhacker.news/c/6gQeT
Using reinforcement learning and $4.80 of GPU time to find the best HN post (Score: 151+ in 11 hours)
Link: https://readhacker.news/s/6h2sr
Comments: https://readhacker.news/c/6h2sr
Why so few Matt Levines? (Score: 150+ in 6 hours)
Link: https://readhacker.news/s/6h3dj
Comments: https://readhacker.news/c/6h3dj
How JPEG XL compares to other image codecs (❄️ Score: 150+ in 5 days)
Link: https://readhacker.news/s/6gHnr
Comments: https://readhacker.news/c/6gHnr
The sins of the 90s: Questioning a puzzling claim about mass surveillance (Score: 154+ in 5 hours)
Link: https://readhacker.news/s/6gZZ6
Comments: https://readhacker.news/c/6gZZ6
Australia/Lord_Howe is the weirdest timezone (🔥 Score: 162+ in 1 hour)
Link: https://readhacker.news/s/6h8qL
Comments: https://readhacker.news/c/6h8qL
PhD student finds lost city in Mexico jungle (Score: 150+ in 9 hours)
Link: https://readhacker.news/s/6h76M
Comments: https://readhacker.news/c/6h76M
Wasmer 5.0 (🔥 Score: 151+ in 3 hours)
Link: https://readhacker.news/s/6h7Mg
Comments: https://readhacker.news/c/6h7Mg
The electrostatic world of insects (Score: 150+ in 23 hours)
Link: https://readhacker.news/s/6h3ZG
Comments: https://readhacker.news/c/6h3ZG
OpenAI builds first chip with Broadcom and TSMC, scales back foundry ambition (Score: 151+ in 6 hours)
Link: https://readhacker.news/s/6h6Gy
Comments: https://readhacker.news/c/6h6Gy
Using an 8K TV as a Monitor (Score: 150+ in 4 hours)
Link: https://readhacker.news/s/6h6qS
Comments: https://readhacker.news/c/6h6qS
Writing in Pictures: Richard Scarry and the art of children's literature (Score: 150+ in 4 hours)
Link: https://readhacker.news/s/6h5Dy
Comments: https://readhacker.news/c/6h5Dy
How to get the whole planet to send abuse complaints to your best friends (Score: 154+ in 5 hours)
Link: https://readhacker.news/s/6h5m4
Comments: https://readhacker.news/c/6h5m4
Sci-fi books that you may never have heard of, but definitely should read (Score: 152+ in 1 day)
Link: https://readhacker.news/s/6gZ6q
Comments: https://readhacker.news/c/6gZ6q
How I write code using Cursor (Score: 155+ in 5 hours)
Link: https://readhacker.news/s/6h4eD
Comments: https://readhacker.news/c/6h4eD
HTML Form Validation is underused (Score: 150+ in 8 hours)
Link: https://readhacker.news/s/6h3nT
Comments: https://readhacker.news/c/6h3nT
Steve Ballmer was an underrated CEO (Score: 150+ in 7 hours)
Link: https://readhacker.news/s/6h3sU
Comments: https://readhacker.news/c/6h3sU
A return to hand-written notes by learning to read and write (🔥 Score: 157+ in 3 hours)
Link: https://readhacker.news/s/6h3iZ
Comments: https://readhacker.news/c/6h3iZ
Mill: A fast JVM build tool for Java and Scala (Score: 150+ in 18 hours)
Link: https://readhacker.news/s/6gYzQ
Comments: https://readhacker.news/c/6gYzQ
How Gothic architecture became spooky (Score: 150+ in 9 hours)
Link: https://readhacker.news/s/6gZdT
Comments: https://readhacker.news/c/6gZdT