
Microservices Communication in .NET Using gRPC
By :

Date and time values are frequently used by software developers. So are data types representing durations. But they are completely missing from Protobuf.
There are some workarounds that can be applied. For example, we can transfer an integer value that represents a number of milliseconds from a specific date. Alternatively, we can construct our own message
definitions that store days, months, years, hours, minutes, and seconds. But these workarounds are not necessarily easy to implement. For example, if we choose to represent a date as milliseconds only, there is no guarantee that both the client and the server use the same date as the standard origin. Likewise, if we opt to use a custom message
definition, we will need to write additional code to convert it into proper date and time data in both the client and the server applications.
Luckily, Google's library of well-known types has a much better solution for it. It has two data types...