Collection of collections?

46 views
Skip to first unread message

Ivan Montilla

unread,
Oct 7, 2019, 12:33:06 PM10/7/19
to RavenDB - 2nd generation document database
Hello, I'm developing an application that can be extended loading modules. The modules are class libraries that can contain entities.

If two modules contains an different entities, but with the same class name, how RavenDB client handle it? In postgres, we can use schemas that are a collection of tables, indexes...

Oren Eini (Ayende Rahien)

unread,
Oct 8, 2019, 3:39:38 AM10/8/19
to ravendb
I'm not sure that I'm following.

You mean, what happens if you have two modules that have "Order" class, but defined differently?

You can handle that by using Conventions.FindCollectionName and adding the module name to the collection to create this separation

On Mon, Oct 7, 2019 at 7:33 PM Ivan Montilla <goo...@ivanmontilla.es> wrote:
Hello, I'm developing an application that can be extended loading modules. The modules are class libraries that can contain entities.

If two modules contains an different entities, but with the same class name, how RavenDB client handle it? In postgres, we can use schemas that are a collection of tables, indexes...

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/b93c6272-72e0-4bdb-8293-55b19df2b00c%40googlegroups.com.


--
Oren Eini
CEO   /   Hibernating Rhinos LTD
Skype:  ayenderahien
Support:  sup...@ravendb.net

Ivan Montilla

unread,
Oct 8, 2019, 9:48:04 AM10/8/19
to RavenDB - 2nd generation document database
You mean, what happens if you have two modules that have "Order" class, but defined differently?
Yes, mi application is extensible, so it can load modules uploading a *.dll file. The modules are basically class library that implements some interfaces of the core of my application, but can contains entities if it need. In this approach, is possible two vendors create its order modules with two different Order class.

You can handle that by using Conventions.FindCollectionName and adding the module name to the collection to create this separation
Thank you, all modules need to contains a meta-inf file with module name, I can extract the module id from this file and prepend to collection. I'll follow this strategy, but I really want to see in future version of RavenDB a new organization level for collections.

El martes, 8 de octubre de 2019, 9:39:38 (UTC+2), Oren Eini escribió:
I'm not sure that I'm following.

You mean, what happens if you have two modules that have "Order" class, but defined differently?

You can handle that by using Conventions.FindCollectionName and adding the module name to the collection to create this separation

On Mon, Oct 7, 2019 at 7:33 PM Ivan Montilla <goo...@ivanmontilla.es> wrote:
Hello, I'm developing an application that can be extended loading modules. The modules are class libraries that can contain entities.

If two modules contains an different entities, but with the same class name, how RavenDB client handle it? In postgres, we can use schemas that are a collection of tables, indexes...

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Oct 10, 2019, 9:58:53 AM10/10/19
to ravendb
The typical way you'll handle something like this if you want strict separation is to have a separate db for them.

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/94a6a086-2884-4f23-81e7-af25fd37fd66%40googlegroups.com.

Ivan Montilla

unread,
Oct 10, 2019, 12:34:26 PM10/10/19
to RavenDB - 2nd generation document database
I can have separate DB, but it allow that two entities have the same ID, and it's not desirable. It's possible that one module requires that other module must be installed because the entities of the first module references entities of the other module, so it's required to ensure unique ID of the entity in all databases.

For now, I'll follow the convention ModuleID/ClassName/ID-Node, for example MontyModule/Orders/1-A

Oren Eini (Ayende Rahien)

unread,
Oct 10, 2019, 10:10:47 PM10/10/19
to ravendb
Just to note, you can control the id generation and ensure globally unique ids in that way

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/95873dca-ec54-4f51-a851-459a831db84f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages