SAP has announced partnership with MongoDB recently at SAPPHIRE. The next version of SAP Lumira would have connectivity with MongoDB. For the current version, there are two ways by which MongoDB can be connected with SAP Lumira. This blog is about one of the ways to connect, using Odata.

OData connectivity with SAP Lumira

SAP Lumira can fetch and process data from an OData feed by using the open OData 2.0 driver provided along with it. By exposing MongoDB collections as OData, the same can be consumed by Lumira for visualization. The OData feeds update as the documents in the collection update. This is a generic way.

MongoDB as OData

Windows Communication Service (WCF) is a framework for building service-oriented applications. It can define endpoint as MongoDB and expose them as OData, which then can be used in any applications that can work on OData. MongoDB driver for .NET is used to make the web application communicate with MongoDB and pull the data out. MongoDB service should be running throughout the process.

A blank .NET 4.0 MVC web application (solution) is created in Visual Studio and by using NuGet packet manager, the driver and the web service for MongoDB is added to the solution as a source package. The NuGet console can be accessed by


Tools->NuGet package Manager->Package Manager Console.


/wp-content/uploads/2014/06/1_477509.png

If the NuGet package manager is missing, it can be installed in the Extensions manager in Tools menu.

Extensions-manager.PNG

The command Install-Package MongOData executed on the NuGet console downloads and adds the files to the blank solution.

3.PNG

 

             Web.config holds the configuration information for the connectivity options to MongoDB. The connection string is updated with the URL of MongoDB                Database.

Web.Config Database Connection
<add name=MongoDBconnectionString=mongodb://localhost/TESLA/>


The format for connectionString is mongodb://<hostname>:<port>/<db> The port can be omitted if instance is running on default port. The application can be published to IIS or can be executed on the local development server. MongoDataService.svc is the end point for OData and it can be opened in browser to view the collections of the database as OData.

4.PNG

The Generic OData 2.0 source is selected in Lumira. The OData URL is then used and Lumira displays the list of collections in the particular Database in MongoDB.


/wp-content/uploads/2014/06/5_477513.png

Additional details like Username, password and proxy information are optional and can be skipped for default configurations of MongoDB.

/wp-content/uploads/2014/06/6_477514.png

The Storyboard can then be built from the Data available from the collection that was imported.

/wp-content/uploads/2014/06/7_477518.png

8.PNG

OData using Node.js

For MongoDB running on other platforms, the same can be achieved by using OData server in nodejs and exposing MongoDB collections as OData and consuming the same in Lumira.

Conclusion

                OData can be used as the service medium for connecting SAP Lumira and MongoDB. Next series of the blog would be about using JDBC to connect Lumira and MongoDB.

Happy Visualizing !

Posted originally on http://www.visualbis.com/blogs/sap-lumira/2014/06/24/connecting-sap-lumira-with-mongodb-part-1/

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Ashok Babu Kumili

    Hello Shankar,

    Thanks for the blog. It was very helpful for articulating the possibilities and building solutions….Very nicely written article I’ve learnt the key message . . . 🙂

    -Kind Regards Ashok

    (0) 

Leave a Reply