Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protocol buffer - usecases

I tried reading Protobuf docs, but couldn't imagine many usecases it can be used. I would like to know some real-world performance improvement usecases of protocol buffer . Thanks

like image 859
Sagar Avatar asked Dec 08 '22 16:12

Sagar


2 Answers

Protocol buffers is a serialization library, so the answer to that is basically the same as to the question:

When would I want to serialize / deserialize data?

That could be any scenario involving persistence (disk, blobs in a database, etc), transfer (sockets, files, etc), or simply in-memory storage (snapshots, memento, deep-clone). The fact that protobuf is version-tolerant and cross-platform means that it can work for both homogeneous and heterogeneous setups - as indeed can various other serialization formats. Being terse (small) it may be particularly useful when bandwidth is at a premium (which is "always" on busy systems), and being a binary (rather than text) protocol, it is noticeably cheaper to process - so good for reducing CPU overhead. Beyond that: this is an open-ended question limited only by your imagination.

like image 82
Marc Gravell Avatar answered Feb 23 '23 06:02

Marc Gravell


It's going to be more CPU and network efficient than something like Json, so whenever you know what'd you be sending, and need to send a lot of it, it's probably a win.

like image 39
Tyler Eaves Avatar answered Feb 23 '23 05:02

Tyler Eaves