Effective Serialization In Go: JSON, Protocol Buffers and More
1h 11mAdvanced2024-07-22
Authors

Miki Tebeka
CEO at 353Solutions
Course details
Serialization—taking data structures from the language and converting them to a sequence of bytes—is something every developer encounters at one point or another. In this course, instructor Miki Tebeka teaches you how to work effectively with serialization in Go. This course is targeted to advanced Go developers, and starts with a look at some serialization best practices. Miki then looks at some Go-specific formats as well as JSON. He also shows you how to work with protocol buffers—a powerful binary format—and finishes with a tour of some other popular serialization formats like XML, CSV, and SQL. Each chapter ends with a challenge, so you can test your serialization skills as you go.
Learning objectives
Describe why we need serialization.
Explain what to consider when picking a format.
Review common formats.
Use interfaces for serialization.
Learning objectives
Describe why we need serialization.
Explain what to consider when picking a format.
Review common formats.
Use interfaces for serialization.
Skills covered
GoProgramming FoundationsGoogleProgramming LanguagesSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Effective serialization in Go
- 02 - What you should know
- 03 - Working with Codespaces
1. Serialization Overview
- 04 - Why do we need serialization
- 05 - Picking a format
- 06 - General rules
- 07 - Formats overview
2. Go-Specific Formats
- 08 - String representation
- 09 - encoding.TextMarshaler
- 10 - encoding gob
- 11 - Challenge - User database
- 12 - Solution - User database
3. Working with JSON
- 13 - encoding json API
- 14 - Custom marshaling
- 15 - Zero vs. missing values
- 16 - Handling dynamic types
- 17 - Streaming JSON
- 18 - Challenge - Marshal metrics
- 19 - Solution - Marshal metrics
4. Working with Protocol Buffers
- 20 - Protocol buffers overview
- 21 - Generating code
- 22 - Using the generated code
- 23 - Working with time
- 24 - Emitting JSON
- 25 - Challenge - Encode RideEnd to a file
- 26 - Solution - Encode a RideEnd to a file
5. Other Serialization Formats
- 27 - YAML and TOML
- 28 - XML
- 29 - CSV
- 30 - SQL
- 31 - Challenge - ETL
- 32 - Solution - ETL
Conclusion
- 33 - Next steps