Unifying URN format #12
Replies: 3 comments
-
In proposal one |
Beta Was this translation helpful? Give feedback.
-
Proposal #1 for external services format: metabase - |
Beta Was this translation helpful? Give feedback.
-
Proposal #1 for internal service Format: |
Beta Was this translation helpful? Give feedback.
-
URN or Uniform Resource Name is what we are using across our tools and libraries in ODPF. URN should not be ambiguous and only represent a single resource. That is why having a good URN format is crucial as it will prevent conflict or duplication of identifiers.
The goal of this RFC is to decide what is a good and persistent URN format that can be used across our tools.
Background
What is a resource?
TBA
Current formats
To understand the needs of this initiation better, let's take a look at how each of our tools generate their URN format.
{service}::{host}/{database}/{table}
postgres::10.283.86.19:5432/user_db/user_role
{service}::{project}/{dataset}/{table}
bigquery::odpf-prod/datamart/daily_booking
{service}::{host}/dashboards/{dashboardID}
metabase::my-metabase-server.com/dashboards/872
{resource_type}/{namespace}/{resource_id}
r/namespace-id/resource-name
{resource_id}
metabase:293
There are few things that we can improve here:
{host}
as part of the URN will damage persistency (mostly on meteor's). Resource location should be allowed to change without causing its generated URN to be invalid./
as a separator has a few issues:http
protocol, this URN will need to be encoded.route-match
properly. (e.g gorillamux default behaviour)Limited resource referencing between tools
Instead of each tools defining their own URN formats, it will be better, if possible, all tools or services have the same urn format when talking about a resource or asset.
Since different tools are using different format, this would prevent resource referencing (or potentially sharing?) between tools without helps from an extra mapping layer (either by service or library).
Requirements
Our final unified URN should handle these cases:
host
.And these are cases that are great to have:
Proposal
1.
urn:{NID}:{NSS}:{project}:{kind}:{name}
- by spy16I highly recommend we stick to the IETF standard definition of URN from RFC8141 (even if we take only a subset of it).
RFC 8141: Section 2 defines the syntax for URNs.
odpf
(orODPF
) as the Namespace Identifier (NID).entropy
as the NSS.NID and NSS combined forms the
assigned-name
:urn:<NID>:<NSS>
-->urn:odpf:entropy
. This assigned-name uniquely identifies every product within odpf.Optional components (which are defined by the entity that owns the NSS) can be appended to
assigned-name
to form resource-level identifiers. For example:urn:odpf:siren:alert1
Optional components can have some generic restrictions that we follow. For example:
^[A-Za-z0-9-]+$
./
character.urn
matches everything globally,urn:odpf
matches everything within ODPF,urn:odpf:entropy
matches everything within entropy product of odpf,urn:odpf:entropy:project-foo
matches everything withinproject-foo
and so on).With all these combined: The URN for a "resource" of kind "firehose" in project "foo" with name "f1" managed by "entropy" will be
urn:odpf:entropy:foo:firehose:f1
2.
{namespace}:{label}:{source}:{identifier}
- by StewartJinggaodpf
,odpf-prod
.transaction_storage
,optimus
,main-database
,production
.postgres
,bigquery
,metabase
,kafka
.source
. The simplest approach is to just use the identifier generated by thesource
itself. In case ofmetabase's collection
, we can usecollection:321
orcard:88
for representing a card.Examples
odpf:main-dashboard:metabase:collection:321
odpf:default:bigquery:myproject:mydataset:mytable
- default is used for an urn that does not require label for uniquenessodpf:stencil-integration:postgres:descriptors
- this is to represents a postgres table that is used by stencil integrationodpf-prod:compass:elasticsearch:index:table
- this is to represents an elasticsearch index that is used by compass in productionodpf:datalake:hadoop:index:table
- this is to represents a hadoop table that is being used as a datalakeBeta Was this translation helpful? Give feedback.
All reactions