The Cloud Ninja Polyglot Persistence (CN2P) project is an implementation of polyglot persistence and emerging patterns using NoSQL database to persist application data. This project does not offer any official guidance. For guidance and another
sample implementation of polyglot persistence, please see the Patterns & Practices guide in the References section below.
This is a sample that uses multiple databases to persist application data. The solution is not a complete working e-commerce solution. However, it is the basis for the sample to demonstrate key concepts to building solutions using a polyglot persistence
approach. This sample solution contains a web commerce site implemented using ASP.NET 4.5 MVC4. The repositories are REST services implemented in C#, Erlang, and Node.Js using different underlying database technologies. The database technologies used
cover 4 database categories (Document, Key-Value,
Graph, and RDBMS).
- Shopping Cart
- User Session
- Windows Azure Table Storage (Key-Value)
- Windows Azure SQL Database (RDBMS)
- MongoDB (Document)
- Redis (Key-Value)
- CouchDB (Document)
- Neo4J (Graph)
The ASP.NET web site that consumes the repository services and can be simply pointed at a different implementation of a service by configuring the web.config for the application and pointing it to an endpoint for an implementation that conforms to the documented
REST interface. The sample e-commerce web application can be deployed to a windows azure web site or cloud service and simply needs to be configured to use the various deployed services.
A test project is used to ensure the REST interface for a service implementation conforms to the REST interface specification.
Data Import Utility
This is a simple command line application that is used to import sample data in to the repositories. This can be used to import a sample product catalog for which data is defined in JSON files.
A number of implementations were created using different database technologies to explore the various benefits and challenges with the technologies as well as the general trade-offs with a polyglot persistence approach.
- Windows Azure Table Storage
- Orders Windows Azure SQL Database
- Catalog Service with .NET and MongoDB
- Catalog Service with Erlang and CouchDB
- Catalog Service with node.js and MongoDB
- User Session Service with .NET and Windows Azure Table Storage
- User Session Service with .NET and Redis
- User Session Service with .NET and In Memory
- Recommendation Service with .NET and Neo4J
The Patterns & Practices Team provides the recommended
guidance for building highly scalable systems using polyglot persistence. This project also provides an example solution.