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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:29:04+00:00 2026-05-27T19:29:04+00:00

If I have a json like follows, what would be the most efficient way

  • 0

If I have a json like follows, what would be the most efficient way to keep this and be able to increment it in a data store? Should I use Mongo since I will be able to hold on to the nested structure, or use Redis which will allow me to increment atomically? Also, is there a structure where I could only update the counters for a specific day and have it update the appropriate month and day counters?

{
    "summary": [
        {
            "years": [
                {
                    "yr": "2008",
                    "cnt": 1222,
                    "net": 333,
                    "months": [
                        {
                            "mn": "09",
                            "cnt": 642,
                            "net": 1544.4,
                            "days": [
                                {
                                    "dy": "2",
                                    "cnt": "3",
                                    "net": "4"
                                }
                            ]
                        },
                        {
                            "mn": "10",
                            "cnt": 3216,
                            "net": 6452.1
                        },
                        {
                            "mn": "11",
                            "cnt": 327,
                            "net": 572.8
                        }
                    ]
                }
            ]
        }
    ]
}
  • 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-27T19:29:04+00:00Added an answer on May 27, 2026 at 7:29 pm

    For the best performance try Redis. It’s lightning fast. I don’t believe that Redis has a structure that allows automatic incrementing of children but because of the amazing performance you could use a little script to do so. Also the nested structure won’t be the biggest problem because as long as you know what type of structure your elements have you can recreate it:

    summary:years:2008:months:days:dy
    

    and so on. It’s pretty easy to do this as long as you know what to call. If you want to have a collection of all available years for example then you create an array in summary:years and so on for each dynamic array so you always know what elements are available and properly set.

    If you don’t want these “recreation” problems and redundant collections use Mongo. As long as you can be sure you can somehow manage to increment atomically (this document may help you). However I can’t say something about Mongo because I’ve never used it.

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

Sidebar

Related Questions

I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have a JSON array like this: { forum:[ { id:1, created:2010-03-19 , updated:2010-03-19
I have some JSON returned to the browser like this product: { Title: School
I have to process JSON files that looks like this: \u0432\u043b\u0430\u0434\u043e\u043c <b>\u043f\u0443\u0442\u0438\u043c<\/b> \u043d\u0430\u0447 Unfortunately,
I have a JSON object returned from server. It looks like this : {1:{id:1,name:autos},
I have an array of json objects like so: [{a:b},{c:d},{e:f}] What is the best
I have a JSON result that contains numerous records. I'd like to show the
If you have a controller method like so: @expose(json) def artists(self, action=view,artist_id=None): artists=session.query(model.Artist).all() return
I have a JSON as follows { columns : [RULE_ID,COUNTRY_CODE], RULE_ID : [1,2,3,7,9,101,102,103,104,105,106,4,5,100,30], COUNTRY_CODE
I have a method as follows use to correct empty values in Json +(NSString

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.