SlideShare a Scribd company logo
1 of 29
Download to read offline
Adding Avro to your Kafka
streams to meet your
messaging needs
https://github.com/skeletonkey/Avro
erik_tank
HELLO!
I am Erik Tank
Lead Engineer at Ticketmaster
You can find me at @erik_tank
erik_tank
I am Erik
HATEOAS
@erik_tank
Let’s Talk Schema
Schemata - Plural of schema
Schema
“representation of a plan or theory in the
form of an outline or model” (Oxford)
@erik_tank
Let’s Talk Schema
Pros
❑Contract
❏Clarity
❏Compatibility
❏Decoupling
@erik_tank
Let’s Talk Schema
Cons
❑No mechanism for evolution
❑No contract enforcement
Avro
Schem
a
Registry
@erik_tank
History of Avro
(Aircraft)
1956
Avro Vulcan B. 1
High-altitude strategic bomber
Operated by the Royal Air Force
(RAF) from 1956 until 1984
1963
Merged into Hawker
Siddeley Aviation
However, the Avro name has
been used for some aircraft
since then
1909
Roe I Triplane
First aircraft build by the Roes.
First flight on June 5th
1909
1910
Founded by Alliott &
Humphrey Verdon Roe
One of the world's first
aircraft builders.
@erik_tank
History of Avro (Aircraft)
2006
Hadoop
Search removed from Nutch and with
only the data processing/sharing parts
Hadoop is born.
2009
Apache Avro
A specification based design to
server the data exchange
needs to a world with multiple
*everything*.
2002
Nutch
Doug Cutting set out to
build an open source full
scale search engine
2003
Writable/SequenceFile
Improving the ability to
MapReduce and other
parallel data computations
@erik_tank
Avro
❑Language neutral serialization system
❑Rich data structure
❑Compact, fast, binary data format
❑Integration to dynamic languages
❑Code generation (Java)
❑RPC
❑Schema evolution
@erik_tank
Why Use
❑ Data compression
❑ Language support
❑ Schema evolution
❑ Flexibility
@erik_tank
Why Not
❑ Initial Lift
❑ Binary format
❑ Not turn key in every language
❑ Prototyping
❑ You’re afraid?
@erik_tank
Avro Workflow
Source: https://docs.confluent.io/current/schema-registry/index.html
@erik_tank
Avro Workflow
Source: https://docs.confluent.io/current/schema-registry/index.html (modified)
server client
@erik_tank
Short Kafka Detour
❑Topic contains messages
❑message is a key-value pair
❑subject – Schema Registry
topic_name-key
topic_name-value
@erik_tank
Picking a Topic Name
❑Avoid names that change over time
❑Settle on a template for your topics
❑ <message type>.<dataset name>.<data name>
❑Topic should reflect its purpose
Source: https://riccomini.name/how-paint-bike-shed-kafka-topic-naming-conventions
@erik_tank
Avro Compatibility
Source: https://docs.confluent.io/current/schema-registry/avro.html
@erik_tank
Avro Compatibility
Source: https://docs.confluent.io/current/schema-registry/avro.html
@erik_tank
Avro Compatibility
Source: https://docs.confluent.io/current/schema-registry/avro.html
@erik_tank
Avro Compatibility
Source: https://docs.confluent.io/current/schema-registry/avro.html
@erik_tank
Avro Compatibility
Source: https://docs.confluent.io/current/schema-registry/avro.html
@erik_tank
Best Practices (Do’s)
❑Default Value
❑Document!!!
❑Carefully consider topic name
❑Carefully consider changes to schema
❑Deal with Avro as a DB connection
@erik_tank
Best Practices (Dont’s)
❑Change the purpose of the topic
❑Change field types
❑Delete or Rename fields
@erik_tank
What’s in an extension?
❑.avsc – JSON schema file
❑.avdl – IDL file
❑.avpr – JSON protocol file
@erik_tank
.avsc{
"namespace": "com.jundy.client",
"name": "Rules",
"type": "record",
"fields": [
{
"name": ”channel",
"type": {
"type": "enum",
"name": "Channel",
"symbols": [ "INTERNET", "IVR", "PHONE" ],
"default": "INTERNET",
"doc": "Category that the client is allows to transact on"
}
},
{
"name": "Market",
"type": {
"type": "enum",
"name": "Market",
"symbols": [ "UNITEDSTATES", "AUSTRALIA", "CANADA", "GERMANY", "GREATBRITAIN", "IRELAND", "MEXICO", "NEWZEALAND", "NORTHIRELAND", "SPAIN" ],
"default": "UNITEDSTATES",
"doc": "Market which client is allowed to operate in"
}
},
{
"name": "feature_set",
"type": [ "null", "string" ],
"default": null,
"doc": "The human readable client name/id"
},
{
"name": "RuleSet",
"type": {
"name": "RuleSet",
"type": "record",
"fields": [
{
"name": "enable_insurance",
"type": "boolean",
"default": false,
"doc": "Flag indicating if client is allowed to offer insurance"
},
{
"name": "require_delivery_method_to_complete_order",
"type": "boolean",
"default": false,
"doc": "Flag indicating if client is required to provided a delivery method to complete an order"
},
{
"name": "shopping_cart_ttl",
"type": "int",
"default": 600,
"doc": "Max time that a cart is allowed to exists."
},
{
"name": "configurable_customer_info_obj_fields",
"type": ["null", "string"],
"default": null,
"doc": "What customer information fields are required for customer data to be considered 'compelte'"
}
]
}
}
]
}
Full Specs: https://avro.apache.org/docs/1.9.0/spec.html
{
"name": ”channel",
"type": {
"type": "enum",
"name": "Channel",
"symbols": [ "INTERNET", "IVR", "PHONE" ],
“default": "INTERNET",
"doc": "Category that client can transact on”
}
}
{
"namespace": "com.jundy.client",
"name": "Rules",
"type": "record",
"fields": [
{
{
"name": "feature_set",
"type": [ "null", "string" ],
"default": null,
"doc": "The human readable client name/id”
},
{
"name": "enable_insurance",
"type": "boolean",
"default": false,
"doc": "Flag indicating if …"
},
@erik_tank
.avsc vs .avdl
@namespace("com.jundy.client")
protocol Rules {
enum Channel { "INTERNET", "IVR", "PHONE" };
record Rules {
/**
Category that the client is allows to transact
*/
Channel channel = “INTERNET”;
/**
The human readable client name/id
*/
union { null, string } featureSet = null;
}
}
{"namespace": "com.jundy.client",
"name": "Rules",
"type": "record",
"fields": [{
"name": "channel",
"type": { "type": "enum",
"name": "Channel",
"symbols": [ "INTERNET", "IVR", "PHONE" ],
"default": "INTERNET",
"doc": "Category that the client is allows to transact on"
}},{"name": "feature_set",
"type": [ "null", "string" ],
"default": null,
"doc": "The human readable client name/id"
}]}
"name": "channel",
"type": { "type": "enum",
"name": "Channel",
"symbols": [ "INTERNET", "IVR", "PHONE" ],
"default": "INTERNET",
"doc": "Category that the …"
enum Channel { "INTERNET", "IVR", "PHONE" };
record Rules {
/**
Category that the client is allows to transact
*/
Channel channel = “INTERNET”;
"name": "feature_set",
"type": [ "null", "string" ],
"default": null,
"doc": "The human readable client name/id"
/**
The human readable client name/id
*/
union { null, string } featureSet = null;
Main Takeaways
❑Carefully consider topic name
❑Schema changes with caution
❑Use .avdl
❑Prototypes end up in production!!!!
@erik_tank
THANKS!Any questions?
You can find me at:
❑@erik-tank
You can find this talk at:
❑https://github.com/skeletonkey/Avro
THANKS!Any questions?
You can find me at:
❑@erik-tank
You can find this talk at:
❑https://github.com/skeletonkey/Avro
THANKS!Any questions?
You can find me at:
❑@erik-tank
You can find this talk at:
❑https://github.com/skeletonkey/Avro

More Related Content

Similar to Avro

Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Lucidworks
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3Robert Lemke
 
Realm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmRealm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmMartin Grider
 
Introduction to the rust programming language
Introduction to the rust programming languageIntroduction to the rust programming language
Introduction to the rust programming languageNikolay Denev
 
Application Integration with XProc
Application Integration with XProcApplication Integration with XProc
Application Integration with XProcVojtech Toman
 
Functional Comparison and Performance Evaluation of Streaming Frameworks
Functional Comparison and Performance Evaluation of Streaming FrameworksFunctional Comparison and Performance Evaluation of Streaming Frameworks
Functional Comparison and Performance Evaluation of Streaming FrameworksHuafeng Wang
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoPaul Marden
 
Cassandra Client Tutorial
Cassandra Client TutorialCassandra Client Tutorial
Cassandra Client TutorialJoe McTee
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipelineAnton Babenko
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
 
Elasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlibElasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlibJen Aman
 
Victor Charpenay | Standardized Semantics for an Open Web of Things
Victor Charpenay | Standardized Semantics for an Open Web of ThingsVictor Charpenay | Standardized Semantics for an Open Web of Things
Victor Charpenay | Standardized Semantics for an Open Web of Thingssemanticsconference
 
Fitc whats new in es6 for web devs
Fitc   whats new in es6 for web devsFitc   whats new in es6 for web devs
Fitc whats new in es6 for web devsFITC
 
Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Robert Lemke
 
Yang in ODL by Jan Medved
Yang in ODL by Jan MedvedYang in ODL by Jan Medved
Yang in ODL by Jan MedvedOpenDaylight
 
Yang in OpenDaylight
Yang in OpenDaylightYang in OpenDaylight
Yang in OpenDaylightGunjan Patel
 
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)James Titcumb
 

Similar to Avro (20)

Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
 
IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3IPCSE12: Getting into FLOW3
IPCSE12: Getting into FLOW3
 
Realm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to RealmRealm of the Mobile Database: an introduction to Realm
Realm of the Mobile Database: an introduction to Realm
 
Introduction to the rust programming language
Introduction to the rust programming languageIntroduction to the rust programming language
Introduction to the rust programming language
 
Application Integration with XProc
Application Integration with XProcApplication Integration with XProc
Application Integration with XProc
 
Functional Comparison and Performance Evaluation of Streaming Frameworks
Functional Comparison and Performance Evaluation of Streaming FrameworksFunctional Comparison and Performance Evaluation of Streaming Frameworks
Functional Comparison and Performance Evaluation of Streaming Frameworks
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In Umbraco
 
Cassandra Client Tutorial
Cassandra Client TutorialCassandra Client Tutorial
Cassandra Client Tutorial
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
Elasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlibElasticsearch And Apache Lucene For Apache Spark And MLlib
Elasticsearch And Apache Lucene For Apache Spark And MLlib
 
Victor Charpenay | Standardized Semantics for an Open Web of Things
Victor Charpenay | Standardized Semantics for an Open Web of ThingsVictor Charpenay | Standardized Semantics for an Open Web of Things
Victor Charpenay | Standardized Semantics for an Open Web of Things
 
Fitc whats new in es6 for web devs
Fitc   whats new in es6 for web devsFitc   whats new in es6 for web devs
Fitc whats new in es6 for web devs
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache Beam
 
Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)Hands on FLOW3 (DPC12)
Hands on FLOW3 (DPC12)
 
Yang in ODL by Jan Medved
Yang in ODL by Jan MedvedYang in ODL by Jan Medved
Yang in ODL by Jan Medved
 
Yang in OpenDaylight
Yang in OpenDaylightYang in OpenDaylight
Yang in OpenDaylight
 
Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)Best practices for crafting high quality PHP apps (php[world] 2019)
Best practices for crafting high quality PHP apps (php[world] 2019)
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 

Recently uploaded

ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxGagandeepKaur617299
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 
solid state electronics ktu module 5 slides
solid state electronics ktu module 5 slidessolid state electronics ktu module 5 slides
solid state electronics ktu module 5 slidesARUN AV
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5T.D. Shashikala
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Prakhyath Rai
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edgePaco Orozco
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxwendy cai
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDrGurudutt
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdftawat puangthong
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineJulioCesarSalazarHer1
 
Multivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxMultivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxalijaker017
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineAftabkhan575376
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor banktawat puangthong
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AISheetal Jain
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2T.D. Shashikala
 
School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdfKamal Acharya
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfJNTUA
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Lovely Professional University
 
Lect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptxLect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptxMonirHossain707319
 

Recently uploaded (20)

ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptxROAD CONSTRUCTION PRESENTATION.PPTX.pptx
ROAD CONSTRUCTION PRESENTATION.PPTX.pptx
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 
solid state electronics ktu module 5 slides
solid state electronics ktu module 5 slidessolid state electronics ktu module 5 slides
solid state electronics ktu module 5 slides
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
Multivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxMultivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptx
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor bank
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 
School management system project report.pdf
School management system project report.pdfSchool management system project report.pdf
School management system project report.pdf
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
Lect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptxLect_Z_Transform_Main_digital_image_processing.pptx
Lect_Z_Transform_Main_digital_image_processing.pptx
 

Avro

  • 1. Adding Avro to your Kafka streams to meet your messaging needs https://github.com/skeletonkey/Avro erik_tank
  • 2. HELLO! I am Erik Tank Lead Engineer at Ticketmaster You can find me at @erik_tank erik_tank
  • 4. Let’s Talk Schema Schemata - Plural of schema Schema “representation of a plan or theory in the form of an outline or model” (Oxford) @erik_tank
  • 6. Let’s Talk Schema Cons ❑No mechanism for evolution ❑No contract enforcement Avro Schem a Registry @erik_tank
  • 7. History of Avro (Aircraft) 1956 Avro Vulcan B. 1 High-altitude strategic bomber Operated by the Royal Air Force (RAF) from 1956 until 1984 1963 Merged into Hawker Siddeley Aviation However, the Avro name has been used for some aircraft since then 1909 Roe I Triplane First aircraft build by the Roes. First flight on June 5th 1909 1910 Founded by Alliott & Humphrey Verdon Roe One of the world's first aircraft builders. @erik_tank
  • 8. History of Avro (Aircraft) 2006 Hadoop Search removed from Nutch and with only the data processing/sharing parts Hadoop is born. 2009 Apache Avro A specification based design to server the data exchange needs to a world with multiple *everything*. 2002 Nutch Doug Cutting set out to build an open source full scale search engine 2003 Writable/SequenceFile Improving the ability to MapReduce and other parallel data computations @erik_tank
  • 9. Avro ❑Language neutral serialization system ❑Rich data structure ❑Compact, fast, binary data format ❑Integration to dynamic languages ❑Code generation (Java) ❑RPC ❑Schema evolution @erik_tank
  • 10. Why Use ❑ Data compression ❑ Language support ❑ Schema evolution ❑ Flexibility @erik_tank
  • 11. Why Not ❑ Initial Lift ❑ Binary format ❑ Not turn key in every language ❑ Prototyping ❑ You’re afraid? @erik_tank
  • 14. Short Kafka Detour ❑Topic contains messages ❑message is a key-value pair ❑subject – Schema Registry topic_name-key topic_name-value @erik_tank
  • 15. Picking a Topic Name ❑Avoid names that change over time ❑Settle on a template for your topics ❑ <message type>.<dataset name>.<data name> ❑Topic should reflect its purpose Source: https://riccomini.name/how-paint-bike-shed-kafka-topic-naming-conventions @erik_tank
  • 21. Best Practices (Do’s) ❑Default Value ❑Document!!! ❑Carefully consider topic name ❑Carefully consider changes to schema ❑Deal with Avro as a DB connection @erik_tank
  • 22. Best Practices (Dont’s) ❑Change the purpose of the topic ❑Change field types ❑Delete or Rename fields @erik_tank
  • 23. What’s in an extension? ❑.avsc – JSON schema file ❑.avdl – IDL file ❑.avpr – JSON protocol file @erik_tank
  • 24. .avsc{ "namespace": "com.jundy.client", "name": "Rules", "type": "record", "fields": [ { "name": ”channel", "type": { "type": "enum", "name": "Channel", "symbols": [ "INTERNET", "IVR", "PHONE" ], "default": "INTERNET", "doc": "Category that the client is allows to transact on" } }, { "name": "Market", "type": { "type": "enum", "name": "Market", "symbols": [ "UNITEDSTATES", "AUSTRALIA", "CANADA", "GERMANY", "GREATBRITAIN", "IRELAND", "MEXICO", "NEWZEALAND", "NORTHIRELAND", "SPAIN" ], "default": "UNITEDSTATES", "doc": "Market which client is allowed to operate in" } }, { "name": "feature_set", "type": [ "null", "string" ], "default": null, "doc": "The human readable client name/id" }, { "name": "RuleSet", "type": { "name": "RuleSet", "type": "record", "fields": [ { "name": "enable_insurance", "type": "boolean", "default": false, "doc": "Flag indicating if client is allowed to offer insurance" }, { "name": "require_delivery_method_to_complete_order", "type": "boolean", "default": false, "doc": "Flag indicating if client is required to provided a delivery method to complete an order" }, { "name": "shopping_cart_ttl", "type": "int", "default": 600, "doc": "Max time that a cart is allowed to exists." }, { "name": "configurable_customer_info_obj_fields", "type": ["null", "string"], "default": null, "doc": "What customer information fields are required for customer data to be considered 'compelte'" } ] } } ] } Full Specs: https://avro.apache.org/docs/1.9.0/spec.html { "name": ”channel", "type": { "type": "enum", "name": "Channel", "symbols": [ "INTERNET", "IVR", "PHONE" ], “default": "INTERNET", "doc": "Category that client can transact on” } } { "namespace": "com.jundy.client", "name": "Rules", "type": "record", "fields": [ { { "name": "feature_set", "type": [ "null", "string" ], "default": null, "doc": "The human readable client name/id” }, { "name": "enable_insurance", "type": "boolean", "default": false, "doc": "Flag indicating if …" }, @erik_tank
  • 25. .avsc vs .avdl @namespace("com.jundy.client") protocol Rules { enum Channel { "INTERNET", "IVR", "PHONE" }; record Rules { /** Category that the client is allows to transact */ Channel channel = “INTERNET”; /** The human readable client name/id */ union { null, string } featureSet = null; } } {"namespace": "com.jundy.client", "name": "Rules", "type": "record", "fields": [{ "name": "channel", "type": { "type": "enum", "name": "Channel", "symbols": [ "INTERNET", "IVR", "PHONE" ], "default": "INTERNET", "doc": "Category that the client is allows to transact on" }},{"name": "feature_set", "type": [ "null", "string" ], "default": null, "doc": "The human readable client name/id" }]} "name": "channel", "type": { "type": "enum", "name": "Channel", "symbols": [ "INTERNET", "IVR", "PHONE" ], "default": "INTERNET", "doc": "Category that the …" enum Channel { "INTERNET", "IVR", "PHONE" }; record Rules { /** Category that the client is allows to transact */ Channel channel = “INTERNET”; "name": "feature_set", "type": [ "null", "string" ], "default": null, "doc": "The human readable client name/id" /** The human readable client name/id */ union { null, string } featureSet = null;
  • 26. Main Takeaways ❑Carefully consider topic name ❑Schema changes with caution ❑Use .avdl ❑Prototypes end up in production!!!! @erik_tank
  • 27. THANKS!Any questions? You can find me at: ❑@erik-tank You can find this talk at: ❑https://github.com/skeletonkey/Avro
  • 28. THANKS!Any questions? You can find me at: ❑@erik-tank You can find this talk at: ❑https://github.com/skeletonkey/Avro
  • 29. THANKS!Any questions? You can find me at: ❑@erik-tank You can find this talk at: ❑https://github.com/skeletonkey/Avro