Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8039867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:42:58+00:00 2026-06-05T03:42:58+00:00

I use batsd ( which use statsd ) library with jeremy/statsd-ruby client for my

  • 0

I use batsd ( which use statsd) library with jeremy/statsd-ruby client for my ruby web application (rails). And I have to keep simple visits statistic. Great! I use statsd.increment('users.visits') method from the above gem.

Then I noticed, this operation once create new sorted set(zset) and add one element(it looks like "1338932870<X>1) every time.
Why statsd use this approach? Would not be easer and faster use HINCRBY method with simlpe hash(not zadd to zset)?

I know, statsd is good and well-known instrument, but I wonder, is it the counters standart pattern in redis? I’m new to redis and nosql at all, thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:43:00+00:00Added an answer on June 5, 2026 at 3:43 am

    I’m not familiar with the package, but if you just use HINCRBY, you will just calculate the last value of the metric and keep it in Redis. I guess a statistical package may need to store the evolution of the metric (in order to plot graph over time or something similar).

    Using a zset is a way to store the events ordered by timestamp (i.e. a time serie), and therefore to keep an history of the evolution of this metric. It is slower and consume much more memory than just keeping the last value, but you have the history. See Noah’s comment below for the full story.

    Using HINCRBY or INCRBY to aggregate counters in real time, and using zset to store time series are two common Redis patterns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use scenario is pretty simple: I have a desktop only application that could be
use ruby 1.9.2 rails 3.1.3 rake 0.8.7 and when rake cucumber start i have
Use case: we have some project meta-data files which we want tracked, but are
Use case is to have a server connect to thousands of users email accounts
use LWP::Simple; use Parallel::ForkManager; @links=( [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-windows.exe,SweetHome3D-2.1-windows.exe], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3D-2.1-macosx.dmg,SweetHome3D-2.1-macosx.dmg], [http://prdownloads.sourceforge.net/sweethome3d/SweetHome3DViewer-2.1.zip,SweetHome3DViewer-2.1.zip], ); # Max 30 processes for
Use case: Fitnesse is used for automated testing of the web site. SUT (software
Use the static modifier to declare a static member, which belongs to the type
Use Elixir and have two entities -- Voter and Candidate -- with many to
use javascript or other method ? have any recommendation?
Use case example: Client A comes to request sales information, enters their zip code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.