The Foundry Ontology is a data backend that maps file-based data to organization-centric objects and serves high-speed queries for data exploration, data analysis, operational data editing, scenario analysis, and more. The Ontology stores data in multi-modal storage backends that each have their own purposes and can be flexibly queried in a single request. Querying the Foundry Ontology requires knowledge of some foundational concepts discussed below.
If you have an enterprise contract with Palantir, contact your Palantir representative before proceeding with compute usage calculations.
The first important concept is the difference between an object type and its corresponding object set. An object type is the semantic representation of the entity itself (such as the name and properties of the object).
An object type has a corresponding object set, which contains the objects themselves. The size of the object set corresponds to the number of rows of the incoming dataset and the number of objects created and deleted by Ontology actions.
The second important concept is the idea of query types, which include filters, aggregations, Search Arounds, and writeback operations. Each query type requires compute to execute.
sum
or avg
) on one of the properties for all objects in the set.View the API documentation to learn more about query types.
When using the Foundry Ontology, query types are executed against object sets by the following Foundry Applications:
Querying the ontology from any of these sources will use compute-seconds to run the query, as follows:
Object Storage V1 (Phonograph) stores data in a distributed set of indices in a durable, horizontally scalable cluster. In these indices, data sits in large data structures that are traversed by the Ontology query engine. When a query is executed, the engine can avoid processing large swaths of data during its search by traversing the index. This process is known as "pruning".
Using this engine, you can search through billions of records by evaluating up to 1000x fewer records. Each physical evaluation of a record is called a "hit". Object Storage V1 is designed to minimize the number of hits in each query.
Object Storage V2 (OSv2) stores objects in an enhanced indexing format that is optimized by Palantir for high-speed indexing, Search Arounds, and writeback, as well as smooth hand-offs to multiple compute backends to accomplish complex tasks. This includes a combination of fully parallelized Spark compute as a part of a query.
Given that Object Storage V2 also uses an efficient indexing structure, the same principle of hits from Object Storage V1 applies on basic queries. However, compute-seconds can also be used by on-demand Spark containers that are spun up as a part of the query.
Queries made to objects in the Object Storage V2 backend use compute in the following pattern:
16
compute-seconds per query for objects in the Object Storage V1 backend.4
compute-seconds per query for objects in the Object Storage V2 backend. The optimized structure of Object Storage V2 requires less overhead than Object Storage V1 and therefore has a reduced fixed compute-second overhead.18
. Actions also scale with the number of objects that are edited in the write-back request, incurring an additional 1
compute-second per object instance edited beyond the first.4
compute-seconds.The following table summarizes the minimum compute-second usage per query type.
Query Type | minimum compute-seconds |
---|---|
Ontology V1 Query | 16 |
Ontology V2 Query | 4 |
Action on Objects | 18 |
Function on Objects | 4 |
In Foundry, compute-seconds are attributed to resources in the platform rather than to the users that are interacting with those resources.
When it comes to Ontology queries, there are multiple ways in which compute is attributed. As a general rule, the compute is attached to the resource where the query originated. However, when there is no saved resource that is used to generate the compute (such as via API), the compute will be attached to the object type(s) that are being queried. If multiple objects are queried in a single request, then the compute is attributed via an even split between the objects.
The following resource types have Ontology query compute attributed to them, rather than the underlying objects:
The following interaction patterns have their Ontology query compute attached directly to the object types that they query, given there is no set resource to which the compute can be attached.