Improved

Sentio SDK 3.0 released


SDK 3.0 is a major release that offers major new features, improvement and performance boosts.

Unified Data Types for Metrics

Metric, event and entity are now under the same data storage (we previous use PromQL), that means:

  • Feature: Metrics now also support raw SQL query which provides user maximum flexibility for complex queries.

  • Improvement: Metrics aggregation query with avg_over_time and rollup_sum is now much faster.

  • Breaking:

    • All metadata fields have the same naming convention, they are now all under meta prefix, e.g.
      • Entity: _genBlock_number is now meta.block_number
      • Event, metrics: block_number is now meta.block_number
    • Cohort doesn't allow use "All Event" filter
    • There is no builtin event_name field in event data structure

Enhanced Entity and SQL Features

  • Feature: SQL based alerts is added, providing flexible way of define your alerts.

  • Feature: flexible aggregation on Entities , e.g. the following code will generate extra AggA entity every hour with aggB field that is max value of propA+propB during the hour, while you just need to emit EntityH. This feature could support intensive workload that is slow to do computation during query time

type EntityH @entity(timeseries: true) {
    id: Int8!
    timestamp: Timestamp!
    propA: BigDecimal!
    propB: BigDecimal!
}

type AggA @aggregation(intervals: ["hour"], source: "EntityH") {
    id: Int8!
    timestamp: Timestamp!
    aggB: BigDecimal! @aggregate(fn: "max", arg: "propA+propB")
}

Indexing Rollback

There are cases where previously mis-handled data leads to dirty or inconsistent results (for example, a bug that was triggered only during a certain time window).

Starting from SDK 3.x, you can now view the full list of checkpoints maintained by the Sentio Processor and instruct the processor to roll back to an earlier state. After the rollback, the processor will enter a paused state, allowing you to use Hotswap to fix the indexing logic before resuming execution.

Performance Boost

SDK 3.0 improve the performance by adopt streaming mode in all stages, which

  • Indexing speed improved 20% to 400% (we'll share benchmark in the future)
  • Significant reduce memory usage and prevent unintended OOM during heavy workload
  • Huge improvements in case that many templates (factory) are involved.

Get Started

To begin using SDK 3.0 and benefits from all the new features and improvements, upload new processor with the following new dependencies

  "dependencies": {
    "@sentio/sdk": "^3.0.0"
  },
  "devDependencies": {
    "@sentio/cli": "^3.0.0"
  }