-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Summary
This RFC proposes adding support for Symfony's new JsonStreamer component as an alternative serialization strategy in Elastically. The JsonStreamer component, introduced in Symfony 7.3, provides significantly faster JSON encoding compared to the traditional Serializer component, which is pretty useful when dealing with large volumes of documents during bulk indexation operations.
Pros:
Serialization is significantly faster with JsonStreamer (up to 10x faster on a real life project)
Cons:
- Component is exprimental, so no BC promise
- Add a bit more complexity as component need to decide which Serializer to use
Proposed Solution
Design Principles
- Backward compatible: Existing code continues to work without changes
- Opt-in: Users explicitly enable JsonStreamer with attribute
- Coexistence: Both Serializer and JsonStreamer can be used simultaneously for different indexes
- Simple migration path: Minimal changes required to adopt JsonStreamer
Implementation Overview
The easiest way would be to check for #[JsonStreamable] attribute (and cache supports per class) and use JsonStreamer when present, or regular serializer otherwise.
ππ» or ππ» ?
damienalexandre and jonnyeom
Metadata
Metadata
Assignees
Labels
No labels