I've been working on a rails app for a couple of days now that I need an underlying "middle layer" for that connects my rails application to the various services that make up the data.
The basic setup looks like this:
Frontend ("Rails app") -> user requests data to be aggregated -> info goes in database and a JSON request is sent to "middle layer" to retrieve the data from a source of other places, process it, then send it back to the frontend which streams it to the users browser via websockets.
Middle layer -> uses sockets to listen for the frontend making a request. Once request is made, aggregation begins.
Base layer -> load balancing among a scalable network design.
I don't think that this is as efficient as it could be though. I feel like I'll run into concurrency problems or it just being too slow for use. I need to be able to scale it up.
My main question though rests in the area of what language would be more efficient for this to run fast?