Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Simple JSON based data storage - what would you recommend?

by blindluke (Hermit)
on Oct 14, 2014 at 16:16 UTC ( [id://1103759]=note: print w/replies, xml ) Need Help??


in reply to Re: Simple JSON based data storage - what would you recommend?
in thread Simple JSON based data storage - what would you recommend?

Thank you. You're right - I was overthinking the whole thing. I'll update the files using File::Temp's tempfile and rename, and I'll store them under the same dir, with file name corresponding to the view name.

Then, on the frontend, I'll just have a handler associated with the path '/data/viewname' that returns the viewname file contents (JSON).

There is a blurt_atomic sub in Sysadm::Install that handles the tempfile/rename routine, I'll either roll my own in a similar way, or just use the module as an added dependency.

Again, thank you, both for the time, and the good advice.

- Luke

  • Comment on Re^2: Simple JSON based data storage - what would you recommend?

Replies are listed 'Best First'.
Re^3: Simple JSON based data storage - what would you recommend?
by derby (Abbot) on Oct 15, 2014 at 10:58 UTC

    As long as the back-end is a single machine and not a load-balanced farm *and* the number of saved files is relatively small, this will work fine. A shared filesystems across a farm presents it's own set of challenges as does a large number of files in one directory. For load-balanced farms, I would pin the service to one machine and if the number of files is expected to be greater than 10K, I would use some type of directory partitioning scheme to keep the number of files in a directory low (for those times when you need to manually read the dir).

    -derby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1103759]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-23 20:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found