Skip to main content
Powering a Fast
Feature Store with
ScyllaDB
Guilherme Nogueira, Technical Director, ScyllaDB
Tim Koopmans, Senior Director, ScyllaDB
Guilherme Nogueira, Technical Director at ScyllaDB
+ Previously Solutions Architect
+ Publishing
+ Streaming
+ Automotive
+ Helping users be successful at scale
Tim Koopmans, Senior Director at ScyllaDB
+ Fought latency and (sometimes) won
+ Trained ML models a gazillion times and still can't get it right
+ Built my very own Bloomberg terminal
Introductions
2
3
Agenda
+ What is ScyllaDB?
+ Why ScyllaDB as a feature store?
+ A real world application
+ How we build a real time AI pipeline
+ Satisfy high write throughput
+ Maintain low-latency retrieval of features
+ Optimized for maximum performance
Question: What is the main database for your AI workloads?
● ScyllaDB Enterprise/Cloud
● Cassandra
● DynamoDB
● MongoDB
● ScyllaDB Open Source (!)
● Others (let us know in the chat!)
Poll time
What is ScyllaDB?
5
6
High performance NoSQL database
Why ScyllaDB?
7
Powering India's top
social media platform
Video recommendation
management
Real-time fraud
detection
Seamless experiences
across content + devices
Network security
threat detection
Content personalization &
recommendation platform
Mobile Growth &
Monetization Platform
Inventory hub for
retail operations
Property listings
and updates
Cryptocurrency
exchange app
Real-time auctions
advertising platform
Predictable performance
for on sale surges
Online gaming ad
targeting
Media streaming
for 45M+ subscribers
Bridging AI to IT Service
Management
Real-time ML-driven
recommendations
Real-time endpoint threat
detection and security
Real-time personalized
recommendations
World leading beauty
platform behind Avon
Real-time AI decisioning
for digital advertisers
AI-centric customer
research platform
Powering Unreal Engine
real-time asset distribution
Real-time interactions
at massive scale
Always-on e-commerce
platform for millions of fans
8
Our customers love us
9
+ Shard-per-Core
Designed for modern architecture
10
+ Shard-per-Core
+ Userspace Schedulers
Designed for modern architecture
11
+ Shard-per-Core
+ Userspace Schedulers
+ Internal Caching
Designed for modern architecture
12
+ Shard-per-Core
+ Userspace Schedulers
+ Internal Caching
+ Tablets
Designed for modern architecture
13
+ Shard-per-Core
+ Userspace Schedulers
+ Internal Caching
+ Tablets
+ Workload Prioritization
Designed for modern architecture
Real World
Application
14
15
High level requirements
+ Hyperliquid Non Validator Node
+ Every trade fill on a DeFi Exchange
+ ~5M fills/day, 60-1000 fills/s
+ ~100GB/day
+ ScyllaDB Feature Store
+ Per Coin/Wallet features
+ ~100k writes/sec
+ Single digit p99 latency
+ Bursty
+ Spikes like flash sales, promotions, viral events, news and fraud all contribute
to the bursty 24x7 workload
+ Skewed
+ Popular tokens like BTC, HYPE, ETH will dominate; long tails will barely trade
and we’ll end up with hot partitions
+ Cardinality
+ Millions of wallets x hundreds of coins
Nature of the workload
16
Running it live
17
https://github.com/timkoopmans/scylla-fast-feature-store
Tuning the pipeline
18
‘Fills’
19
field example description
addr 0xd32b206275… Wallet address that traded
coin PURR/USD Market (spot pair or perp)
px 0.03443 Execution price
sz 365.3 Size of order in coin
units
side B / A Bid or ask side of order
time 1763942399997 Epoch timestamp
dir Buy / Sell Trade direction
closedPnL -0.073452 Realized PnL closed
fee 0.2349851 Fees and commissions
startPosition 117000.76 Position size before fill
block 806397895 L1 block number
crossed true Taker or maker
‘Raw Fills’
20
CREATE TABLE IF NOT EXISTS fills_by_coin_bucket (
coin text,
time_bucket timestamp, -- floor(ts / COIN_BUCKET_SECONDS)
ts timestamp,
addr text,
px double,
sz double,
side text,
crossed boolean,
closed_pnl double,
PRIMARY KEY ((coin, time_bucket), ts, addr)
) WITH CLUSTERING ORDER BY (ts DESC)
AND default_time_to_live = 86400 -- 1 day
AND compaction = {
'class': 'TimeWindowCompactionStrategy',
'compaction_window_unit': 'HOURS',
'compaction_window_size': 1
};
‘Coin Window Features’
21
CREATE TABLE IF NOT EXISTS coin_window_features (
coin text,
window text, -- '1m' | '5m' | '1h'
bucket_ts timestamp, -- start of the tumbling bucket
volume double, -- notional traded in bucket
taker_buy double, -- taker (crossed) buy notional
taker_sell double, -- taker (crossed) sell notional
buy_sell_imbalance double, -- (taker_buy - taker_sell)/(taker_buy + taker_sell)
active_wallets int,
hhi double, -- Herfindahl index of net-position concentration
large_flow double, -- net signed notional from large wallets
smart_flow double, -- net notional weighted by wallet smartness (signal)
PRIMARY KEY ((coin, window), bucket_ts)
) WITH CLUSTERING ORDER BY (bucket_ts DESC)
AND default_time_to_live = 172800 -- 2 days
AND compaction = {
'class': 'TimeWindowCompactionStrategy',
'compaction_window_unit': 'HOURS',
'compaction_window_size': 1
};
‘Wallet Features’
22
CREATE TABLE IF NOT EXISTS wallet_features (
addr text PRIMARY KEY,
cum_realized_pnl double,
total_fills bigint,
gross_volume double, -- sum |sz*px|
net_volume double, -- |sum signed sz*px| (directionality)
churn double, -- closes / (opens+closes)
archetype text, -- 'market-maker' | 'directional' | 'mixed'
last_ts timestamp
) WITH compaction = {'class': 'IncrementalCompactionStrategy'};
‘Wallet Coin Features’
23
CREATE TABLE IF NOT EXISTS wallet_coin_features (
addr text,
coin text,
net_pos double, -- signed net position (size units)
avg_entry double, -- size-weighted entry price of the open position
realized_pnl double, -- cumulative realized PnL on this (wallet,coin)
fill_count bigint,
last_ts timestamp, -- last fill seen (freshness probe)
PRIMARY KEY ((addr), coin)
) WITH compaction = {'class': 'IncrementalCompactionStrategy'};
‘Coin Features’
24
CREATE TABLE IF NOT EXISTS coin_counters (
coin text,
window text,
bucket_ts timestamp,
fills counter,
PRIMARY KEY ((coin, window), bucket_ts)
) WITH CLUSTERING ORDER BY (bucket_ts DESC);
Driver considerations
25
+ Blind upsert
+ Prepared statements
+ Session.execute_async()
+ Shard-aware
+ LOCAL_ONE
+ Windowed snapshots (flush on bucket close)
+ Wallet features coalesced
High write ingestion
26
Scaling the pipeline
27
+ 100K ops/sec on a 3 node cluster
+ < 3ms p99 read latency
+ < 2ms feature freshness
+ ScyllaDB headroom throughout bursty workloads
Requirements easily met
28
Question: What is the biggest challenge with your AI applications?
● Functionality e.g. Vector Search
● Latency
● Throughput
● Storage
● Cost
One last poll
Thank you
for joining us today.
@scylladb scylladb/
slack.scylladb.com
@scylladb company/scylladb/
scylladb/