Replies: 2 comments 1 reply
-
|
+1 - sounds like a plan. Especially for IDocs and XML transfers quite needed, with that KafScale becomes an Object streaming for business transactions! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Some workload don't need strong cryptographic verification and may want a faster/simpler hashing || corruption detection. S3 supports Content-MD5 HTTP Header. Consider making it an option either crc32, MD5 or sha256 header |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
LFS (Large File Support) Design
Summary
KafScale will support per-topic Large File Support (LFS) by storing large payloads in S3 and writing a small pointer record to Kafka. Classic Kafka consumers will receive the pointer record; KafScale LFS SDKs can resolve the pointer to stream the object directly from S3. Uploads are owned by clients using pre-signed S3 URLs or multipart uploads.
This design avoids streaming huge payloads through the Kafka protocol and broker memory, keeps Kafka compatibility, and enables a gradual migration path for clients.
Goals
Non-goals (initial)
Background: Why LFS
The current broker path reads full Kafka frames into memory and buffers record batches before S3 upload. Large message values can cause high memory pressure and slow the broker. LFS avoids this by moving payload bytes directly to S3 and keeping Kafka records small.
Today, large Kafka produce requests are not streamed end-to-end:
[]byte.So while KafScale may accept large messages, they are currently buffered in RAM multiple times. LFS is intended to remove this buffering for large payloads by moving the bytes off the Kafka path.
High-Level Flow
Topic Configuration
LFS is enabled per topic (admin-configurable):
kafscale.lfs.enabled(bool, default false)kafscale.lfs.min_bytes(int, default 8MB)If a producer uses the LFS SDK and payload exceeds this threshold, upload to S3 and emit a pointer record.
kafscale.lfs.bucket(string, optional override; defaults to cluster S3 bucket)kafscale.lfs.prefix(string, optional key prefix override)kafscale.lfs.require_sdk(bool, default false)If true, reject oversized produce requests without valid LFS pointer.
Note: These configs are intended for the admin API. They may map to internal metadata stored in etcd.
Pointer Record Schema (v1)
Pointer records are normal Kafka records (value bytes) with a small JSON or binary payload. We propose a versioned, compact JSON for readability and tooling:
{ "kfs_lfs": 1, "bucket": "kafscale-data", "key": "namespace/topic/lfs/2026/01/28/obj-<uuid>", "size": 262144000, "sha256": "<hex>", "content_type": "application/octet-stream", "created_at": "2026-01-28T12:34:56Z" }Schema notes:
kfs_lfsis the version discriminator.bucketandkeyare mandatory.sizeandsha256are mandatory for validation and partial reads.content_typeis optional.created_atis optional; if omitted, broker time is used for observability.Alternative: a binary schema can be introduced later for smaller pointer records once the JSON format is stable.
LFS SDK Behavior
Producer SDK:
kafscale.lfs.min_bytes, upload to S3 and emit pointer record.Consumer SDK:
kfs_lfsfield.S3 Object Layout
Default layout:
s3://{bucket}/{namespace}/{topic}/lfs/{yyyy}/{mm}/{dd}/{uuid}Rationale:
Upload Approach
Preferred: pre-signed S3 PUT or multipart upload.
API endpoints (broker or sidecar service):
POST /lfs/uploads-> returns upload session (presigned URL or multipart parts)POST /lfs/uploads/{id}/complete-> validates and returns final object keyThe upload service should not store object bytes. It only brokers credentials and writes metadata if needed.
Validation and Safety
Broker-side (optional, recommended for
kafscale.lfs.require_sdk=true):Client-side:
Failure Modes
Observability
Metrics (broker or upload service):
kafscale_lfs_upload_requests_totalkafscale_lfs_upload_bytes_totalkafscale_lfs_pointer_records_totalkafscale_lfs_validation_errors_totalkafscale_lfs_head_latency_msLogging:
Security
Compatibility and Migration
Test Plan
Validation should cover SDK behavior, broker validation, and end-to-end flows.
Unit Tests (SDK)
Broker Validation Tests
kafscale.lfs.enabled=true.kafscale.lfs.require_sdk=trueand a large raw payload is produced.Integration / E2E Tests (MinIO)
Performance / Load Tests
Open Questions
Next Steps (post-review)
Beta Was this translation helpful? Give feedback.
All reactions