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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:58:58+00:00 2026-05-21T19:58:58+00:00

We are working on a project that will feature real-time statistics of some actions

  • 0

We are working on a project that will feature real-time statistics of some actions (e.g. clicks).
On every click, we will log information like date, age and gender (these come from Facebook), location, etc.

We are discussing about the best place to store these information and use them for real-time stats. We will display aggregate statistics: for example, number of clicks, number of clicks made by male/female, number of clicks divided by age groups (e.g. 18-24, 24-30…).

Since on the site we are using MongoDB everywhere, my colleague thought we should store statistics inside it as well.
I, however, would prefer a SQL-based database for this task, like MySQL (or maybe Drizzle), because I believe SQL is better when doing operations like data aggregation. Although there’s the overhead of parsing the SQL, I think MySQL/Drizzle may actually be faster than No-SQL databases here. And inserts are not slow too, when using INSERT DELAYED queries.

Please note that we do not need to perform JOINS or collect data from multiple tables/collections. Thus, we don’t care if the database is different.
However, we do care about scalability and reliability. We are building something that will (hopefully) become very big, and we’ve designed every single line of code with scalability in mind.

What do you think about this?
Is there any reason to prefer MongoDB over MySQL/Drizzle for this? Or is it indifferent?
Which one would you use, if you were us?

Thank you,
Alessandro

  • 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-21T19:58:59+00:00Added an answer on May 21, 2026 at 7:58 pm

    So BuddyMedia is using some of this. The Gilt Groupe has done something pretty cool with Hummingbird (node.js + MongoDB).

    Having worked for a large online advertiser in the Social Media space, I can attest that real-time reporting is really a pain. Trying to "roll-up" 500M impressions a day is already a challenge, but trying to do it real time worked, but it carried some significant limitations. (like it was actually delayed by 5-minutes 🙂

    Frankly, this type of problem is one of the reasons I started using MongoDB. And I’m not the only one. People are using MongoDB for all kinds of real-time analytics: server monitoring, centralized logging, as well as dashboard reporting.

    The real key when doing this type of reporting is to understand that the data structure is completely different with MongoDB, you’re going to avoid "aggregation" queries, so the queries and the output charts are going to be different. There’s some extra coding work on the client side.

    Here’s the key that may point you in the right direction for doing this with MongoDB. Take a look at the following data structure:

    {
      date: "20110430",
      gender: "M",
      age: 1, // 1 is probably a bucket
      impression_hour: [ 100, 50, ...], // 24 of these
      impression_minute: [ 2, 5, 19, 8, ... ], // 1440 of these
      clicks_hour: [ 10, 2, ... ],
      ...
    }
    

    There are obviously some tweaks here, appropriate indexes, maybe mushing data+gender+age into an _id. But that’s kind of the basic structure of click analytics with MongoDB. It’s really easy to update impression and clicks { $inc : { clicks_hour.0 : 1 } }. You get to update the whole document atomically. And it’s actually pretty natural to report on. You already have your an array containing your hourly or minute-level data points.

    Hopefully that’s points you in the right direction.

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

Sidebar

Related Questions

I'm actually working on a PHP project that will feature a user system (Login,Register,Send
I am working on a project that will require internationalisation support down the track.
I'm working on a project that will require me to implement a calendar. I'm
I'm working on a project that will require me to take various .vbproj and
I'm working on a project that will have a single table holding lots and
I am going to be working on a project that will heavily involve indexing
I'm working on a small django project that will be deployed in a servlet
I'm working on a multi-lingual WPF project that will be localized into many different
I'm working on a SaaS project that will have each customer having an instance
I'm working on a java project that will allows users to parse multiple files

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.