[SERVER-14136] Allow mapreduce Javascript code to perform HTTP requests Created: 30/Jan/14  Updated: 06/Dec/22  Resolved: 04/Feb/22

Status: Closed
Project: Core Server
Component/s: MapReduce
Affects Version/s: None
Fix Version/s: features we're not sure of

Type: New Feature Priority: Major - P3
Reporter: ThomasJ Assignee: Backlog - Query Execution
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

Instead of relying on hadoop to do a mapreduce, it would be really useful to call c++ or java or python or ... libraries from inside mongo mapreduce, and a way to do this would be to allow to do get or post request to a localhost server

If I am not clear, imagine the following :
you have :

  • a mongodb containing lots of pictures
  • an awesome library in c++ that tells you if you are on the picture or not

you want to do :

  • make a c++ server that runs on localhost:12345 and that takes a picture as an argument and returns true or false
  • mapreduce over your library (or foreach) and call the server with your data

I was originally thinking of an EASY way to call external (c++/...) libraries from mongo without going through hadoop, so maybe you have other ideas ! As long as it can ease a lot of pain for users I am fine

Thanks !



 Comments   
Comment by Esha Bhargava [ 04/Feb/22 ]

Closing these tickets as part of the deprecation of mapReduce.

Comment by ThomasJ [ 05/Jun/14 ]

Exactly, any solution will do. Im not a pro of javascript so the only thing I could think of was a hack to call localhost. (is it a big security hack to allow only that ?)
I hope you can get that in soon !

Comment by Matt Kangas [ 03/Jun/14 ]

I've updated the ticket title to better reflect your description.

You want to call external code from MongoDB Map/Reduce JS. Paths for achieving this include:

  1. Allow mapreduce JS to perform HTTP requests, as you describe.
  2. Some IPC mechanism besides HTTP.
  3. Dynamically loadable server modules, with an interface for calling them from mapreduce JS. SERVER-8583.

Enabling HTTP requests from server-side Javascript is challenging from a security perspective, so we are unlikely to pursue this course.

Comment by Matt Kangas [ 02/Jun/14 ]

I think what you want is user loadable modules in the server which are callable from server-side javascript. The ticket for the first part is SERVER-8583.

Generated at Thu Feb 08 03:33:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.