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 190293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:14:39+00:00 2026-05-11T16:14:39+00:00

The company I work for creates applications for the Blackberry platform. We’ve been working

  • 0

The company I work for creates applications for the Blackberry platform.

We’ve been working on a proprietary “analytics system” that allows us to embed code within our applications and have the applications report back some stats to our central servers every time they’re run. Currently, the system works ok; however it’s only in beta with 100-200 hits per hour. The “hits” are sent to the servers without a problem. We’ve built a very solid API to handle the acceptance and storage of the hits (in a MySQL DB). We’ve tested the load and we should be able to accommodate hundreds of thousands of hits per hour without a problem. That’s not really a problem.

The problem is showing the stats. We’ve built a display panel similar to Mint’s (haveamint.com), it shows the hits over each hour, the past days, months, weeks, years…etc. The fist version ran straight queries pulling data from the hits table and interpreting it on the fly. That didn’t work for very long. Our current solution is that the hits are “queued” for processing and we have a cron come through every 5 minutes taking the hits and sorting them into “caches” for each hour, day, week, month, year…etc. This works amazing and it’s incredibly scalable; however, it only works for 1 timezone. Since the entire company has access to this, we’re dealing with a few hundred users in various timezones. What I define as “Today” in San Jose is MUCH different than what my colleague in London defines as Today. Since the current solution is only cached to 1 timezone, it’s a nightmare for anyone who’s checking the data outside of our timezone.

Our current plan to fix this is to create caches for every timezone (40 in total); however, that would mean that we’re multiplying the amount of data by 40…that’s terrible to me and given that the caches can be very large, multiplying it just sounds like a bad idea; plus, when we go to process the queue, it’s going to take a lot more CPU time to put them in 40 different caches.

Any one else have a better idea of how to solve this problem?

(Sorry for such a long question..it’s not exactly easy to explain. Thanks all!)

  • 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-05-11T16:14:39+00:00Added an answer on May 11, 2026 at 4:14 pm

    The solution you are proposing has too much redundancy. I would suggest you store the data in at least 30-minute buckets instead of hourly and the time zone be normalized to UTC.

    With 30-minute buckets, if a user requests hourly data for 1 – 2PM from -4.5 UTC you can fetch data for 5:30 – 6:30PM from your system and show that. If you store data in one-hour increments you can’t service requests to users in time zones with N + 0.5 hour differences.

    For daily numbers you would need to aggregate 48 half-hour slots. The slots to pick would be determined by the user’s time zone.

    It gets interesting when you get to annual data because you end up having to aggregate 17,520 half-hour buckets. To ease that computation I would suggest you get the pre-aggregated annual data per UTC time and the subtract aggregate data for the first for 4.5 hours of the year and add aggregate data for the first 4.5 hours of the next year. This will essentially shift the whole year by 4.5 hours and the work is not that much. Working from here, you can tweak the system further.

    EDIT: Turns out Kathmandu is +5.45 GMT so you would need to store the data in 15-minute buckets instead of 30-minute buckets.

    EDIT 2: Another easy improvement is around aggregating annual so you don’t have to add 17,520 buckets each time and without requiring one aggregate per country. Aggregate the annual data from Jan 02 – Dec 30. Since the maximum time-zone difference between any two countries is 23 hours, this means that you can take the annual data (Jan 02 – Dec 30) and add a few buckets before and after as appropriate. For example for a -5 UTC timezone you would add all buckets on Jan 01 after 0500, all buckets on Dec 31, and on Jan 01 the following year up to 0500 hours.

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

Sidebar

Related Questions

When I first started working at the company that i work at now, I
the company I work has assigned me the task to create a system to
The company I work for is bidding on a project that will require our
I'm working for a company that has already released an app on the store.
Here is the situation: the company that I'm working in right now gave me
I've been assigned to upgrade/rewrite a webapp that my company uses to schedule conference
In company that I work for, I was given the opportunity to write an
I work with a few applications at the company I work for. I would
The company I work for is looking for an IVR implementation that is highly
My company has created multiple enterprise applications over the past 15 years that now

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.