Building an Basic API with gRPC and Protobuf

  Рет қаралды 96,443

Tensor Programming

Tensor Programming

Күн бұрын

In this tutorial, we take a look at how we can use gRPC to build a simple API.
Github Repository: github.com/ten...
gRPC: grpc.io/
Protobuf: developers.goo...
Request Form: goo.gl/forms/r...
Cloudways Web App Hosting: www.cloudways....
Support the Channel and Join Patreon:
Patreon: / tensor_programming
Dontate:
ETH: 0x03247265dd5242605bD2FA3c40fb3b70d9e3D685
Cardano: addr1q9auccwrr9ws8qdyv45f4qwsx76pfmld4zapks89sakq94ay0xmle73y0r8ruwd0zslls4eglf98lghru7ywv56cedysk7ftjt
Check out our Twitter: / tensorprogram
Check out our Facebook: / tensor-programming-119...
Check out our Steemit: steemit.com/@t...

Пікірлер: 154
@seanfang398
@seanfang398 Жыл бұрын
after finishing watching this video, I just realized this is a video made 4 yrs ago, WOW, it is still amazing!! Thank you ❤
@TensorProgramming
@TensorProgramming Жыл бұрын
haha, glad its still relevant. Luckily, Go doesn't change all that much over the years.
@yzhang2008
@yzhang2008 Жыл бұрын
5:07 those numbers after the eqaul sign are to denote the sequence of the fields in the message. In general your vid is great! Thanks!
@TensorProgramming
@TensorProgramming Жыл бұрын
Was an issue due to the video being fully live coded. In the follow up video I went back and corrected the explanation.
@JohnDoe-ji1zv
@JohnDoe-ji1zv 5 жыл бұрын
More content on microservices with gRPC please, thanks for the video 🙏🏻
@upnrunning7094
@upnrunning7094 2 жыл бұрын
Really nice job! I appreciate you not getting tangled up in complex examples, but instead focus on the material at hand that you're teaching. SUBSCRIBED
@codealong493
@codealong493 5 жыл бұрын
Got it working after a bit, thanks for all the pointers.
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Glad you found it useful.
@seanvogel8067
@seanvogel8067 5 жыл бұрын
Good tutorial. going to watch your golang videos now! btw: / is slash \ is backslash
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Yes I am aware, I confuse them because of my dyslexia.
@khurramrizvi153
@khurramrizvi153 4 жыл бұрын
@@TensorProgramming I too sometimes have this problem, but just a quick help for you to simply identify it. Just try looking at the TOP point of the character '/', if its pointing forward than its a 'forward slash' or just 'slash' Similarly for '\' , the point on the top is pointing backwards, hence its a 'backward slash' or just 'backslash' Hope, this makes sense for you :D BTW, great content on gRPC.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
@@khurramrizvi153 yeah I am aware of how to identify a backslash or forward slash. Since this video, I've made an effort to be more deliberate with how I articulate these two. Still can be hard when I am not thinking about it though.
@sulafpv
@sulafpv 4 жыл бұрын
The best tutorial on gRPC
@k1ngjulien_
@k1ngjulien_ 4 жыл бұрын
very nice! that's exactly the introduction to grpc I was looking for
@SAlmanKhanDev
@SAlmanKhanDev 2 жыл бұрын
The additional step to mix it with gin really made it special. Thanks a ton man!
@bminerrolltide
@bminerrolltide 5 жыл бұрын
Forward slash is /. Back slash is \. Ok I feel better. Sorry pet peeve. Nice video!
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Its alright, I am dyslexic so its a common mistake.
@bminerrolltide
@bminerrolltide 5 жыл бұрын
@@TensorProgramming Are you really dyslexic? After playing around a bit gRPC is a neat way to build APIs
@TensorProgramming
@TensorProgramming 5 жыл бұрын
@@bminerrolltide Yeah, certainly am. gRPC is quite good and extremely useful.
@techmadehere
@techmadehere 5 жыл бұрын
Awesome Content ! Precise
@farishuskovic8486
@farishuskovic8486 5 жыл бұрын
Thanks Tensor. I started learning Go in the middle of 2018. The Golang videos you've put out have definitely been a contributing factor to me further exploring this technology. Really appreciate the time and effort and look forward to future Go videos. I recently started learning React. I noticed you're profile pic is of the react symbol but you don't have any react videos. I definitely have an interest in combining Go and React into a stack along with an advanced API technology like using protobufs and GRPC or GraphQL. Wondering what your thoughts are on those technologies or if we might see something like react and or Graphql on the channel in the future ?
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Firstly, thank you. Its always great to hear when people find my content useful. I make this content to help people learn and if I've helped at least one person then I've done my job. Its not actually a react symbol; its an Atom. I mean of course its also the react symbol but that wasn't what I had in mind. I've done some react reasonML stuff on this channel and I do have plans to do some clojurescript stuff with OM/OM next, but there will be no JavaScript based tutorials on this channel for the foreseeable future. The main reason for this is due to the fact that there are a ton of JavaScript/React tutorials already out there. Also, I don't personally like using JS when I can avoid it. GraphQL on the other hand is a thing that I certainly love to play with. I have some stuff on it with Elixir and also intend to add some Go based GraphQL stuff in the near future. Likely, If I do a large project with gRPC/GraphQL and Go, the frontend will be built with a language like Reason, Elm or ClojureScript for the sake of those users.
@JalerSekarMaji
@JalerSekarMaji 4 жыл бұрын
It gives me more insight about the implementation of gRPC. thankyou very much!
@adilrasiyani4240
@adilrasiyani4240 2 жыл бұрын
For Mac, if you use brew you can install everything with brew install grpc. It will install the proto stuff for you automatically.
@TensorProgramming
@TensorProgramming 2 жыл бұрын
Sure. For linux (debian) you can use aptitude, for linux (arch) pacman etc. On windows there is scoop and the new windows package manager too
@gamezine8374
@gamezine8374 2 жыл бұрын
PoE got ready to play during the record :D
@TensorProgramming
@TensorProgramming 2 жыл бұрын
Yeah, love me some PoE.
@RajeshSamson
@RajeshSamson 4 жыл бұрын
Great explanation ... very beautiful video
@PandemicGameplay
@PandemicGameplay 4 жыл бұрын
Question: is GRPC async? I guess my question is how are multiple clients handled since you are using only 1 connection throughout the lifetime of the main client server?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
The protocol gRPC has nothing to do with the synchronicity of the client/servers; its just a protocol after all. That being said, you can make asynchronous calls with gRPC data just as you could with JSON data or XML data. Our server here can handle multiple clients as it currently is since we are serving over TCP. Thing is, you don't have to manually create a bunch of concurrent logic with servers in Go. The "net/http" library naturally uses Concurrency/Goroutines and so when you call http.ListenAndServe you spawn as many goroutines as are needed to handle the incoming connections. If you want to try it for yourself, just make a simple http server with go and open a bunch of browser windows at the same time or create a client which pings it multiple times with many different go routines.
@feziletati2958
@feziletati2958 4 жыл бұрын
Great tutorial, well done.
@romsthe
@romsthe 3 жыл бұрын
So your client is actually a REST server itself, could be confusing. Well good tuto anyway, I never used golang but it was easy to follow and understand. Thanks a lot
@TensorProgramming
@TensorProgramming 3 жыл бұрын
This client is a rest server sure, but it can be any type of client you want, a CLI, a GUI etc.
@SouvikHaldarmustang
@SouvikHaldarmustang 5 жыл бұрын
One point seems to be wrong:- The numbers beside the fields are not their size but their position in the structure. Correct me if I'm wrong.
@ugokoli
@ugokoli 5 жыл бұрын
You are right
@TensorProgramming
@TensorProgramming 5 жыл бұрын
You are not wrong, I corrected this problem in the next video. Also you aren't the first person to mention this in the comment for this video. I knew I had misspoken at the time, but it was a result of this being a live coded session.
@cryptopatrick
@cryptopatrick 5 жыл бұрын
Absolutely amazing videos! I went through the RPC video, took study notes, and then wrote the code as you instructed in the video - made my first RPC calls! YAY!! :D Mr. Tensor, may I ask: what is your goto language? If you just want to explore an idea, what language do you usually reach for? Cheers!
@TensorProgramming
@TensorProgramming 5 жыл бұрын
It really depends on the use-case that I am working on. I've never really been the type of person to stick to one language for everything because I often find that there are better solutions. I like Go for microservices and for small-medium backend web apps. I also like Rust for small-medium backend web apps and for WASM compilation (and some games). I like Elixir for Microservices and Larger Web apps along with Clojure for Large web apps and ML etc.
@josebravo7998
@josebravo7998 5 жыл бұрын
@@TensorProgramming you should make a microservices with golang tutorial sir. Love this one btw
@TensorProgramming
@TensorProgramming 5 жыл бұрын
@@josebravo7998 Well technically this little series is a start, but yes, I do intend to add a full microservice project at some point.
@tony-go-code
@tony-go-code 3 жыл бұрын
thank you for sharing, i love this.
@AtticusFinch65
@AtticusFinch65 5 жыл бұрын
Thank you!
@ngocthanhao1678
@ngocthanhao1678 4 жыл бұрын
This video is awesome! Thanks you
@Mo-gp4df
@Mo-gp4df 2 жыл бұрын
thank you very much for the tutorial I want just to code server-side in java and client-side in go . Can you help me ?
@TensorProgramming
@TensorProgramming 2 жыл бұрын
Thats a little bit of a strange stack, but yes Go can be used for client side work given that it can compile to JavaScript and WASM. Many of those features are in the standard library too. One of these days I had planned to talk about gopherjs and wasmer-go.
@subee128
@subee128 2 жыл бұрын
Thank you very much
@AbhaySingh-vx5yo
@AbhaySingh-vx5yo 2 жыл бұрын
When I tried to run client, I am facing this issue of "Fatal to run server: bind address already in use" , even though nothing was running on port
@TensorProgramming
@TensorProgramming 2 жыл бұрын
Which port are you using? I would try changing it to something absurdly high.
@siasalar
@siasalar 4 жыл бұрын
Thanks a lot for this amazing video, could you please explain more about the "third_party" folder, why created? usage? and how we can use Go Module instead of this folder. thanks in advance.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
That third party folder was just created for convenience sake. It contains all of the include files that are needed to compile the protobuf stub file into a Go module. There is no alternative; you need those files when using the compiler.
@tomsutton1526
@tomsutton1526 Жыл бұрын
@@TensorProgramming Hey, thanks for the great video. Gave you a like and subscribe. It's nothing personal, but the one thing that drove my classmates and I crazy the most is when you're following a tutorial and the author makes some sudden jump or does something all of a sudden that makes no sense and they don't explain why they did it. That's exactly what you did with third_party. If you're assuming that the audience doesn't know the most basic of things, like how to download gRPC, why would you assume that they would just know why to create the third_party folder and what to put in it?
@TensorProgramming
@TensorProgramming Жыл бұрын
@@tomsutton1526 I understand what you are saying. The jump there isn't really me going through a ton of steps, its me unzipping the folder and putting it on my path as I said in the video. I do explain where the third_party folder came from and all that. The main issue I think you and your classmates are seeing is that it pops in and out of the video because that little part at 2:30 was recorded after I had gone through the stuff at 3:10. Basically, I went back and recorded more explanation while I was editing the video because I felt that it was missing. At the time, I should have just overdubbed it on a few looped frames but I didn't think to do that. Glad you enjoy the content regardless. Feel free to ask any questions you have and of course, leave and constructive criticisms.
@shayaxelrod7691
@shayaxelrod7691 2 жыл бұрын
Welcome to the Golang! Any COD fans?
@Wallawallawallawalla
@Wallawallawallawalla 5 жыл бұрын
I think you mispoke when talking about the use of the field number. It isn't used to specify the size of what is stored in it, it's used to have a small reference to the field so it may be identified in the message binary format. Field numbers 1-15 take do take just one byte to encode, and should therefore be reserved for frequently occurring fields. The type (as in actual type like int64, string, etc) of data in the field should never influence the field number. Source: am googler, use these every day, and double checked my expectations against the docs to verify.
@Wallawallawallawalla
@Wallawallawallawalla 5 жыл бұрын
By the way, I think the (possible) error doesn't at all take away from the excellent video! Thank you for making these and all your videos, they are always excellent!
@TensorProgramming
@TensorProgramming 5 жыл бұрын
@@Wallawallawallawalla Its not a problem. Thank you for pointing out the issue. Another subscriber mentioned the same problem a little while ago when the video came out. One of the side effects of doing everything "Live" is that the explanations can suffer somewhat. I did try to make the concept clear in the follow up video on gRPC so I am hoping that makes up for it (since it is a fairly fundamental concept for gRPC and protobuffers).
@joycalcutta
@joycalcutta 5 жыл бұрын
The numbers 1 & 2, probably sets the serialization order of the member elements.
@TensorProgramming
@TensorProgramming 5 жыл бұрын
See the pinned comment.
@luisr1421
@luisr1421 4 жыл бұрын
Hey man. I am (probably) confused. What you’re doing here is creating a GRPC server and then a GRPC client that is able to talk to that server and expose data via REST?
@ajk7151
@ajk7151 3 жыл бұрын
excellent video!
@samighasemi3333
@samighasemi3333 3 жыл бұрын
Great tut
@pc2753
@pc2753 4 жыл бұрын
I'm caught between this go grpc stuff and phoenix liveview. I appreciate it's a bit like comparing apples and oranges but I want to start a new project for my github resume and want to know which you suggest I start with. I can't bear json restful, I come from a c++ desktop background so both grpc and websockets seem a much better way forward. Just your thoughts on this really please.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
With both you can setup websockets and serve your data (GRPC can be restful and LiveView is all about phoenix channels). If you really want something that is graphically focused then liveview is really the way to go. And if you don't want to have to mess with JavaScript frameworks; then I also recommend LiveView. On the other hand, you could do a stack with go GRPC as the main backend and some JS frontend framework if that's the style you prefer.
@empaguia
@empaguia 3 жыл бұрын
in 1:40, I extracted it on C:/Program Files/protocolbuffers, then I ran the protoc --version command but the protoc command is not recognized, how was that? where is the right path? well my Go directory is in C:/Program Files/Go and go run is working anywhere...
@TensorProgramming
@TensorProgramming 3 жыл бұрын
Its because you don't have the binary for protoc on your path variable where as Go must be if its working anywhere. Look in the protocol buffer folder and you should see a bin folder which has the proper executable in it. If you add that to your path variable then it will be globally available in any terminal/command line; otherwise you need to use the full path to it for the terminal to know what you are referring to.
@empaguia
@empaguia 3 жыл бұрын
@@TensorProgramming , ok thanks for the time answering, I will resolve that one issue'
@danielvega646
@danielvega646 3 ай бұрын
What I want to know is... Another company has a regular API on RESTful architecture, is it possible to send a POST request from my gRPC API? And if not, is it worth it the process of passing my gRPC request through some proxy that converts it into regular REST request and viceversa? The JSON response from the REST api is it worth it to translate it into protobuff for my gRPC API? Or I wouldn't notice an improvement in performance and just a regular REST APIs connection would be enough?
@TensorProgramming
@TensorProgramming 3 ай бұрын
You can call rest apis from a gRPC client via certain plugins. Theres one that lets you encode the data to/from Json. You won't get the advantages of using protobuf from these calls, but it doesn't add any extra overhead to a normal rest call. In other words, you don't really need to build your own logic for this, just use one of the many plugins.
@danielvega646
@danielvega646 3 ай бұрын
@@TensorProgramming wow, I must admit, I feel honored for receiving a response from you and so quickly! Really appreciate, master. gRPC feels so cool and I am just going through your go microservices series. And I was thinking... I have a microservices system: a client app that sends through graphQL requests to my main server which does of gateway for my microservices through gRPC and thus, my microservice that consumes a vendor REST API gets touched from gRPC. I was thinking... Well, I just need to do the regular REST JSON HTTP 1.0 POST request to the vendors API inside my microservice gRPC method, retrieve the response and propagate it back through gRPC to my gateway server and then it can answer to my client graphQL request. Does that architecture make sense? I am new to this, I am sorry if what I am saying sounds stupid.
@danielvega646
@danielvega646 3 ай бұрын
@@TensorProgramming Thank you so much for your response, I feel honored.
@TheFlareMind
@TheFlareMind 4 жыл бұрын
Can someone help me please? when i run the protoc command i'm getting the following error: 'protoc-gen-go' is not recognized as an internal or external command, operable program or batch file. --go_out: protoc-gen-go: Plugin failed with status code 1. I'm on Windows 10. I have my gopath set in my path. I have protoc installed.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Do you have the protoc-gen-go library installed? Make sure to run "go install google.golang.org/protobuf/cmd/protoc-gen-go" and make sure your gobin path is in your path variable.
@पापानटोले
@पापानटोले 4 жыл бұрын
Excellent. But can i develop the client without gin-gonic? Looks like Go needs lot of library support.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
No you really don't need gin-gonic nor does the language need a lot of library support. Go's standard library has tons of http stuff in it (along with many other useful things). I used gin-gonic because I haven't touched on any of the Go frameworks in any of my videos. You can look at the stdlib packages here: golang.org/pkg/
@hajidalakhtar
@hajidalakhtar 4 жыл бұрын
I LOVE YOU
@venil82
@venil82 3 жыл бұрын
if each field only takes 1 byte, how can you pack a whole in64 in it? isnt the number in proto file just a sequence number denoting position of field in a messsage?
@hieudoan7711
@hieudoan7711 3 жыл бұрын
i think he made a mistake by saying that. but the tag value (=1, ...) is used under the hook for serializing data by protoc
@Noctalo05
@Noctalo05 3 жыл бұрын
Hello, I'm kinda new with gRPC. I just created a server and client (java) but I can only connect them with 'localhost' + port. My goal is to connect a client from a PC other than mine to my server running on my computer). Do you know how to change 'localhost' to find my pc adress (connected by wifi) ? Or where can I find more information if it's more complicated ? thanks,
@TensorProgramming
@TensorProgramming 3 жыл бұрын
You can find all of this information in the gRPC documentation: grpc.io/docs/languages/web/basics/ Basically you are going to be serving over localhost on the server and then you forward the ports and assign the domain that you want to use.
@hubstrangers3450
@hubstrangers3450 5 жыл бұрын
Thank you for the content on the site, would like to know what happen to GO clips (2016) some of them are deleted...why? not the blockchain clips, the other title
@TensorProgramming
@TensorProgramming 5 жыл бұрын
A guy had stolen the content and re-uploaded it to his channel. I submitted a copyright strike to KZbin and they apparently applied it to his channel and also my videos. I am fighting to try and get them back up but who knows at this point.
@hubstrangers3450
@hubstrangers3450 5 жыл бұрын
lol... wonder why he did what he did, by way, thanks for explanation behind the code lines, few folks tend offer that for their respective tutorials.@@TensorProgramming
@TensorProgramming
@TensorProgramming 5 жыл бұрын
@@hubstrangers3450 He did it because he wanted to make money off of my content. I didn't really care that he reuploaded my content; the problem was that there were people who were looking for the source code and they couldn't find it.
@georgelza
@georgelza 3 жыл бұрын
hmm, getting the below message on the client. client\main.go:24:3: g.Get undefined (type *gin.Engine has no field or method Get)
@georgelza
@georgelza 3 жыл бұрын
ignore, resolved :) g.Get g.GET
@devnetindonesia9716
@devnetindonesia9716 3 жыл бұрын
thx a lot
@vincentyoumans
@vincentyoumans 4 жыл бұрын
what about returning slices of structs and structs in structs// . for GoLang. What would the Protofile look like and how would they be addressed?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
You should checkout the syntax rules for protobuf: developers.google.com/protocol-buffers/docs/proto3 You can use the repeated keyword to specify that you want to return multiple items of the same type with the same name. If you wanted to return a slice of a struct, you would define the struct in the protobuf and then wrap it in another message marking it as repeated.
@codelucky
@codelucky 5 жыл бұрын
Can you make a series on it? Please, make a series on Golang gRPC to build modern API & Microservices.
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Eventually I will be doing microservices but its a bit more complex then a single video.
@codelucky
@codelucky 5 жыл бұрын
@@TensorProgramming Ya that's why I asked you to make a series of tutorials like multiple videos under a playlist. That would be cool if you cover from basics of gRPC to creating complex APIs with it in Golang.
@supergirl4817
@supergirl4817 5 жыл бұрын
that's a great idea.... even am looking for a full course on grpc in Go. You should create it... I will share the videos with my 25k Twitter followers (mostly devs) and 115k IG followers (general people, 50% douche & 50% students).
@ganeshkamble9078
@ganeshkamble9078 4 жыл бұрын
How can we do the performance test for such implements with one of load test tools like jmeter/loadrunner?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
You'd just make an interface and use them. I recommend checking out their documentation for more info.
@ganeshkamble9078
@ganeshkamble9078 4 жыл бұрын
@@TensorProgramming Thank you, I will go through its documentation. Hope i will get my solution.
@nishantpatil9005
@nishantpatil9005 5 жыл бұрын
can you help me with this,, its coming while running the server cannot find package "grpc_tutorial-master/proto" in any of: C:\Go\src\grpc_tutorial-master\proto (from $GOROOT) C:\Users ishantpatil\go\src\grpc_tutorial-master\proto (from $GOPATH)
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Check to see the module name of the generated proto file and make sure that its correct.
@nishantpatil9005
@nishantpatil9005 5 жыл бұрын
@@TensorProgramming Actually My project wasn't inside src folder.. that was the cause
@TensorProgramming
@TensorProgramming 5 жыл бұрын
@@nishantpatil9005 You should use the module system; it simplifies these potential problems.
@haI9k
@haI9k 3 жыл бұрын
If I am honest this library is a nightmare, nothing works the same as it was at the moment when this video was recorded.
@TensorProgramming
@TensorProgramming 3 жыл бұрын
To be fair the video was recorded about a year ago. Most of the API should be similar though I am sure some stuff has changed since then.
@shubhamagarwal2959
@shubhamagarwal2959 3 жыл бұрын
Can I Call my gRPC function of server directly from Angular 10
@TensorProgramming
@TensorProgramming 3 жыл бұрын
You would need a grpc client. Dunno personally about whether or not angular has such a thing.
@pheadrim
@pheadrim 4 жыл бұрын
Hope you can help me, I'm stuck on generating the go files. My command is now: $ protoc --proto_path=proto \ --proto_path=third_party \ --go_out=plugins=grpc:proto service.proto And it keeps coming back with the error message: Missing output directives.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Did you put the include files in the third_party folder? If so, try reinstalling protoc and see if that helps. Also, can't tell if you are using double dashes or single dashes. Each one should be a double dash.
@ThePandaGuitar
@ThePandaGuitar 5 жыл бұрын
Thanks for the video. My question to you, what's the point of using Protobuf and gRPC if you're going to be using endpoints and JSON?
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Well this particular example is a case where you might want to have two individual microservices on the same machine or on multiple machines and then you want to serve the data through a RESTful API. You could always not use the JSON endpoints and make a client that just uses the data. While this example is fairly contrived, I have built systems that have similar architecture in the past. A service that deals with a database, a service that deals with the business logic on a server, a service that serves content through nodes and a client. Its a pretty common architecture pattern with microservices that are service some data or service to other devs/users.
@ThePandaGuitar
@ThePandaGuitar 5 жыл бұрын
@@TensorProgramming Very helpful! Thank you very much, subscribed!
@erstaples1
@erstaples1 5 жыл бұрын
@@ThePandaGuitar I believe it's just for demo purposes. You might also ask why go through all the trouble to set up a basic math API when any computer can do those ops - because demo. Also, you might want to check out gRPC Gateway if you want to set up a json proxy.
@mustache2295
@mustache2295 4 жыл бұрын
So, basically, I'm a noob and all this pretty much went over my head. What knowledge serves as a prerequisite in understanding this material? I've only recently started studying programming and such but mostly I've been studying web development. As of now I've only reached JavaScript after learning HTML and CSS. I've also learned a bit of Python but truthfully still at a very basic level for it all, really. I've also just learned about API's and have been researching them since TechLead says that coding is so "10 years ago" and that you should be using API's and I'm not really sure what he means. After some time researching API's I am still rather confused as to how it fits into the puzzle of programming. Can you help me understand this a little better? I apologize for any vague language I may be using. As I said, I'm very new to programming and I'm just trying to improve my understanding of the technologies before me in order to make an informed decision on the skills I should be focusing on. Thanks, Ian
@TensorProgramming
@TensorProgramming 4 жыл бұрын
You probably shouldn't listen too much to what techlead says. That guy tends to be hypercritical/hypocritical and hes opinions generally are not very relevant for the average developer. If you want to learn about RPCs and APIs, I recommend that you look into the basics of building servers and the difference between client and server side architecture. There are many different ways to structure a web app; you can build serverless apps, client side progressive web apps, servers with API endpoints that feed into multiple clients, servers that use server side rendering with small clients etc. APIs and more generically RPCs just serve the purpose of connecting one application to another. They are interfaces that define how an application can access some data from another application. When you get on a website like Facebook or Google, your browser accesses a client facing web application which renders out the user interface (Html/Css etc) and that app fetches data from multiple APIs to allow you to do things. There are also many different types of APIs that you can use; GraphQL, Rest, Restful, SOAP, Json-RPC, Proto-RPC etc. Start with something small; for instance, you can look at my Go playlist and follow along with the Wiki series (its old but most of it should still be relevant) or you can find whatever other resources are out there for building basic web applications. Good luck
@mustache2295
@mustache2295 4 жыл бұрын
@@TensorProgramming Thanks a ton for such a well put together response to my question. I will look into your playlist for a better understanding!
@kudoamv
@kudoamv 4 жыл бұрын
Hi, When I generated .pb.go file it did not automatically made the interfaces part of the code you are showing in your video. What should I do now?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Which interface are you talking about specifically?
@kudoamv
@kudoamv 4 жыл бұрын
@@TensorProgramming 10:00 AddServiceClient interface and all the other stuff after that was not generated for me. thanks for such quick response.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
@@kudoamv It seems that the old command that I was running with the new protoc compiler doesn't produce both the server and client interfaces. so instead of running that command, run this command: protoc -I proto\ proto\service.proto --go_out=plugins=grpc:proto Basically -I tells it to get the include directory, then you pass in the dir with the proto files in it and the protofile path and then you specify that you want grpc as a plugin and point it at your dir again.
@kudoamv
@kudoamv 4 жыл бұрын
@@TensorProgramming Oh yeh, protoc -I=proto proto/service.proto --go_out=plugins=grpc:proto worked for me. I was doing "protoc -I=proto --go_out=proto proto/service.proto" before, as it was mentioned in the docs. I still could not understand what "plugins=grpc:proto" does?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
@@kudoamv The plugin tells the compiler that you want to generate code using the grpc library and when you specify proto in this case, its just the folder that your protobuffers are inside of.
@ThanhVu-eo2lj
@ThanhVu-eo2lj 4 жыл бұрын
Hi Tensor Programming. Please let me know what is your font and themes name. Thank you. Your video is awesome
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Fira code with font ligatures and spacemacs dark theme.
@ThanhVu-eo2lj
@ThanhVu-eo2lj 4 жыл бұрын
@@TensorProgramming Thank you very much
@poterior1314
@poterior1314 5 жыл бұрын
excuse me, why do we need `plugins` and `grpc` into `--go_out=plugins=grpc:proto`
@TensorProgramming
@TensorProgramming 5 жыл бұрын
protobuf isn't grpc. We use the plugin to tell the protobuf compiler that we want it to generate for grpc.
@dumike2388
@dumike2388 5 жыл бұрын
love your commandline tool, could you share the link of the cmd. LOL
@TensorProgramming
@TensorProgramming 5 жыл бұрын
Its just Cmder. cmder.net/
@atharvchinchkar1100
@atharvchinchkar1100 Жыл бұрын
bro can u make a video for whole algo trading with grpc
@TensorProgramming
@TensorProgramming Жыл бұрын
maybe at some point. Algo trading is more of a trading topic though than a programming topic; so its not really all that interesting for this channel. I could however do a series on building a matching engine given I have a ton of experience in that though.
@MukulMalviya
@MukulMalviya 4 жыл бұрын
Best
@rishikeshkumar490
@rishikeshkumar490 2 жыл бұрын
Please write an example code for a simple Server and Client program in Visual Studio 2019 using C++ language using GRPC calls. Please explain how to solve grpc/protobuf library dependency.
@TensorProgramming
@TensorProgramming 2 жыл бұрын
Sorry, I don't cover C++ on this channel, nor do I use Visual Studio... You can find examples in C++ on the gRPC documentation page and in github. C++ doesn't have an auto include package manager like Go or Rust do, so you are going to have to use something like Bazel or make/cmake to include the protobuffer.
@michaeladeyeri5982
@michaeladeyeri5982 5 жыл бұрын
Please, what's the name of your VS Code proto extension?
@TensorProgramming
@TensorProgramming 5 жыл бұрын
The syntax extension that I am using is called vscode-proto3
@ariseyhun2085
@ariseyhun2085 3 жыл бұрын
Has anyone ever told you that you mistake forward-slash with back-slash? lol
@TensorProgramming
@TensorProgramming 3 жыл бұрын
yeah get it plenty. Its a side effect of being dyslexic.
@atultiwari9326
@atultiwari9326 3 жыл бұрын
I am new, but how is this any easier than CORBA or REST!!!!!!!
@TensorProgramming
@TensorProgramming 3 жыл бұрын
Well first, Rest is not really comparable to gRPC. But Cobra is similar in some ways, though its much larger. Cobra is an objected oriented framework with a huge set of features and flexibility for distributed computing, gRPC is just a remote procedure call framework based on http/2 and protobuf. Cobra is more opinionated and gRPC is not.
@ackeejag
@ackeejag 4 жыл бұрын
Great video but why have all of these packages gone towards single letter meaningless method names!? Why be complicated on purpose!?
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Not sure what you mean, give me an example...
@DheerajKumar-lc9tx
@DheerajKumar-lc9tx 3 жыл бұрын
Hi, can you share unit tests for the code.
@TensorProgramming
@TensorProgramming 3 жыл бұрын
I didn't write any unit tests for this code. It was all live coded like all of my tutorials, so what you see is what you will get in the repo.
@kosnowman
@kosnowman 4 жыл бұрын
hey the content is nice and clear, but please don't just paste and the code and talk, it was very hard to follow, apart from that nice tutorial
@devashishkhandelwal1009
@devashishkhandelwal1009 4 жыл бұрын
His Voice sounds so computerised and autotuned for some reason
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Hmm, might have been my mic but no its my natural voice.
@pc2753
@pc2753 4 жыл бұрын
He's lying. His name is not Tensor.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
Of course my name isn't tensor, its just a pseudonym.
@pc2753
@pc2753 4 жыл бұрын
@@TensorProgramming well obviously. Never mind, we all have a different sense of humour.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
@@pc2753 Oh I know, don't worry, I like to take the sails out of these kinds of jokes. My humor is very dry....
@pc2753
@pc2753 4 жыл бұрын
@@TensorProgramming oh I see what you're doing, very clever. Good content btw
@TensorProgramming
@TensorProgramming 4 жыл бұрын
@@pc2753 glad you like it. Cheers.
@NBGTFO
@NBGTFO 4 жыл бұрын
Ugh, Go is terrible.
@TensorProgramming
@TensorProgramming 4 жыл бұрын
oh? why do you think that?
Building a Chat app with Docker and gRPC
25:39
Tensor Programming
Рет қаралды 28 М.
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 276 М.
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 37 МЛН
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,6 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 44 МЛН
Bike vs Super Bike Fast Challenge
00:30
Russo
Рет қаралды 23 МЛН
Protocol Buffers Crash Course
36:07
Hussein Nasser
Рет қаралды 245 М.
Building Microservices with the Go Kit Toolkit
25:12
Tensor Programming
Рет қаралды 51 М.
How Data Validation Nearly Destroyed Protobuf
6:03
CompSciGuy
Рет қаралды 3,1 М.
gRPC Crash Course - Modes, Examples, Pros & Cons and more
1:19:38
Hussein Nasser
Рет қаралды 230 М.
Building a Basic RPC Server and Client with Go
19:44
Tensor Programming
Рет қаралды 47 М.
13 Introduction to gRPC and Protocol Buffers
32:07
Nic Jackson
Рет қаралды 59 М.
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 37 МЛН