[Question] Understanding Marten vs OSS DocumentDb #3964
-
Hey team! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Please run through this comparison below:
|
Beta Was this translation helpful? Give feedback.
-
Marten provides a list of functionality (please read the docs) as a fancy .NET library on top Postgres database as its underlying database. Marten stores all data in Postgres tables where each document type is a table where in the whole of the data is serialized as JSON as stored in a single JSONB column. So Marten has it way to define the table schema etc for storing documents as part of document database. So with regards to your question would the data be "stuck", certainly not if you inspect and understand the table schema created by Marten and you can use plain vanilla SQL queries outside of Marten to query the data etc. With regards to miscellaneous entry with "DocumentDB", it is a short form for "document database". In this context of this answer, using "DocumentDb" caused a confusion for you since Microsoft cleverly uses this specific term "DocumentDB" as it is library name to make users perceive everyone else copied from it. From a document database standpoint,both Marten and MongoDb are selling the idea of schema-less storage of data i.e. work with documents without worrying about the schema. Marten provides LINQ and direct SQL based mechanism to work with data and Mongo provides its own API to work with documents. The primary impetus from a selection for a document database would be for you to choose whether you want use Mongo API/Mongo client or .NET LINQ to work with documents. Beyond the general document database functionality, Marten provides muti-tenancy, event store and lot more as a functionality beyond document database. It is up to you to use what fits your needs. As a closing note, I am going ask you go and read the Marten documentation, try it out and understand what all functionality it provides. Marten just completed 10 years and the Microsoft OSS DocumentDB announced being OSS in Jan 2025. |
Beta Was this translation helpful? Give feedback.
-
@omni-htg You can happily read anything directly out of a Marten PostgreSQL database with raw SQL and all of its JSONB operators. Maybe not something I'd recommend doing having another service also try to access the Marten tables, but very technically possible. |
Beta Was this translation helpful? Give feedback.
-
Thank you, this is the kind of answers and clarification I was looking for!
Oh for sure! Congrats on the decade! 🥳
These are great news. Not that there's any particular reason to do so, but I personally agree more and more with the sentiment for better data governance, which IMO implies having "options" to produce and consume your data. Thank you kindly to both, this was a great help! |
Beta Was this translation helpful? Give feedback.
Marten provides a list of functionality (please read the docs) as a fancy .NET library on top Postgres database as its underlying database. Marten stores all data in Postgres tables where each document type is a table where in the whole of the data is serialized as JSON as stored in a single JSONB column. So Marten has it way to define the table schema etc for storing documents as part of document database. So with regards to your question would the data be "stuck", certainly not if you inspect and understand the table schema created by Marten and you can use plain vanilla SQL queries outside of Marten to query the data etc.
With regards to miscellaneous entry with "DocumentDB", it is a s…