You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2026/02/04 14:46:26 UTC
(fory-site) branch main updated (4c6d53e1f2 -> 49151d87a7)
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
from 4c6d53e1f2 🔄 synced local 'docs/specification/' with remote 'docs/specification/'
new 3152272459 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
new 49151d87a7 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/compiler/schema-idl.md | 31 +++++++++++++++++--------------
docs/guide/cpp/schema-evolution.md | 12 ++++++++++++
docs/guide/go/schema-evolution.md | 14 ++++++++++++++
docs/guide/java/schema-evolution.md | 14 ++++++++++++++
docs/guide/python/schema-evolution.md | 21 +++++++++++++++++++++
docs/guide/rust/schema-evolution.md | 14 ++++++++++++++
6 files changed, 92 insertions(+), 14 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
(fory-site) 01/02: 🔄 synced local 'docs/guide/' with remote 'docs/guide/'
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit 315227245958db77fd877c406bdcf8f3e4cf8a1c
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Wed Feb 4 14:46:22 2026 +0000
🔄 synced local 'docs/guide/' with remote 'docs/guide/'
---
docs/guide/cpp/schema-evolution.md | 12 ++++++++++++
docs/guide/go/schema-evolution.md | 14 ++++++++++++++
docs/guide/java/schema-evolution.md | 14 ++++++++++++++
docs/guide/python/schema-evolution.md | 21 +++++++++++++++++++++
docs/guide/rust/schema-evolution.md | 14 ++++++++++++++
5 files changed, 75 insertions(+)
diff --git a/docs/guide/cpp/schema-evolution.md b/docs/guide/cpp/schema-evolution.md
index 89b57ff704..84cf354b95 100644
--- a/docs/guide/cpp/schema-evolution.md
+++ b/docs/guide/cpp/schema-evolution.md
@@ -76,6 +76,18 @@ int main() {
}
```
+### Disable Evolution for Stable Structs
+
+If a struct schema is stable and will not change, you can disable evolution for that struct to avoid compatible metadata overhead. Use `FORY_STRUCT_EVOLVING` after `FORY_STRUCT`:
+
+```cpp
+struct StableMessage {
+ int32_t id;
+};
+FORY_STRUCT(StableMessage, id);
+FORY_STRUCT_EVOLVING(StableMessage, false);
+```
+
## Schema Evolution Features
Compatible mode supports the following schema changes:
diff --git a/docs/guide/go/schema-evolution.md b/docs/guide/go/schema-evolution.md
index d84d4848cc..eea486e005 100644
--- a/docs/guide/go/schema-evolution.md
+++ b/docs/guide/go/schema-evolution.md
@@ -43,6 +43,20 @@ f := fory.New(fory.WithCompatible(true))
- Supports adding, removing, and reordering fields
- Enables forward and backward compatibility
+### Disable Evolution for Stable Structs
+
+If a struct schema is stable and will not change, you can disable evolution for that struct to avoid compatible metadata overhead. Implement the `ForyEvolving` interface and return `false`:
+
+```go
+type StableMessage struct {
+ ID int64
+}
+
+func (StableMessage) ForyEvolving() bool {
+ return false
+}
+```
+
## Supported Schema Changes
### Adding Fields
diff --git a/docs/guide/java/schema-evolution.md b/docs/guide/java/schema-evolution.md
index c2be9b1692..c7db189658 100644
--- a/docs/guide/java/schema-evolution.md
+++ b/docs/guide/java/schema-evolution.md
@@ -46,6 +46,20 @@ System.out.println(fory.deserialize(bytes));
This compatible mode involves serializing class metadata into the serialized output. Despite Fory's use of sophisticated compression techniques to minimize overhead, there is still some additional space cost associated with class metadata.
+### Disable Evolution for Stable Classes
+
+If a class schema is stable and will not change, you can opt out of schema evolution on a per-class basis to avoid compatible metadata overhead. Annotate the class with `@ForyObject(evolving = false)` to force `STRUCT/NAMED_STRUCT` type IDs even when Compatible mode is enabled.
+
+```java
+import org.apache.fory.annotation.ForyObject;
+
+@ForyObject(evolving = false)
+public class StableMessage {
+ public int id;
+ public String name;
+}
+```
+
## Meta Sharing
To further reduce metadata costs, Fory introduces a class metadata sharing mechanism, which allows the metadata to be sent to the deserialization process only once.
diff --git a/docs/guide/python/schema-evolution.md b/docs/guide/python/schema-evolution.md
index 6990c392c9..bfd0a7482a 100644
--- a/docs/guide/python/schema-evolution.md
+++ b/docs/guide/python/schema-evolution.md
@@ -29,6 +29,27 @@ import pyfory
f = pyfory.Fory(xlang=True, compatible=True)
```
+## Disable Evolution for Stable Classes
+
+If a dataclass schema is stable and will not change, you can disable evolution for that class to avoid compatible metadata overhead. Use `pyfory.dataclass` with `evolving=False`:
+
+```python
+import pyfory
+
+@pyfory.dataclass(evolving=False)
+class StableMessage:
+ id: int
+ name: str
+```
+
+`pyfory.dataclass` also supports `slots=True`:
+
+```python
+@pyfory.dataclass(slots=True)
+class SlotMessage:
+ id: int
+```
+
## Schema Evolution Example
```python
diff --git a/docs/guide/rust/schema-evolution.md b/docs/guide/rust/schema-evolution.md
index 54f911461d..07d175eff5 100644
--- a/docs/guide/rust/schema-evolution.md
+++ b/docs/guide/rust/schema-evolution.md
@@ -69,6 +69,20 @@ assert_eq!(person_v2.age, 30);
assert_eq!(person_v2.phone, None);
```
+### Disable Evolution for Stable Structs
+
+If a struct schema is stable and will not change, you can disable evolution for that struct to avoid compatible metadata overhead. Use `#[fory(evolving = false)]`:
+
+```rust
+use fory::ForyObject;
+
+#[derive(ForyObject)]
+#[fory(evolving = false)]
+struct StableMessage {
+ id: i32,
+}
+```
+
## Schema Evolution Features
- Add new fields with default values
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
(fory-site) 02/02: 🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit 49151d87a70b33914971f6d4f715f7d72987ad5f
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Wed Feb 4 14:46:22 2026 +0000
🔄 synced local 'docs/compiler/' with remote 'docs/compiler/'
---
docs/compiler/schema-idl.md | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/docs/compiler/schema-idl.md b/docs/compiler/schema-idl.md
index 96c0267166..9eace213f5 100644
--- a/docs/compiler/schema-idl.md
+++ b/docs/compiler/schema-idl.md
@@ -1374,14 +1374,16 @@ FDL supports protobuf-style extension options for Fory-specific configuration. T
option (fory).use_record_for_java_message = true;
option (fory).polymorphism = true;
option (fory).enable_auto_type_id = true;
+option (fory).evolving = true;
```
-| Option | Type | Description |
-| ----------------------------- | ------ | ------------------------------------------------------------ |
-| `use_record_for_java_message` | bool | Generate Java records instead of classes |
-| `polymorphism` | bool | Enable polymorphism for all types |
-| `enable_auto_type_id` | bool | Auto-generate numeric type IDs when omitted (default: true) |
-| `go_nested_type_style` | string | Go nested type naming: `underscore` (default) or `camelcase` |
+| Option | Type | Description |
+| ----------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
+| `use_record_for_java_message` | bool | Generate Java records instead of classes |
+| `polymorphism` | bool | Enable polymorphism for all types |
+| `enable_auto_type_id` | bool | Auto-generate numeric type IDs when omitted (default: true) |
+| `evolving` | bool | Default schema evolution for messages in this file (default: true). Set false to reduce payload size for messages that never change |
+| `go_nested_type_style` | string | Go nested type naming: `underscore` (default) or `camelcase` |
### Message-Level Fory Options
@@ -1396,14 +1398,14 @@ message MyMessage {
}
```
-| Option | Type | Description |
-| --------------------- | ------ | ------------------------------------------------------------------------------------ |
-| `id` | int | Type ID for serialization (auto-generated if omitted and enable_auto_type_id = true) |
-| `alias` | string | Alternate name used as hash source for auto-generated IDs |
-| `evolving` | bool | Schema evolution support (default: true). When false, schema is fixed like a struct |
-| `use_record_for_java` | bool | Generate Java record for this message |
-| `deprecated` | bool | Mark this message as deprecated |
-| `namespace` | string | Custom namespace for type registration |
+| Option | Type | Description |
+| --------------------- | ------ | ------------------------------------------------------------------------------------------------------------------ |
+| `id` | int | Type ID for serialization (auto-generated if omitted and enable_auto_type_id = true) |
+| `alias` | string | Alternate name used as hash source for auto-generated IDs |
+| `evolving` | bool | Schema evolution support (default: true). When false, schema is fixed like a struct and avoids compatible metadata |
+| `use_record_for_java` | bool | Generate Java record for this message |
+| `deprecated` | bool | Mark this message as deprecated |
+| `namespace` | string | Custom namespace for type registration |
**Note:** `option (fory).id = 100` is equivalent to the inline syntax `message MyMessage [id=100]`.
@@ -1502,6 +1504,7 @@ message ForyFileOptions {
optional bool use_record_for_java_message = 1;
optional bool polymorphism = 2;
optional bool enable_auto_type_id = 3;
+ optional bool evolving = 4;
}
// Message-level options
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org