Home

Proto3

Proto3 is the third version of Protocol Buffers, a language-neutral, platform-neutral data serialization format and interface description language developed by Google. It defines a compact binary encoding for structured data and is widely used for communication protocols, data storage, and service definitions, including gRPC APIs.

In Proto3, a .proto file uses syntax = "proto3" to describe messages and services. Data structures are

Proto3 simplifies and changes several aspects of Proto2. It removes required fields, extensions, and default values

The binary encoding is designed to be compact and efficient, with a separate JSON mapping for interoperability.

defined
with
fields
assigned
numeric
tags.
Supported
scalar
field
types
include
double,
float,
int32,
int64,
uint32,
uint64,
sint32,
sint64,
fixed32,
fixed64,
sfixed32,
sfixed64,
bool,
string,
and
bytes,
as
well
as
enumerations,
nested
messages,
repeated
fields,
and
map
fields.
Oneof
is
supported,
allowing
mutual
exclusivity
among
fields.
In
addition,
there
are
well-known
wrapper
types
(for
example,
google.protobuf.StringValue)
used
when
presence
information
for
scalars
is
needed.
for
scalar
types.
Scalar
fields
do
not
carry
presence
information
by
default;
presence
can
be
detected
via
wrappers
or,
in
newer
versions,
the
optional
keyword.
Unknown
fields
encountered
during
parsing
are
typically
discarded,
which
supports
forward
and
backward
compatibility
as
schemas
evolve.
Proto3
is
widely
supported
across
programming
languages
and
platforms,
with
official
implementations
in
several
languages
and
strong
integration
with
gRPC,
which
uses
Proto3
as
its
IDL
by
default.
The
ecosystem
also
includes
tools
for
code
generation,
validation,
and
versioning
to
manage
evolving
data
schemas.