Information BD

  • Home
  • Business
    • Internet
    • Market
    • Stock
  • Parent Category
    • Child Category 1
      • Sub Child Category 1
      • Sub Child Category 2
      • Sub Child Category 3
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Featured
  • Health
    • Childcare
    • Doctors
  • Home
  • News
    • Hacker News
    • Google on TechRepublic
    • Articles on TechRepublic
    • Software on TechRepublic
    • Tech And Work on TechRepublic
  • Uncategorized

Thursday, July 23, 2026

New top story on Hacker News: Show HN: Trifle – Open-source analytics that stores answers, not events

 July 23, 2026     Hacker News     No comments   

Show HN: Trifle – Open-source analytics that stores answers, not events
7 by iluzone | 0 comments on Hacker News.
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.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Older Post Home

0 comments:

Post a Comment

Ad

Popular Posts

  • Listen to the Globe
    By BY CAITLIN KELLY from NYT At Home https://ift.tt/3jJNKk3
  • DealBook Briefing: Apple’s Struggles Add to Uncertainty in Markets
    By Unknown Author from NYT Business https://nyti.ms/2CL89mG
  • Listen to the Call: Bullock and Trump Discuss Testing
    By BY THE NEW YORK TIMES from NYT U.S. https://ift.tt/2JDppgp

Recent Posts

Categories

  • AllLanguages
  • Articles on TechRepublic
  • bangla
  • Cracking Open Blog | TechRepublic
  • desktop
  • English
  • FOX NEWS
  • Google on TechRepublic
  • Hacker News
  • HowTo
  • IOS
  • Mobile
  • MobileReviews
  • News
  • NYT
  • PcTricks
  • Reviews
  • Software on TechRepublic
  • softwareupdates
  • Tech And Work on TechRepublic
  • Tech Industry on TechRepublic
  • TechNews
  • TechRepublic
  • Tools
  • Trick
  • Updates
  • Website

Unordered List

Pages

  • Home

Text Widget

Blog Archive

  • July 2026 (38)
  • June 2026 (56)
  • May 2026 (47)
  • April 2026 (46)
  • March 2026 (50)
  • February 2026 (46)
  • January 2026 (48)
  • December 2025 (43)
  • November 2025 (38)
  • October 2025 (46)
  • September 2025 (51)
  • August 2025 (44)
  • July 2025 (38)
  • June 2025 (37)
  • May 2025 (47)
  • April 2025 (44)
  • March 2025 (47)
  • February 2025 (35)
  • January 2025 (41)
  • December 2024 (57)
  • November 2024 (64)
  • October 2024 (63)
  • September 2024 (57)
  • August 2024 (50)
  • July 2024 (66)
  • June 2024 (66)
  • May 2024 (71)
  • April 2024 (46)
  • March 2024 (68)
  • February 2024 (45)
  • January 2024 (63)
  • December 2023 (66)
  • November 2023 (60)
  • October 2023 (64)
  • September 2023 (103)
  • August 2023 (95)
  • July 2023 (89)
  • June 2023 (78)
  • May 2023 (172)
  • April 2023 (162)
  • March 2023 (176)
  • February 2023 (155)
  • January 2023 (185)
  • December 2022 (166)
  • November 2022 (158)
  • October 2022 (202)
  • September 2022 (198)
  • August 2022 (195)
  • July 2022 (198)
  • June 2022 (191)
  • May 2022 (183)
  • April 2022 (193)
  • March 2022 (176)
  • February 2022 (174)
  • January 2022 (247)
  • December 2021 (351)
  • November 2021 (626)
  • October 2021 (654)
  • September 2021 (608)
  • August 2021 (713)
  • July 2021 (713)
  • June 2021 (690)
  • May 2021 (712)
  • April 2021 (687)
  • March 2021 (713)
  • February 2021 (644)
  • January 2021 (713)
  • December 2020 (713)
  • November 2020 (690)
  • October 2020 (628)
  • September 2020 (689)
  • August 2020 (713)
  • July 2020 (713)
  • June 2020 (690)
  • May 2020 (713)
  • April 2020 (690)
  • March 2020 (713)
  • February 2020 (667)
  • January 2020 (713)
  • December 2019 (713)
  • November 2019 (690)
  • October 2019 (711)
  • September 2019 (688)
  • August 2019 (713)
  • July 2019 (713)
  • June 2019 (690)
  • May 2019 (3001)
  • April 2019 (2950)
  • March 2019 (3047)
  • February 2019 (2759)
  • January 2019 (3059)
  • December 2018 (3060)
  • November 2018 (2959)
  • October 2018 (3058)
  • September 2018 (2962)
  • August 2018 (2221)
  • July 2018 (3)

Search This Blog

Powered by Blogger.

Report Abuse

About Me

Inform BD Tech
View my complete profile

Sample Text

Copyright © Information BD | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates