frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Trifle – Open-source analytics that stores answers, not events

https://trifle.io/
14•iluzone•1d ago
Trifle is an open-source time-series analytics library that aggregates nested counters instead of storing raw events. All in the database you already have. After rebuilding it twice over 10 years, it now tracks ~1B events a day at my day job.

It started in 2015 as my own Rails APM. I plugged into ActiveSupport::Notifications, got a few small users, and one bigger one whose scraping app broke everything. That sparked the core idea: aggregate counters into pre-defined time buckets, so a single write increments multiple buckets at once. The APM eventually faded away without much traction.

Later in 2021 I needed analytics at my day job. Instead of going for something out there I revised the idea of Trifle as a more generic analytics library, borrowing some data warehouse ideas. First used Redis, then Postgres, eventually MongoDB. Hence why Trifle::Stats comes with multiple drivers that keep the DSL unified while storage layer changes with your needs. In our case (huge write volume, some reads) PG read faster but slowed on large writes.

The nested values are the whole trick here. Single:

  Trifle::Stats.track(
    key: 'requests::aws::s3_uploads',
    values: {
      count: 1,
      status: { request.response_code => 1 },
      size: payload.bytes,
      duration: { sum: request.duration, count: 1 }
    }
  )
  
builds up counts for requests, success rate, result status codes, duration for multiple time buckets at once. Single bucket from 2am then looks like:

  { count: 14, status: { 200: 12, 500: 2 }, size: 5628341, duration: { sum: 43, count: 14 } }
If request.duration is in seconds, then sum stored under duration would be in seconds as well.

Success rate is never stored, but it is calculated by dividing 200s over total number of requests. Same with average duration: sum over count. You ask for a metrics key, granularity and timeframe and you get back aggregated values at each point. Ready for charts or to answer "Average response time over last 30 days".

There's a Series wrapper for aggregating and formatting values for charts in a simple call. And as building dashboards is not as much fun for other devs as I thought, I built Trifle App - a visual layer with dashboards, scheduled digests and alerts. It's written in Elixir, so I ported the library to Elixir too. And later to Go for a CLI. All three are compatible, write in one and read in another.

Today we track activity from over 100M background jobs a day which turns into about 1B events. It runs surprisingly cheap when you're willing to trade some safety away (turn off journaling and write concerns in Mongo). 3-node Hetzner MongoDB cluster where the primary does 20% utilization costs us around $1k/month.

It has its limitations. Payloads can't hold tens of thousands of keys. Documents becomes too large to update efficiently. Some planning ahead is needed. And then there are no dimensions. Sometimes you can nest them (country - there are only so many countries), sometimes it's better to have dedicated metrics key per dimension (customer - growing forever). That multiplies tracked events, hence 1B events from 100M jobs.

The libraries are MIT. The App is source-available under ELv2 - free to self-host and paid cloud if you want it managed. I build this on the side with no investor money to burn on a free service.

Happy to answer anything about architecture, storage models, my failures or why I didn't give up on this yet.

Writing by hand is good for your brain

https://nealstephenson.substack.com/p/writing-by-hand-is-good-for-your
675•dwwoelfel•5h ago•338 comments

Show HN: Echo – Fable-level results at 1/3 the cost using open-weight models

47•adam_rida•43m ago•12 comments

What happened to TheNumbers.com

https://stephenfollows.com/p/what-just-happened-to-thenumberscom-should-worry-us-all
180•nickthegreek•3h ago•66 comments

Building on ATProto

https://lukekanies.com/writing/building-on-atproto/
63•speckx•1h ago•23 comments

A solid-state “atomic channel” for separating rare earth elements

https://pme.uchicago.edu/news-events/news/cleaner-route-purifying-rare-earth-elements
32•MarcoDewey•1h ago•3 comments

Startup founders urge U.S. government not to shut off Chinese open weight AI

https://www.politico.com/news/2026/07/22/startup-founders-urge-trump-not-to-shut-off-chinese-open...
521•theanonymousone•4h ago•497 comments

