Conversation
|
thank for the PR @jonhealy1 Before I start the review I have a quick question: should this extension be in |
|
Hi @vincentsarago I was wondering about that. I can move it to third party. |
Comments were addressed, but I don't have time for a re-review at the moment and don't want to let my change request block.
|
@jonhealy1 Can you explain the relationship between this and the multi-tenant work done in this (poorly named 😉 ) PR: NASA-IMPACT/veda-backend#531 I have seen some other approaches to multi-catalog and have even hacked together something by myself. Is your goal here to formalize how multi-tenant or multi-catalog should be done? Do you have a working implementation of this extension? I think this is great work, just trying to wrap my head around it all because I would be interesting in implementing it in pgstac/stac-fastapi-pgstac if not already done. |
|
Hi @bkanuka, thanks for checking this out and for the great questions! To give you a little behind-the-scenes context: we actually originally pitched this extension as the "Virtual Catalogs Endpoint". We really see the number one innovation here as introducing the Here is the easiest way to think about the difference between the VEDA PR and this extension: 1. VEDA’s Approach: Access-Level Isolation
2. This Extension's Approach: Structural Namespaces
The Goal & We currently have a working implementation operating as an optional feature in our stac-fastapi-elasticsearch-opensearch backend. Given how powerful |
|
Thanks for the thorough reply. It clarified a few things. I like the flexibility of this many-to-many approach and hopefully it gets wider adoption. (Although the route-to-filter approach does have the benefit of being a bit "thinner"). I'll also take a look at the electric/open search implementation. Is there a technical reason this was first implemented in opensearch over pgstac (i.e. there's something that makes opensearch a better backend for this) or was it a client-driven decision? |
@bkanuka You are totally right that the route-to-filter approach is "thinner" - it's an elegant way to multiplex a single database into multiple isolated STAC APIs using access control. However, the biggest limitation of that approach is that it forces a strictly flat structure; they won't have nested catalogs. It doesn't accomplish what we set out to achieve, namely structural, deeply nested Catalogs that allow for things like SKOS vocabularies, poly-hierarchies, and improved discoverability without siloing the data. To answer your question: there is no technical reason it was implemented in OpenSearch first, and OS isn't necessarily a "better" backend for this. It was simply because I am the lead maintainer of the Other organizations run their own custom versions of this already, but it's currently a "wild west" scenario because a In our OpenSearch implementation, we define Catalogs as a specific type of Collection. This meant we didn't even have to add new indexes (tables) or introduce breaking changes to support the functionality. |
|
Totally makes sense. Personally I need to balance the thinner solution that gets it done vs the more flexible, longer term, slightly "wild-west" solution but man...the wild west is so much more fun! 😁 I can't find the discussion now but I think last I read @bitner was hesitant to add anything like this to pgstac because a) potentially breaking changes b) he didn't have enough demand to warrant maintaining the additional code c) not yet a well defined stac extension (but of course that's the goal here). I'll explore if this could be implemented on top of pgstac without core changes. Using the same DB mechanism for Catalogs and Collections makes perfect sense. Plus if I can keep the code separate there'll be less eyes on my |
|
I personally think this is the future of STAC apis. Feel free to look into the extension definition itself and give any feedback or contribute. There's a lot still to do - ie. with Catalog search for one thing. Adding all of these routes is significant, but the benefits are immense. Also, the transaction routes are optional - they could be left out in the first iteration. I could help with the |
Use create_async, update methods, tests
Related Issue(s):
Description: Multi-Tenant Catalogs Extension
This extension introduces a recursive
/catalogsendpoint to the STAC API, enabling complex, nested hierarchies beyond the standard flatRoot -> Collectionsstructure. It transforms a STAC API into a Multi-Tenant system capable of serving distinct catalog trees (e.g.,Provider -> Theme -> Project) within a single instance.Key Architectural Concepts:
/children) that lists both Sub-Catalogs and Collections, supporting optional type filtering.Full Endpoint List:
GET /catalogs- List all root catalogs.POST /catalogs- Register a new root catalog.GET /catalogs/{catalog_id}- Get catalog metadata.PUT /catalogs/{catalog_id}- Update catalog metadata.DELETE /catalogs/{catalog_id}- Disband a catalog (does not delete data).GET /catalogs/{catalog_id}/catalogs- List sub-catalogs.POST /catalogs/{catalog_id}/catalogs- Create or link a sub-catalog.DELETE /catalogs/{catalog_id}/catalogs/{sub_catalog_id}- Unlink a sub-catalog.GET /catalogs/{catalog_id}/collections- List linked collections.POST /catalogs/{catalog_id}/collections- Create or link a collection.GET /catalogs/{catalog_id}/collections/{collection_id}- Get collection details.DELETE /catalogs/{catalog_id}/collections/{collection_id}- Unlink a collection.GET /catalogs/{catalog_id}/collections/{collection_id}/items- Search items within catalog context.GET /catalogs/{catalog_id}/collections/{collection_id}/items/{item_id}- Get single item.GET /catalogs/{catalog_id}/children- Unified list of child Catalogs and Collections.GET /catalogs/{catalog_id}/conformance- Conformance classes for this catalog tree.GET /catalogs/{catalog_id}/queryables- Queryable fields for this catalog tree.Specification Reference:
Healy-Hyperspatial/multi-tenant-catalogs
PR Checklist:
pre-commithooks pass locallymake test)make docs)