Mongodb + silverlight

Has anyone worked with mongodb from Silverlight? Which driver did you use? Silverlight only supports asynchronous sockets; but it looks like the available C # drivers are synchronous.

+4
source share
3 answers

It is probably best to use the official 10g MongoDB C # server on a server with a lightweight web API that will sit above it, which could be consumed by your Silverlight application with WCF, SOAP, REST, etc.

+2
source

Believe it or not, my first project with MongoDB was in Silverlight. IronPython, some C #. That was in 2009, and we went live with something like 0.8 or 0.9 MongoDB ... so that was a bit.

It was, I think, 2.x Silverlight, so it was harder to complete tasks such as direct connections to the database. However, I would still recommend following the route that I went at that time.

Use the REST + JSON API on your server and keep in touch with the client. We worked in Python, but these days there are some awesome ready-made Mongo REST interfaces, such as Sleepy Mongoose , if you don't want to roll back your own.

The biggest advantage of this is the security issue: if you directly connect the database from the client to the server, even with authentication, you run the risk of getting into your database ... at that moment they can do whatever they want, MongoDB Authentication restricts access at the database level, but not that people can see or delete. In some cases, this does not even require disassembling the code, as there are, as I recall, development browser plugins that allow you to script a working Silverlight application from IronPython and IronRuby.

There are other reasons, including a synchronous question, but overall I think that having a server interface for Mongo with a clean, secured facade that speaks to Silverlight will serve you better.

+4
source

It is not a good practice to access mongoDB from silverlight.

I suggest you wrap all your commands in a clean WCF service (possibly a data service) and completely abstract mongo plumbing.

this will allow you to precisely control which operation can be performed, who can execute the command and with the evolutionary protocol.

+1
source

All Articles