PHPackages                             real-digital/avro-serde-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. real-digital/avro-serde-php

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

real-digital/avro-serde-php
===========================

A library to serialize and deserialize Avro records making use of the confluent schema registry

1.7.3(5y ago)119.5kMITPHPPHP ^7.3|^8.0

Since Nov 4Pushed 5y agoCompare

[ Source](https://github.com/real-digital/avro-serde-php)[ Packagist](https://packagist.org/packages/real-digital/avro-serde-php)[ RSS](/packages/real-digital-avro-serde-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (27)Used By (0)

Avro SerDe for PHP 7.3+ and 8.0
===============================

[](#avro-serde-for-php-73-and-80)

This is a fork of flix-tech/avro-serde-php

[![php-confluent-serde Actions Status](https://github.com/flix-tech/avro-serde-php/workflows/php-confluent-serde/badge.svg?branch=master)](https://github.com/flix-tech/avro-serde-php/actions)[![Maintainability](https://camo.githubusercontent.com/71a89ec4b08fca6f34d2dab56fcfa2c81919429f03b371d49bdafe6b124396a7/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37353030343730613638313263663561316164352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/flix-tech/avro-serde-php/maintainability)[![Test Coverage](https://camo.githubusercontent.com/ac54802f92019b8ed087804e94542b6d3c427bd3d3076fe46ac204f0c1205d4e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37353030343730613638313263663561316164352f746573745f636f766572616765)](https://codeclimate.com/github/flix-tech/avro-serde-php/test_coverage)[![Latest Stable Version](https://camo.githubusercontent.com/bdc15cb8529747356f5d95a58e71e50947de67167f049b5883d0e3da0612667e/68747470733a2f2f706f7365722e707567782e6f72672f666c69782d746563682f6176726f2d73657264652d7068702f76657273696f6e)](https://packagist.org/packages/flix-tech/avro-serde-php)[![Total Downloads](https://camo.githubusercontent.com/e1571c5aa99bd154085b48d11e151ad5be62529afb23ec916f038e87f958c996/68747470733a2f2f706f7365722e707567782e6f72672f666c69782d746563682f6176726f2d73657264652d7068702f646f776e6c6f616473)](https://packagist.org/packages/flix-tech/avro-serde-php)[![License](https://camo.githubusercontent.com/e0c98b17c5ad7f91b82d894c973a6aaa44a44908be38095b956565325ce0fc3a/68747470733a2f2f706f7365722e707567782e6f72672f666c69782d746563682f6176726f2d73657264652d7068702f6c6963656e7365)](https://packagist.org/packages/flix-tech/avro-serde-php)

Motivation
----------

[](#motivation)

When serializing and deserializing messages using the [Avro](http://avro.apache.org/docs/current/) serialization format, especially when integrating with the [Confluent Platform](https://docs.confluent.io/current/avro.html), you want to make sure that schemas are evolved in a way that downstream consumers are not affected.

Hence [Confluent](https://www.confluent.io/) developed the [Schema Registry](https://docs.confluent.io/current/schema-registry/docs/index.html) which has the responsibility to validate a given schema evolution against a configurable compatibility policy.

Unfortunately Confluent is not providing an official Avro SerDe package for PHP. This library aims to provide an Avro SerDe library for PHP that implements the [Confluent wire format](https://docs.confluent.io/current/schema-registry/docs/serializer-formatter.html#wire-format) and integrates FlixTech's [Schema Registry Client](https://github.com/flix-tech/schema-registry-php-client).

Installation
------------

[](#installation)

This library is using the [composer package manager](https://getcomposer.org/) for PHP.

```
composer require 'real-digital/avro-serde-php:^1.7'
```

Quickstart
----------

[](#quickstart)

> **NOTE**
>
> You should **always** use a cached schema registry client, since otherwise you'd make an HTTP request for every message serialized or deserialized.

### 1. Create a cached Schema Registry client

[](#1-create-a-cached-schema-registry-client)

See the [Schema Registry client documentation on caching](https://github.com/flix-tech/schema-registry-php-client#caching)for more detailed information.

```
