Skip to main content

SQL Introspection API

Restate exposes a set of tables that can be queried via psql. The schema of these tables is described in the following.

Table: state

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name of the invoked service.Greeter
service_keyUtf8The key of the Virtual Object.bob
keyUtf8The utf8 state key.A snippet like ctx.set(“seen”, 1); Will produce a value like: seen
valueBinaryA binary, uninterpreted representation of the value. You can use the more specific column value_utf8 if the value is a string.
value_utf8Utf8Only contains meaningful values when a service stores state as utf8. This is the case for TypeScript services since the TypeScript SDK serializes values as JSON.1

Table: sys_invocation

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
idUtf8Invocation ID.
targetUtf8Invocation Target. Format for plain services: ServiceName/HandlerName. Format for Virtual Objects: VirtualObjectName/Key/HandlerName.Greeter/greet or Greeter/Francesco/greet
target_service_nameUtf8The name for the invoked service.Greeter
target_handler_nameUtf8The invoked handler.greet
target_service_keyUtf8The key of the Virtual Object. Null for regular services.bob
statusUtf8Enum value: pending or ready or running or backing-off or suspended or completed.
invoked_byUtf8Enum describing the invoker of this service: ingress = invoked externally / service = invoked by a service.
invoked_by_service_nameUtf8The name of the invoking service. Or null if invoked via the ingress.Greeter
invoked_by_idUtf8The Invocation ID of the service that triggered this invocation. Or null if invoked externally.
pinned_deployment_idUtf8The opaque service deployment ID that has been committed for this invocation; this is set after the first journal entry is stored for this invocation.
trace_idUtf8The ID of the trace that is assigned to this invocation. Only relevant when tracing is enabled.
journal_sizeUInt32The number of journal entries durably logged for this invocation.
created_atDate64Timestamp indicating the start of this invocation.
modified_atDate64Timestamp indicating the last state transition. For example, last time the status changed from invoked to suspended.
retry_countUInt64The number of attempts since the last successful attempt of this invocation. Increments on start, so 2 or more means a failure occurred.
last_start_atDate64Timestamp indicating the start of the most recent attempt of this invocation.
next_retry_atDate64Timestamp indicating the start of the next attempt of this invocation.
last_attempt_deployment_idUtf8The opaque service deployment ID that was used in the most recent attempt of this invocation; this will be set before a journal entry is stored, but can change later.
last_attempt_serverUtf8Server/SDK version.restate-sdk-java/0.8.0
last_failureUtf8An error message describing the most recent failed attempt of this invocation, if any.
last_failure_error_codeUtf8The error code of the most recent failed attempt of this invocation, if any.
last_failure_related_entry_indexUInt64The index of the journal entry that caused the failure, if any. It may be out-of-bound of the currently stored entries in sys_journal.3
last_failure_related_entry_nameUtf8The name of the journal entry that caused the failure, if any.my-side-effect
last_failure_related_entry_typeUtf8The type of the journal entry that caused the failure, if any.SideEffect

Table: sys_journal

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
idUtf8Invocation ID
indexUInt32The index of this journal entry, where PollInputStream will be index 0
entry_typeUtf8Enum value: one of PollInputStream, OutputStream, GetState, SetState, ClearState, Sleep, Invoke, BackgroundInvoke, Awakeable, CompleteAwakeable, Custom.
completedBooleanIndicates whether this journal entry has been completed; this is only valid for some entry types.
nameUtf8The name of the entry supplied by the user, if any.my-journaled-action
invoked_idUtf8If this entry represents an outbound invocation, indicates the ID of that invocation.
invoked_targetUtf8If this entry represents an outbound invocation, indicates the invocation Target. Format for plain services: ServiceName/HandlerName. Format for Virtual Objects: VirtualObjectName/Key/HandlerName.Greeter/greet or Greeter/Francesco/greet
sleep_wakeup_atDate64If this entry represents a sleep, indicates wakeup time.
rawBinaryRaw binary representation of the entry. Check the service protocol for more details to decode it.

Table: sys_keyed_service_status

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name for the invoked service.Greeter
service_keyUtf8The key of the Virtual Object.bob
invocation_idUtf8Invocation ID

Table: sys_inbox

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name for the invoked service.Greeter
service_keyUtf8The key of the Virtual Object.bob
idUtf8Invocation ID.
sequence_numberUInt64Internal identified. Can be ignored.
created_atDate64Timestamp indicating the start of this invocation.

Table: sys_idempotency

Column nameTypeDescriptionExample
partition_keyUInt64Internal column that is used for partitioning the services invocations. Can be ignored.
service_nameUtf8The name for the invoked service.Greeter
service_keyUtf8The key of the Virtual Object. Null for regular services.bob
service_handlerUtf8The invoked handler.greet
idempotency_keyUtf8The user provided idempotency key.my-idemptency-key
invocation_idUtf8Invocation ID

Table: sys_service

Column nameTypeDescriptionExample
nameUtf8The name of the registered user serviceGreeter
revisionUInt64The latest deployed revision5
publicBooleanWhether the service is accessible through the ingress endpoint or not
tyUtf8Identifies if this is a Service or a VirtualObjectService
deployment_idUtf8The ID of the latest deployment

Table: sys_deployment

Column nameTypeDescriptionExample
idUtf8The ID of the service deployment
tyUtf8The type of the endpoint, this can be http or lambdahttp
endpointUtf8The address of the endpoint (http URL or Lambda ARN)
created_atDate64Timestamp indicating the deployment registration time.