SlideShare a Scribd company logo
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 FLOW3
Robert 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 Realm
Martin Grider
 
Introduction to the rust programming language
Introduction to the rust programming languageIntroduction to the rust programming language
Introduction to the rust programming language
Nikolay Denev
 
Application Integration with XProc
Application Integration with XProcApplication Integration with XProc
Application Integration with XProc
Vojtech 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 Frameworks
Huafeng Wang
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
Diacode
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In Umbraco
Paul Marden
 
Cassandra Client Tutorial
Cassandra Client TutorialCassandra Client Tutorial
Cassandra Client Tutorial
Joe McTee
 
Terraform in deployment pipeline
Terraform in deployment pipelineTerraform in deployment pipeline
Terraform in deployment pipeline
Anton 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 JSON
Alexandre 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 MLlib
Jen 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 Things
semanticsconference
 
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
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache Beam
Jean-Baptiste Onofré
 
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 Medved
OpenDaylight
 
Yang in OpenDaylight
Yang in OpenDaylightYang in OpenDaylight
Yang in OpenDaylight
Gunjan 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

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 

Recently uploaded (20)

HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 

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