Concepts: Service & Sharing

Last updated 2 min read
Report issue

Overview#

GritivaCore introduces a unique Service primitive and Sharing/Ingress model that allows for efficient communication between different scopes. This document outlines the key concepts, definitions, and importance of services and sharing within the GritivaCore framework.

Key Concepts#

Definition of Service#

A Service in GritivaCore is defined as a named endpoint within a specific scope that can be consumed by other scopes. The scope that hosts the service is referred to as the producer, while the consuming scopes reference the service using the format <scope>:<service-name>.

Definition of Sharing#

The Sharing model in GritivaCore governs which consumer scopes are permitted to access which producer services. It operates on an explicit allow-list principle, meaning that access is denied by default unless explicitly allowed.

Service and Sharing Model#

ASCII Diagram#

TEXT
Producer Scope (my-db)
   |
   |  Sharing Rule
   |
Consumer Scope (my-app)

Sharing Rules#

A Sharing rule consists of the following attributes:

  • producer_scope: The scope that produces the service.
  • service_name: The name of the service being shared.
  • consumer_scope: The scope that is allowed to consume the service.
  • allowed: bool: Indicates whether the consumer is permitted access.

Ingress Model#

The Ingress model is a special type of Sharing rule where the consumer is the public internet, allowing external access via Digital Rights Management (DRM).

Lifecycle Commands#

Services and sharing rules are managed in the panel at https://gritiva.com:

  1. Create a service — open the producer scope, then PROJECTS → Services → New service, and give it a name and a port (for example db on 5432).
  2. Allow a consumer — open FLOW, pick the producer service, and add the consumer scope to its allow-list.
  3. Revoke a consumer — remove that scope from the same allow-list; access is denied again immediately, since the model is deny-by-default.

To inspect the rules that currently apply to you from a script, use the REST API:

BASH
# every share you can see
curl -s https://api.gritiva.com/api/v1/access-shares \
  -H "X-API-Key: $GRITIVA_API_KEY"

# what is available to be shared
curl -s https://api.gritiva.com/api/v1/access-shares/catalog \
  -H "X-API-Key: $GRITIVA_API_KEY"

API keys are issued in the panel under SET. → API keys.

Resolution Process#

Within a consumer scope, the service my-db:db resolves through the gmesh DNS overlay to the actual IP and port of the producer service.

Conclusion#

Understanding the Service and Sharing model in GritivaCore is crucial for operators and developers. This framework not only facilitates efficient service consumption but also ensures secure access control through its Sharing rules.

Important Note

Important Note
This document focuses specifically on GritivaCore's Service and Sharing model. It does not cover Kubernetes Services or generic microservices introductions.

Further Reading

Further Reading
For the wider picture of how producers, consumers and ingress fit together, see the [Architecture Overview](/docs/architecture-overview) and [Concepts: DRM](/docs/concepts-drm).