How does Jovo handle simultaneous requests?


#1

If multiple users make requests of the same Jovo app at once, what happens? I know Javascript itself does not have threading, but are they handled in sequence or in parallel?

My system copies data from another source on the web, fomatting it for more convenient use, and stores that in a local cache file. Periodically (exact triggers still being determined), it does an incremental update of the in-memory data and writes out a new copy of that cache. The question is, do I need to implement interlocks to prevent two users from trying to update the cache simultaneously, or will that condition never arise?


#2

Hi @keshlam,

Where are you planning to deploy your Jovo app to? If e.g. AWS Lambda, there won’t be a problem, a new Lambda instance will be instantiated for a parallel request.


#3

Currently it’s running on my own machine. Still determining where it’ll eventually be deployed to; that depends in part on whether the show’s producers want to take over hosting it or if it continues to be an unofficial “skunkworks” project.

I haven’t worked with lambdas enough to grok how they handle shared resources, but I’m not sure I see how that would solve my problem. I don’t want to re-parse the entire database every time the app starts, and incremental means maintaining and updating a cache; having the cache means risk of update and access colliding with each other unless I go all the way to the Proper Solution of using a real database rather than file-backed in-memory data structures.

Just enabled play-by-broadcast-date and play-by-episode-number, and invited the show’s producers to alpha test and let me know whether they think it’s worth offering to the public. A few more bits and pieces to go, including bringing it up on Google et al. It isn’t the most cleanly coded thing in the universe, but as Steve Boies always said: “Make it work, make it good, make it great” (implicitly: in that order).


#4

If running on a production server, a file-backed system for data storage is a bad choice, so you need to implement a database integration at some point. For Lambda, as @jan said, there won’t be a problem, otherwise it depends on the server integration you choose.