Software rendering in 500 lines of bare C++

https://haqr.eu/tinyrenderer/
186•mpweiher•5h ago•31 comments

Learn OpenGL, extensive tutorial resource for learning Modern OpenGL

https://learnopengl.com/
125•ibobev•5h ago•72 comments

Astronomers may have found the first exomoon

https://www.eso.org/public/news/eso2610/
161•MarcoDewey•6h ago•56 comments

Launch HN: Screenpipe (YC S26) – Record how you work and turn that into agents

32•louis030195•3h ago•36 comments

Show HN: Palmier Pro – Open-source macOS video editor built for AI

https://github.com/palmier-io/palmier-pro
59•harrisontin•4h ago•15 comments

DARPA, U.S. Air Force fly AI-controlled F-16

https://www.darpa.mil/news/2026/darpa-us-air-force-fly-ai-controlled-f-16
100•r2sk5t•6h ago•89 comments

The arguments against open source AI are bad

https://tombedor.dev/arguments-against-open-source-ai-are-very-bad/
102•jjfoooo4•3h ago•69 comments

Converting Files into Minecraft Worlds

https://wuemeli.com/blog/sulfur-part-1/
19•wuemeli•2d ago•2 comments

JEP 540: Simple JSON API (Now in Incubator)

https://openjdk.org/jeps/540
70•theanonymousone•4h ago•48 comments

Show HN: Trifle – Open-source analytics that stores answers, not events

https://trifle.io/
14•iluzone•1d ago•0 comments

Learn WebGPU for C++

https://eliemichel.github.io/LearnWebGPU/
50•ibobev•5h ago•9 comments

Show HN: OneCLI – OSS credential gateway that keeps secrets out of AI agents

https://github.com/onecli/onecli
52•Jonathanfishner•4h ago•23 comments

Hybrid-Electric Aicraft Engine Targeting 30% Fuel Efficiency

https://www.rtx.com/news/news-center/2026/07/21/rtxs-pratt-whitney-canada-advances-hybrid-electri...
72•r2sk5t•6h ago•52 comments

Geekbench 7

https://www.geekbench.com/blog/2026/07/geekbench-7/
18•ilreb•1h ago•15 comments

AI Companies Are Trying to Hide a Staggering Amount of Debt

https://futurism.com/artificial-intelligence/ai-companies-hide-debt-off-balance-sheet
464•technewssss•7h ago•224 comments

Show HN: Remux – an open-source tmux workspace designed for iPhone

https://github.com/h3nock/remux
67•bitwise42•5h ago•28 comments

Why Software Factories Fail (or: harness engineering is not enough)

https://github.com/humanlayer/advanced-context-engineering-for-coding-agents/blob/main/wsff.md
106•dhorthy•4h ago•84 comments

Fields Medals 2026

https://www.mathunion.org/imu-awards/fields-medal/fields-medals-2026
72•nill0•5h ago•22 comments

Show HN: Claude-thermos – keeps your Claude session warm for you

https://github.com/izeigerman/claude-thermos
29•s0ck_r4w•3h ago•23 comments

From Evaluation to Guardrails: What We Brought to ACM FAccT 2026

https://blog.mozilla.ai/from-evaluation-to-guardrails-what-we-brought-to-acm-facct-2026/
6•royapakzad•1h ago•0 comments

Free way to get your data out of ChatGPT Business accounts

https://github.com/Conradqh/scrapemychats
62•conradqh•4h ago•6 comments

OpenStreetMap: Admin_level for All Countries

https://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#Table_:_Admin_level_for_all_cou...
80•ivanjermakov•4d ago•16 comments

Emacs Is a Lispboard

https://en.andros.dev/blog/06bfd107/emacs-is-a-lispboard/
59•andros•6h ago•17 comments

Meta Garbage Collection: Using OCaml's GC to GC Rust

https://soteria-tools.com/blog/meta-garbage-collection
16•annieversary•3d ago•0 comments