I’m currently managing two separate projects, both using Directus, and they share several common reference collections. I’d like to avoid duplicating this data across both projects.
Is it possible to set up a third Directus instance to manage these shared collections, and then have the other two instances read from it?
Don’t think you can connect multiple databases to a single Directus instance, but you could use undocumented DB_SEARCH_PATH env variable to include multiple postgres schemas of the same database: DB_SEARCH_PATH: "array:schema1,schema2"
I understand you’d like to avoid duplicating the data.
@Nik is correct here. Currently, you can not connect a single Directus instance to multiple databases. So you wouldn’t be able to treat the reference data as “local” collections.
I’m not sure your use case so this might be helpful or might not…but depending on the type, how much data, and how you need to use it - you could use use the data via the APIs of the third instance that you mention in the other two.
For example, if it’s something like car makes and models or countries, the Autocomplete Input interface comes to mind here - where you can search and load a value from a given URL.
If it’s something a little more complicated than that, you might look into a custom interface extension where you’ve got total control.
If you decide you are ok with duplicating the data and you want to keep these collections “in sync” across different instances - you might investigate a few of the different sync extensions / utilities developed by community members.
Though not created for this purpose, the directus-template-cli utility has a content only option where you can ‘apply’ just the content extracted from instance A into instance (assuming the schemas are the same, of course).