Protocol Buffers Crash Course
Vložit
- čas přidán 26. 06. 2024
- Protocol Buffers (Protobuf) is a method of serializing structured data useful for transmitting data over the wire or storing it. in this video I want to build a application with pure JSON and then rebuild the same application using protocol buffers and finally compare compare the results. I will also the pros and cons of Protocol buffers.
0:00 Intro
1:30 Write an App with JSON
8:00 ReWrite the App with Protobuf
8:20 Writing .proto file
14:00 protoc
19:00 Using protobuf structures
28:20 Pros & Cons of Protocol Buffers
Benefits of ProtoBuff
* Schema
* Binary compact size
* Language neutral
Cons
* Have to have structured data (barrier to entry)
* More involved processed for small applications.
* Have to make sure to update compiled boilerplate code (bugs, security vulnerability, etc.)
* hard to use with JSON based application (Javascript/browser)
protoc compiler
protoc --js_out=import_style=commonjs,binary:. employees.proto
npm install google-protobuf
Source Code
github.com/hnasr/javascript_p...
Resource
protoc download
github.com/protocolbuffers/pr...
protocol buffer javascript doc
github.com/protocolbuffers/pr...
Guys! after I uploaded the video I learned about flatbuffers which are pretty awesome.. too bad I didn’t give them an honorable mention in the video.
🏭 Software Architecture Videos
• Software Architecture
💾 Database Engineering Videos
• Database Engineering
🛰 Network Engineering Videos
• Network Engineering
🏰 Load Balancing and Proxies Videos
• Proxies
🐘 Postgres Videos
• PostgresSQL
🚢Docker
• Docker
🧮 Programming Pattern Videos
• Programming Patterns
🛡 Web Security Videos
• Web Security
🦠 HTTP Videos
• HTTP
🐍 Python Videos
• Python by Example
🔆 Javascript Videos
• Javascript by Example
👾Discord Server / discord
Support me on PayPal
bit.ly/33ENps4
Become a Patreon
/ hnasr
Stay Awesome,
Hussein - Věda a technologie
Learn the fundamentals of the backend, scaling and load balancing with my Introduction to NGINX udemy course nginx.husseinnasser.com
This was one of the most energetic talks I've heard In a while. Keep it up man, the energy and a vibe you put inside your tutorials is addictive 👍
This was probably the best dev tutorial I've ever seen. Your energy and humor is infectious; You turned what could've been a frustrating tutorial into something easy, useful, and fun to watch. Well done!
Vídeo sensacional, não tem conteúdo melhor explorando protobuffer no youtube. Muito obrigado
Wow this is the video I've been waiting for. I really wanted to know the differences between JSON and protobuff. Really looking forward to GRPC!!!
Kiran Randhawa thanks Kiran! That was my purpose as well. I don’t like to use a tech without knowing why it was invented
The way you teach and explain things is just amazing. Well done!
Thank you for this, had to learn protocol buffer quickly for an existing project and this video really got me there.
I don't usually put up a comment but I have to appreciate your humorous approach to explaining these complex technical things. You just earned a subscriber :)
Thank you dear! Enjoy the content
Hussein, Thank you so much for your channel! as a junior backend dev, your content has been a god send!!!
Man that was such a simple still great and useful tutorial on protobuf. I wasn't expecting too much from it and now I'm taking away great information. Cheers man!
Dude, I rarely (never) comment on YT videos. That being said, I watch a lot of tech / dev tutorials... I really enjoy your humorous way of going through the exercise and explaining the different concepts. As already suggested in the comments below: if you continue, I know you'll end up a very popular channel for these type of tutorials.
Well done mate! Cheers from Germany.
Robert Rottschalk Robert! I really appreciate you taking the time to comment it means so much. Thank you for your kind words, glad you are enjoying the content and cheers to all my subs from Germany 🇩🇪
What Robert said. Good video :)
i guess im asking randomly but does any of you know of a trick to log back into an Instagram account?
I was dumb forgot the login password. I would love any tips you can give me!
and now it became very popular channel :)
Truly a fine video Hussein. I like your sense of humor. It makes a dry topic almost tolerable. Thank you!
Loved it as always. Great work buddy! I always eagerly forward to your videos. They are quite informative and helpful in understanding the fundamentals of these concepts.
Glad you like them! thanks Naveen
The best yt channel, real life programming .. thx
SocialBlade appreciate it thanks 😊
First video of Husseins that I'm watching and gotta say the energy keeps me engaged during moments which in other videos would've been incredibly boring. Definitely gonna take a look at any other videos he produces cause it seems like they would be really good
What an incredible content and amazing pedagogical approach full of energy and simplicity!
You are great at keeping the audience's attention! I enjoyed this course.
Great effort! Your tone catches attention and emphasizes the right parts at the right time.
Subscribed! This was by far the best tutorial available on protocol buffers.
You are a Star!!! Very fun, clear and straight to the point. keep up!!!! 🙌
Man... That was a hell of a beautiful video. I don't watch long videos but damn.... You're fun and really understand what the hell you're doing
Great video. I really enjoyed your energy while explaining what Proto Buffers are. I now have a good understanding of what Proto Buffers are. Thanks. I'll be checking out your videos.
Thank you so much for this. Such a clear and beautiful explanation, and your personality is so wholesome and funny lol. Really enjoyed the video, take my like!
This is a great tutorial I like that you have a bit of fun with these it really helps keep it engaging.
I laughed so many times I had to re-watch the video, 10/10. You're amazing
Thank you so much , I was really stuck with that . And your style is just awesome !
Thanks for your comment I am happy I could help.
I felt it was a long video before I started watching it, but it was fun and really informative. Thanks
I like the way you express your self . Enjoyed the video and learned at the same time. good one!
Dude, best Protobuf tutorial I've seen. To be honest, I am using python while watching you and JS, but you explained it so well, that the language does not matter, just like protobuf :D
Thanks for the excellent video. Your presentation style was just great. Energetic and fun with great content!
That was clear and concise. Thank you.
Loved the explanation! Thank You!
I am generally lazy on writing comment on YT videos/blogs. It was an awesome explanation. I really loved it and eager listen to many more videos from your channel. Thank you
Thanks for taking the time to write this comment .. I appreciate it ❤️
One of the best explanation I have seen. Your vibe and energy is another level. Keep it up bro. here you got a new subscriber 👍
Best channel for software engineering, i like this channel, terimakasih husen
You are literally the voice in my head.. lol exactly how my internal monolog sounds haha great videos man!
Haha Glad to hear it! Thanks Jamie! all the best
Another great video. Protocol buffers seem like a much more accessible version of Asn.1 and the various TLV encoding
Great video as always.
Regarding the cons, the two you named apply if you're working on small projects / working alone or with a small team.
As soon as you have a more complex project or dozens of Devs (of all levels) working on a project or connected projectS sharing the same data, having a schema becomes a MUST an having to maintain an additional file or update a cli much better than not having a Schema.
Well now the channel have 114k! Congrats to your past! 🎉🔥
Man I like your style and I subbed your channel after watching your video (this one) for the very first time for 4 minutes
🙏🙏 thanks Hang
Like the way you teaching!! Thanks for sharing all your ideas!!
Cool video, can't wait for the gRPC part
Excellent video. Thank you for this tutorial.
love your breakdowns . really good. I actually prefer the proto schema to just blasting json for api calls because even though the json itself doesn't have a schema, I'm still serializing and deserializing to types on server and client which is conforming to a kind of implicit schema (my type system). Now, the code gen does that for me. That's very very nice. It doesn't solve every use case but it solves all of mine!
Brilliant tutorial, this is cool. Thanks.
Thank you so much. This crash course is really helpful!
great content Hussein Nasser. I broke that thumbs up on your video. Continue to keep up the great work.
Fantastic Video Hussein. thank you for the hard work.
this is interesting. I wonder why I haven't seen this used yet in any of the react tutorials I've been watching throughout the past months
I really enjoyed your tutorial! Thank you :)
Ok, I never comment here at YT. First time commenting here just to thank you for that humor. Very good!! Had a very great time watching this. And the video was very technically helpful. So thanks again!
Thanks Felipe for taking the time to write comment ❤️ glad you enjoyed the video
Thanks for video, man! Cool explanation
You are fun to watch! Well explained 👍
Thanks!
Dear Hussein, keep that same spirit up!
Great video. I was looking for this topic. Thanks
Eddy thanks Eddy! Hope its useful 🙏
I really enjoy your explanation! Tks
You went to 16k pretty quickly. Continue doing this and several 💯 k very soon.
Vrunda ONE thanks for being long time sub! Will do!
@@hnasr Started from the bottom, now you're ... omg you put out 1 vid / day of actually good software engineering content, how have I not seen you before? So close to 100k my dude, let my subscribe help you inch closer. ☮
This was something new for me... 😋
Thanks for making my day @Hussein 😁😁
Life saver. Thank you man.
Clean and clear explanation, :) thanks for sharing this video
Thanks for the demo!
This was an amazing explanation. Here's my sub! 😎
This is awesome dude. Great channel. Subbed.
Not boring, very cool attitude
good video. Bear in mind to be more concise with what you explain and the target audience. thanks it helped me a lot
والله شرح جميل جميل جميل جميل ربنا يجعله في ميزان حسناتك ❤❤
00:05 Protocol Buffers is a method of serializing structured data.
04:55 Write an application with JSON and JavaScript
09:28 Version 3 of the protocol is the latest and greatest with some changes
14:05 Google built a language-neutral protocol buffer compiler called Proto C.
18:47 Start building the employee class and use it
22:57 Protocol buffer is a powerful tool for serializing and deserializing data.
27:49 Protocol buffer is a language neutral protocol format with schema and compact size benefits.
32:09 Using protocol buffer may not be necessary for small applications without the need for a schema.
Crafted by Merlin AI.
It's been a while since I had literate fun while learning. Good job! I'm surprised to find you here since I was looking for your backend course on Udemy two weeks ago.
Good stuff!
Big companies like Google, MS, Amazon, and other big wigs. They create lightning speed APIs by optimizing a lot of things. Protobuf is one of that. It helps to achieve the smallest possible data footprint that helps transferring that binary data over the net very fast. Certainly it is much faster than REST or SOAP. Response time gRPC < REST < SOAP.
Good info for the beginners who wants to know the stuff
I am greatful to GOD that i found this channel.
Awesome!
Thank you very much
Thank you for this excellent video, Hussein! One more con of protobuf vs JSON is it's not human readable since it's binary. For certain applications you might want your serialized data to be human readable.
Great video!
شكرا ابو ناصر
Nice video Hussein. Protobuf is very similar to the .Net remoting concept except this is language-neutral.
Good introduction. Thanks.
Very interesting video. Made me watch it till the end and it is not usual for me :)
Very cool way of explanation. IIIIIIIIIIIIIIIIIIII loved it
Glad it was helpful Naysha!
Great video, thank you. Gonna go check out your channel.
Welcome! And enjoy the content
great video, thank you
Awesome Tutorial
Thanks dude, I love it too now
Raul Fossemale ❤️💗
nicely explain , you're my brother.
Im a simple man. I hear "ooo abracadabra poof!" And i hit the like button.
Thanks for the knowledge, you have a lot to offer. I would have preferred if the text were a little smaller and/or if you got rid of the terminal when it's not in use, or make it smaller.
Awesome video. Another point that can be made is that protobufs shouldn't be used for really large files (like images) that you don't want to have live in memory.
I'm investigating protobufs and I think is a really cool advantage of it having a schema, is that if you have multiple programs, in different languages, talking to eachother. Αnd more programs might be added for which you don't know the language. Then having a shared schema like this is awesome. Compilation can be done with CI and it seems you can change protobufs without having to go through every old project that's using it (by following certain best practices).
If you don't like callbacks... you can
import { promisify } from 'util'
import fs from fs
const writeFile = promisify( fs.writeFile )
...
await writeFile('file/path', JSON.stringify({...})
hey man ur videos are addictive..😃
amazing video sir, thanks
loved the Abrakadabra Poof :D
"your clients will yell at you regardless what do you do, it's the circle of life, there is no escape from that" 35:29 I really felt that feeling.
Thanks Hussein, it was amazing, watched your video before sleeping, and now 🫡 "what is sleep?" will watch your gRPC video then will think of sleeping. haha
this was an awesome video
I love how you say “array”. 11:18
Extracting protobuf uses a lot more cpu than just parsing JSON. This is very noticable when working with map data. Mapbox Vector Tiles (MVT) uses protobuf under the hood - and compared to sending GeoJSON, a lot more cpu power is required at the client side.
At least this is my understanding after doing direct comparisons between MVT and GeoJSON.
Interesting point, I thought protobuf benefit is faster deserialization ... maybe this is specific use case with mapping data
Awesome content!!
🙏
Personally, rather than script reading videos (with the eyes of the presenter running from left to right) - with this you feel like you drinking a beer with a friend that is telling you all this cool stuff, paying attention to each and every detail, trying to make sure you understand. This is not to say that other videos are not pursuing the same goal. This is to emphasize how much more personal touch this style has and from reading the comments, you can tell it resonates with folks a lot. Again, huge thanks and keep it up!
GOD.. u r awesome man 🔥🔥
great video very educational
excellent explanation.
pretty awesome