AvroConvert 3.4.17
AvroConvert
Rapid Avro serializer for C# .NET
Docs
Apache Avro format documentation
First steps with Avro in the .NET
Benefits
Avro format combines readability of JSON and data compression of binary serialization.
| AvroConvert | Apache.Avro | Newtonsoft.Json | |
|---|---|---|---|
| Rapid serialization | ✔️ | ✔️ | ✔️ |
| Low memory allocation | ✔️ | ✔️ | ✔️ |
| Readable schema of data structure | ✔️ | ✔️ | ✔️ |
| Support for C# native objects (Dictionary, List, DateTime...) | ✔️ | ❌ | ✔️ |
| Built-in data encryption | ✔️ | ✔️ | ❌ |
| Support for compression codecs | Deflate Snappy GZip Brotli |
Deflate | ❌ |
Introducing Avro to the projects brings three main benefits:
- Reduction of data size and storage cost
- Decrease of the communication time and the network traffic between microservices
- Increased security - the data is not visible in plain text format
Article describing Avro format specification and Avro API idea: https://www.c-sharpcorner.com/blogs/avro-rest-api-as-the-evolution-of-json-based-communication-between-mic
Conclusion:
Using Avro for communication between your services significantly reduces data size and network traffic. Additionally choosing encoding (compression algorithm) can improve the results even further.
Features
- Serialization
byte[] avroObject = AvroConvert.Serialize(object yourObject);
- Deserialization
CustomClass deserializedObject = AvroConvert.Deserialize<CustomClass>(byte[] avroObject);
- Read schema from Avro object
string schemaInJsonFormat = AvroConvert.GetSchema(byte[] avroObject)
- Deserialization of large collection of Avro objects one by one
using (var reader = AvroConvert.OpenDeserializer<CustomClass>(new MemoryStream(avroObject)))
{
while (reader.HasNext())
{
var item = reader.ReadNext();
// process item
}
}
- Generation of C# models from Avro file or schema
string resultModel = AvroConvert.GenerateModel(avroObject);
- Conversion of Avro to JSON directly
var resultJson = AvroConvert.Avro2Json(avroObject);
Extended list:
- Serialization of .NET object to Avro format
- Deserialization of Avro data to .NET object
- Other Avro data related operations
- Schema related
License
AvroConvert is licensed under the CC BY-NC-SA 3.0 license.
For commercial use, please purchase a license.
Contribution
We want to improve AvroConvert as much as possible. If you have any idea, found next possible feature, optimization opportunity or better way for integration, leave a comment or pull request.
Thank you a million to all the contributors to the library, including those that raise issues, started conversations, and those who send pull requests. Thank you!
These amazing people have contributed to AvroConvert:
Related Work
No packages depend on AvroConvert.
.NET 6.0
- BrotliSharpLib (>= 0.3.3)
- IronSnappy (>= 1.3.1)
- Newtonsoft.Json (>= 13.0.4)
.NET Standard 2.0
- BrotliSharpLib (>= 0.3.3)
- IronSnappy (>= 1.3.1)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.4)
- Portable.System.DateTimeOnly (>= 6.0.3)
| Version | Downloads | Last updated |
|---|---|---|
| 3.4.17 | 2 | 07/16/2026 |
| 3.4.16 | 2 | 07/16/2026 |
| 3.4.15 | 2 | 07/16/2026 |
| 3.4.14 | 2 | 07/16/2026 |
| 3.4.12 | 2 | 07/16/2026 |
| 3.4.11 | 2 | 07/16/2026 |
| 3.4.10 | 2 | 07/16/2026 |
| 3.4.9 | 2 | 07/16/2026 |
| 3.4.8 | 1 | 07/16/2026 |
| 3.4.7 | 2 | 07/16/2026 |
| 3.4.6 | 2 | 07/16/2026 |
| 3.4.5 | 2 | 07/16/2026 |
| 3.4.4 | 2 | 07/16/2026 |
| 3.4.3 | 2 | 07/16/2026 |
| 3.4.2 | 2 | 07/16/2026 |
| 3.4.1 | 2 | 07/16/2026 |
| 3.4.0 | 2 | 07/16/2026 |
| 3.3.7 | 2 | 07/16/2026 |
| 3.3.6 | 2 | 07/16/2026 |
| 3.3.5 | 2 | 07/16/2026 |
| 3.3.4 | 2 | 07/16/2026 |
| 3.3.3 | 2 | 07/16/2026 |
| 3.3.2 | 2 | 07/16/2026 |
| 3.3.1 | 2 | 07/16/2026 |
| 3.3.0 | 2 | 07/16/2026 |
| 3.2.9 | 2 | 07/16/2026 |
| 3.2.8 | 2 | 07/16/2026 |
| 3.2.7 | 2 | 07/16/2026 |
| 3.2.6 | 2 | 07/16/2026 |
| 3.2.5 | 2 | 07/16/2026 |
| 3.2.4 | 2 | 07/16/2026 |
| 3.2.3 | 2 | 07/16/2026 |
| 3.2.2 | 2 | 07/16/2026 |
| 3.2.1 | 2 | 07/16/2026 |
| 3.2.0 | 1 | 07/16/2026 |
| 3.1.5 | 2 | 07/16/2026 |
| 3.1.4 | 2 | 07/16/2026 |
| 3.1.3 | 2 | 07/16/2026 |
| 3.1.2 | 2 | 07/16/2026 |
| 3.1.1 | 2 | 07/16/2026 |
| 3.1.0 | 2 | 07/16/2026 |
| 3.0.1 | 2 | 07/16/2026 |
| 3.0.0 | 2 | 07/16/2026 |
| 2.7.1 | 2 | 07/16/2026 |
| 2.7.0 | 1 | 07/16/2026 |
| 2.6.3 | 1 | 07/16/2026 |
| 2.6.2 | 2 | 07/16/2026 |
| 2.6.1 | 2 | 07/16/2026 |
| 2.6.0 | 2 | 07/16/2026 |
| 2.5.1 | 2 | 07/16/2026 |
| 2.5.0 | 2 | 07/16/2026 |
| 2.4.1 | 2 | 07/16/2026 |
| 2.4.0 | 2 | 07/16/2026 |
| 2.3.0 | 2 | 07/16/2026 |
| 2.2.2 | 2 | 07/16/2026 |
| 2.2.1 | 2 | 07/16/2026 |
| 2.2.0 | 2 | 07/16/2026 |
| 2.1.0 | 2 | 07/16/2026 |
| 2.0.0 | 2 | 07/16/2026 |
| 1.8.1 | 2 | 07/16/2026 |
| 1.8.0 | 2 | 07/16/2026 |
| 1.7.0 | 2 | 07/16/2026 |
| 1.6.0 | 2 | 07/16/2026 |
| 1.5.1 | 2 | 07/16/2026 |
| 1.5.0 | 2 | 07/16/2026 |
| 1.4.0 | 2 | 07/16/2026 |
| 1.3.0 | 2 | 07/16/2026 |
| 1.2.0 | 2 | 07/16/2026 |
| 1.1.0 | 2 | 07/16/2026 |
| 1.0.1 | 2 | 07/16/2026 |
| 1.0.0 | 2 | 07/16/2026 |
| 0.8.0 | 2 | 07/16/2026 |
| 0.7.0 | 2 | 07/16/2026 |
| 0.6.3 | 2 | 07/16/2026 |
| 0.6.2 | 2 | 07/16/2026 |
| 0.6.1 | 2 | 07/16/2026 |
| 0.6.0 | 2 | 07/16/2026 |
| 0.5.0 | 2 | 07/16/2026 |
| 0.3.0 | 2 | 07/16/2026 |
| 0.2.1 | 2 | 07/16/2026 |
| 0.2.0 | 2 | 07/16/2026 |
| 0.1.0 | 2 | 07/16/2026 |