Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Avro Serde Php

Avro Serde Php Laravel Package

flix-tech/avro-serde-php

PHP library for serializing/deserializing Apache Avro with Schema Registry support. Built for Kafka-style messaging, it handles Avro binary encoding, schema resolution, and compatibility, providing a straightforward SerDe layer you can use in your own producers/consumers.

View on GitHub
Deep Wiki
Context7

Avro Serialisation/Deserialisation (SerDe) library for PHP 8.1+ with a Symfony Serializer integration

Frequently asked questions about Avro Serde Php
How do I install flix-tech/avro-serde-php in a Laravel project?
Use Composer to install the package with `composer require flix-tech/avro-serde-php`. Ensure your project uses PHP 8.1+ and has the `ext-json` and `ext-simplexml` extensions enabled. If using Symfony’s Serializer, verify version compatibility (6.3+).
Does this package support schema evolution for Avro?
Yes, the package is designed for schema evolution. It handles backward and forward compatibility by validating data against schemas, allowing producers and consumers to evolve independently as long as compatibility rules are followed.
Can I use this package without Symfony’s Serializer?
Yes, the package includes a standalone `AvroSerializer` that doesn’t require Symfony. However, if you’re already using Symfony’s Serializer, the integration is seamless and reduces boilerplate.
What Laravel versions does flix-tech/avro-serde-php support?
The package itself doesn’t enforce Laravel version constraints, but it requires PHP 8.1+. Ensure your Laravel version (8.x, 9.x, or 10.x) is compatible with its dependencies, particularly Symfony’s Serializer if used.
How do I handle Avro schemas in production? Should I embed them or use a registry?
You can embed schemas directly in messages or reference them externally via a schema registry (e.g., Confluent Schema Registry). Embedding is simpler for small-scale systems, while a registry is better for large-scale, distributed environments with schema evolution needs.
Is Avro serialization faster than JSON for large payloads in Laravel?
Yes, Avro’s binary format is significantly more efficient than JSON for large or nested payloads. Benchmark your specific use case, but expect reduced payload sizes and faster parsing, especially in high-throughput systems like Kafka pipelines.
How do I debug Avro binary data in logs or monitoring tools?
Binary Avro data isn’t human-readable, so use tools like `avro-tools` CLI or custom decoders to inspect payloads. For logs, consider hex dumps or converting to JSON for debugging. Ensure your monitoring stack supports Avro inspection.
What happens if a message fails Avro schema validation?
The package throws exceptions on validation failures. Plan for graceful degradation, such as falling back to JSON serialization or implementing retry logic for malformed messages in event-driven systems.
Are there alternatives to this package for Avro in PHP?
Alternatives include `ruflin/elastica` (for Elasticsearch Avro) or custom implementations using `avro-php` libraries. However, `flix-tech/avro-serde-php` is optimized for Laravel/Symfony integration and schema evolution, making it a strong choice for messaging stacks.
How do I test Avro serialization/deserialization in Laravel?
Write unit tests using PHPUnit to verify serialization/deserialization cycles. Mock schema validation scenarios and test edge cases like nested data, null values, and schema evolution. Use tools like `avro-tools` to validate generated payloads.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky