MongoDB Insertion faliure Report - c#

Is it possible to know Document Insertion failure in MongoDB. I am using C# to connect to MongoDB.

You have to enable the "safe mode" on the operation level. safe=True in Python. Check with the C# drivers docs for the related functionality in C#.

Related

How to perform 2 phase commit in C# Mongodb strongly typed driver

I am using the official C# MongoDb strongly typed driver version 2.5.0 to interact with MongoDB.
I have multiple update operations (up to 4) on documents that belongs to different collections that need to be performed in an all-or-nothing pattern (similar to transactions in relational databases).
According to the MongoDB official documentation on this link Perform Two Phase Commits, to perform transactions like updates use 2 phase commits, so my questions are:-
How to achieve that functionality using the C# Mongodb strongly typed driver (please provide code example)?
And if it is not possible please suggest NoSQL Databases that support this functionality.

MongoDB C# driver 2.0 InsertManyAsync vs BulkWriteAsync

I have to insert many documents in a MongoDB collection, using the new C# 2.0 driver. Is using either collection.InsertManyAsync(...) or collection.BulkWriteAsync(...) making any difference? (particularly about performance).
From what I understand from MongoDB documentation, an insert with an array of documents should be a bulk operation under the hood. Is that correct?
Thanks for your help.
I found the answer looking at the driver source code: the InsertManyAsync uses internally the BulkWriteAsync.
So using InsertManyAsync it's the same as writing:
List<BsonDocument> documents = ...
collection.BulkWriteAsync(documents.Select(d => new InsertOneModel<BsonDocument>(d)));
Obviously, if all operations are Inserts, the InsertManyAsync should be used.

How to connect to HyperSQL DB from C#

We are searching for an In Memory DB with required features:
Client/Server mode
Support SQL, stored procedure
Can run in "In Memory" mode
Light and fast
Free
Can be connect from C#
HSQLDB meets all of our requirement. But we have trouble with the last option. We cannot find any component to connect from C# to this DB.
Please recommend us a good connectivity component or other DB that can meet all of our requirement.
Thanks.
A translation of HSQLDB 2.x to C# with some enhancments related to MS platforms exists. The main web site seems to have gone, but the blog is still there:
http://blog.effiproz.com/

What advantages does MongoDB offer over ElasticSearch as a NoSQL database only

I'm quite new to NoSql databases, but I'm really lovin' MongoDB with the official c# driver. It's currently the backend to an MVC application I'm writing, and the simplicity AND speed make my life way way easier.
However I've come to that point in the application where I need really great search. I used to use Solr, but have become quite interested in ElasticSearch.
ElasticSearch, as far as I can tell (from a very superficial level), can do everything MongoDB can in terms of being a document database.
So, if I'm already using a NoSql db, and I need great search, is there any point in Mongo? What's the use case?
Is Mongo faster? Easier to use? Is it the BSON datatypes and drivers? Why not use ElasticSearch as my DB?
I'm currently using AppHarbor and lovin' "The Cloud". I hate IT and want to focus on my application only. With that said, the only advantage I see so far is:
There are already a number of "Cloud" MongoDB providers. With ElasticSearch I've got to set it all up myself.
This is a very good question. I have asked myself the same question and came up with the following answer.
ElasticSearch doesn’t have a good way to backup data. As an example, do a quick search for “ElasticSearch backup” and one for “mongodb backup”. MongoDB has tools and documentation on how to backup data. While there is documentation on how to backup ElasticSearch data, this documentation doesn’t seem as mature.
In general, MongoDB has much better documentation. In particular its admin documentation is much better than ElasticSearch.
MongoDB provides commercial support. You might not care about commercial support at the moment, but it is nice to know it is available.
MongoDB has MapReduce built in, ElasticSearch does not. This may not be a big thing, but worth noting.
My personal opinion is that I wouldn’t use ElasticSearch if you cannot afford to lose data. I could see using ElasticSearch as a primary data store for something requiring real-time analytics, but did not have any long-term data retention requirements. Otherwise, I would suggest using MongoDB and ElasticSearch together. There is a MongoDB River Plugin for ElasticSearch. This makes it pretty easy to update the ElasticSearch index automatically.

How can I create a odbc layer on top of existing business data?

I want to expose our internal bussiness data through odbc driver. One of the propitary product that i found is DataDirect OpenAccess. I want to use SQL to query live data from our data source. Writing my own SQLEngine will take ages but i need something like following diagram. We intend to use it on live data so exporting it to database and than running query is not a good solution at this time. Can anyone guide me how can i solve it using opensource.
link text http://web.datadirect.com/images/products/custom-driver-sdk/OpenAccess-SDK.jpg
Given the requirements you describe, I don't see any choice but for you to develop an odbc driver that knows how to talk to your lisp engine. This will be a non-trivial task.
However, since you mention open source, you may be able to get a running start by looking at one of the the open source odbc drivers such as iODBC.
Affan,
A solution widely used in the Open Source world (Hadoop, Cassandra etc.) is the SimbaEngine SDK.
You can build a fully SQL complaint ODBC Driver in 5 Days. No need to write your own SQLEngine as it is baked in already. Download it from here, its free www.simba.com
Cheers,
Tom

Categories

Resources