All Projects → OrleansContrib → Orleans.providers.mongodb

OrleansContrib / Orleans.providers.mongodb

Licence: mit
A MongoDb implementation of the Orleans Providers: Membership, Storage and Reminders.

Projects that are alternatives of or similar to Orleans.providers.mongodb

Realtime Mongodb Pusher
Sample app that shows how to use MongoDB change streams and Pusher in a Node.js/React app
Stars: ✭ 44 (-13.73%)
Mutual labels:  mongodb
Express Mvc Boilerplate
A simple mvc boilerplate for express.js (gulp + expressjs + nodemon + browser-sync)
Stars: ✭ 46 (-9.8%)
Mutual labels:  mongodb
Aclify
🔒 Node Access Control Lists (ACL).
Stars: ✭ 49 (-3.92%)
Mutual labels:  mongodb
Ha Db
探索高效的SAAS结构,单体应用动态切换数据库。
Stars: ✭ 44 (-13.73%)
Mutual labels:  mongodb
Mongoc.jl
MongoDB driver for the Julia Language
Stars: ✭ 46 (-9.8%)
Mutual labels:  mongodb
Codeigniter Mongodb Library
CodeIgniter MongoDB library based on PHP 7.1+
Stars: ✭ 47 (-7.84%)
Mutual labels:  mongodb
Version Manager
Cross-platform helper for managing multiple versions of MongoDB
Stars: ✭ 43 (-15.69%)
Mutual labels:  mongodb
Icinema
A Full Stack MERN app with CRUD operations for theatres where users can search for movies that are available and admin can add a movie to the list and much more.
Stars: ✭ 51 (+0%)
Mutual labels:  mongodb
Graphql Advanced Projection
Fully customizable Mongoose/MongoDB projection generator.
Stars: ✭ 46 (-9.8%)
Mutual labels:  mongodb
Mongo Thingy
🍃 The most idiomatic and friendly-yet-powerful way to use MongoDB with Python
Stars: ✭ 49 (-3.92%)
Mutual labels:  mongodb
Glorious Crud
A bare minimum and extensible crud generator
Stars: ✭ 45 (-11.76%)
Mutual labels:  mongodb
One To One Websockets Chat
Building Persistable One-to-One Chat Using Spring Boot and WebSockets
Stars: ✭ 46 (-9.8%)
Mutual labels:  mongodb
Awesome Recommendation Engine
The purpose of this tiny project is to put things together with the know how that i learned from the course big data expert from formacionhadoop.com The idea is to show how to play with apache spark streaming, kafka,mongo, spark machine learning algorithms.
Stars: ✭ 47 (-7.84%)
Mutual labels:  mongodb
Community
a community based on Node.js
Stars: ✭ 44 (-13.73%)
Mutual labels:  mongodb
Restfulapi
flask-restful 中小型项目实例
Stars: ✭ 50 (-1.96%)
Mutual labels:  mongodb
Meteor Collection2
A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
Stars: ✭ 1,020 (+1900%)
Mutual labels:  mongodb
Mqtt Mongo
A generic service that subscribes to MQQT broker and saves messages to MongoDB.
Stars: ✭ 46 (-9.8%)
Mutual labels:  mongodb
Mongomem
In-memory MongoDB Server. Ideal for testing.
Stars: ✭ 51 (+0%)
Mutual labels:  mongodb
Mernapp youtube
Build a MERN Stack App from scratch, and deploy it to Heroku
Stars: ✭ 51 (+0%)
Mutual labels:  mongodb
Docker Flask Mongodb Example
Uses docker compose with a python flask microservice and MongoDB instance to make a sample application
Stars: ✭ 49 (-3.92%)
Mutual labels:  mongodb

Orleans.Providers.MongoDB

Nuget

Feedback would be appreciated.

A MongoDb implementation of the Orleans Providers.

This includes

  • Membership (IMembershipTable & IGatewayListProvider)
  • Reminders (IReminderTable)
  • Storage (IStoragePRovider)

Installation

install-package Orleans.Providers.MongoDB

Setup

Install MongoDB (BREAKING CHANGE)

From 3.1 onwards you have to register the IMongoClient in the service locator.

### Server side

# via Silo Host Builder (ISiloHostBuilder)
var silo = new SiloHostBuilder()
    .UseMongoDBClient("mongodb://localhost")
    ...
    .Build();

# via Generic Host + Silo Builder (ISiloBuilder)
var host = Host.CreateDefaultBuilder(args)
	.UseOrleans((context, siloBuilder) => {
		siloBuilder.UseMongoDBClient("mongodb://localhost")
		...
	});

### Client side
var client = new ClientBuilder()
    .UseMongoDBClient("mongodb://localhost")
    ...
    .Build();

as an alternative you can also implement the IMongoClientFactory interface and override the client names with options.

Membership

Use the client builder to setup mongo db:

var client = new ClientBuilder()
    .UseMongoDBClustering(options =>
    {
        options.DatabaseName = dbName;
        options.Strategy = MongoDBMembershipStrategy.Muiltiple
    })
    ...
    .Build();

and the same for the silo builder:

var silo = new SiloHostBuilder()
     .UseMongoDBClustering(options =>
    {
        options.DatabaseName = dbName;
        options.Strategy = MongoDBMembershipStrategy.Muiltiple
    })
    ...
    .Build();

The provider supports three different strategies for membership management:

  1. SingleDocument: A single document per deployment. Fastest for small clusters.
  2. Multiple: One document per silo and an extra document for the table version. Needs a replica set and transaction support to work properly.
  3. MultipleDeprecated: One document per silo but no support for the extended membership protocol. Not recommended.

Reminders

Just use the silo builder:

var silo = new SiloHostBuilder()
    .UseMongoDBReminders(options =>
    {
        options.DatabaseName = dbName;
        options.CreateShardKeyForCosmos = createShardKey;
    })
    ...
    .Build();

Storage

Just use the silo builder:

var silo = new SiloHostBuilder()
    .AddMongoDBGrainStorage("grains-storage-provider-name"
    options =>
    {
        options.DatabaseName = dbName;
        options.CreateShardKeyForCosmos = createShardKey;

        options.ConfigureJsonSerializerSettings = settings =>
        {
            settings.NullValueHandling = NullValueHandling.Include;
            settings.ObjectCreationHandling = ObjectCreationHandling.Replace;
            settings.DefaultValueHandling = DefaultValueHandling.Populate;
        };
    })
    ...
    .Build();

The provider uses Newtonsoft.JSON to serialize and deserialize MongoDB documents. In our benchmarks we have noticed that is slightly faster and has the benfit that you do not need to care about two serializers.

Remarks

As you can see you have to pass in the connection string to each provider. But we will only create one MongoDB client for each unique connection string to keep the number of connections to your cluster or server as low as possible.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].