|
18 | 18 | - [Derived from relation (`derived_from`)](#derived-from-relation-derived_from) |
19 | 19 | - [Versioning for Catalogs](#versioning-for-catalogs) |
20 | 20 | - [Example](#example) |
21 | | -- [Static to Dynamic best practices](#static-to-dynamic-best-practices) |
22 | | - - [Ingestion and links](#ingestion-and-links) |
23 | | - - [Keep catalogs in sync with cloud notification and queue services](#keep-catalogs-in-sync-with-cloud-notification-and-queue-services) |
24 | 21 |
|
25 | 22 | *Note: This section uses the term 'Catalog' (with an uppercase C) to refer to the JSON entity specified in the |
26 | 23 | [Catalog spec](https://github.com/radiantearth/stac-spec/blob/master/catalog-spec/catalog-spec.md), and 'catalog' (with a lowercase c) to refer to any full STAC implementation, |
@@ -310,37 +307,3 @@ This ensures that `my_item_02.json` includes a link to `my_item_01.json` |
310 | 307 | - `root / collections / example_collection / items / my_item / my_item.json` |
311 | 308 | - `root / collections / example_collection / items / my_item / my_item_01.json` |
312 | 309 | - `root / collections / example_collection / items / my_item / my_item_02.json` |
313 | | - |
314 | | -## Static to Dynamic best practices |
315 | | - |
316 | | -Many implementors are using static catalogs to be the reliable core of their dynamic services, or layering their STAC API |
317 | | -on top of any static catalog that is published. These are some recommendations on how to handle this: |
318 | | - |
319 | | -### Ingestion and links |
320 | | - |
321 | | -Implementors have found that it's best to 'ingest' a static STAC into an internal datastore (often elasticsearch, but a |
322 | | -traditional database could work fine too) and then generate the full STAC API responses from that internal representation. |
323 | | -There are instances that have the API refer directly to the static STAC Items, but this only works well if the static STAC |
324 | | -catalog is an 'absolute published catalog'. So the recommendation is to always use absolute links - either in the static |
325 | | -published catalog, or to create new absolute links for the STAC search/ endpoint |
326 | | -responses, with the API's location at the base url. The `/` endpoint with the catalog could either link directly |
327 | | -to the static catalog, or can follow the 'dynamic catalog layout' recommendations above with a new set of URL's. |
328 | | - |
329 | | -Ideally each Item would use its `links` to provide a reference back to the static location. The location of the static |
330 | | -Item should be treated as the canonical location, as the generated API is more likely to move or be temporarily down. The |
331 | | -spec provides the `derived_from` rel field, which fits well enough, but `canonical` is likely the more appropriate one |
332 | | -as everything but the links should be the same. |
333 | | - |
334 | | -### Keep catalogs in sync with cloud notification and queue services |
335 | | - |
336 | | -There is a set of emerging practices to use services like Amazon's Simple Queue Service (SQS) |
337 | | -and Simple Notification Service (SNS) to keep catalogs in sync. |
338 | | -There is a great [blog post](https://aws.amazon.com/blogs/publicsector/keeping-a-spatiotemporal-asset-catalog-stac-up-to-date-with-sns-sqs/) |
339 | | -on the CBERS STAC implementation on AWS. |
340 | | -The core idea is that a static catalog should emit a notification whenever it changes. The recommendation for SNS is to use the STAC |
341 | | -Item JSON as the message body, with some fields such as a scene’s datetime and geographic bounding box that allows |
342 | | -basic geographic filtering from listeners. |
343 | | - |
344 | | -The dynamic STAC API would then listen to the notifications and update its internal datastore whenever new data comes into |
345 | | -the static catalog. Implementors have had success using AWS Lambda to do a full 'serverless' updating of the elasticsearch |
346 | | -database, but it could just as easily be a server-based process. |
0 commit comments