I\'m using protocol buffers and everything is working fine. except that the fact that I don\'t understand - why do I need the numbered tags in the proto file : >
The numbered tags are used to match fields when serializing and deserializing the data.
Obviously, if you change the numbering scheme, and apply this change to both serializer and deserializer, there is no issue.
Consider though, if you saved data with the first numbering scheme, and loaded it with the second one, it would try to load query into result_per_page, and deserialization would likely fail.
Now, why is this useful? Let's say you need to add another field to your data, long after the schema is already in use:
message SearchRequest {
required string query = 1;
optional int32 page_number = 2;
optional int32 result_per_page = 3;
optional int32 new_data = 4;
}
Because you explicitly give it a number, your deserializer is still able to load data serialized with the old numbering scheme, ignoring deserialization of non-existent data.