How To Build And Structure A Microservice In Golang?!

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • ► Join my Discord community for free education 👉 / discord
    ► Become a Patreon for exclusive tutorials 👉 / anthonygg_
    ► Follow me on Twitter 👉 / anthdm
    ► Follow me on GitHub 👉 github.com/anthdm
    In this Golang tutorial, I'm going to show you my approach to building and structuring a microservice in Golang. So you can also start building microservices in Golang.
    #golang #microservices

Комментарии • 76

  • @anthonygg_
    @anthonygg_  Год назад

    ► Join my Discord community for free education 👉 discord.com/invite/bDy8t4b3Rz
    ► Become a Patreon for exclusive tutorials 👉 www.patreon.com/anthonygg_
    Thanks for watching

  • @eastquack3342
    @eastquack3342 Год назад +23

    I saw some other vids and at first I cringed at the "high value software engineer" stuff but the more vids I watch the more I realise he has a point; also, as far as I can tell, he is a seasoned gopher to say the least; this stuff is pure gold, so glad I stumbled upon this

  • @danielvega646
    @danielvega646 3 месяца назад +2

    Wow, that decorator design pattern on making the logger a wraper and the service the wrapee, was a brilliant move, loved it!

    • @danielvega646
      @danielvega646 3 месяца назад +1

      And on this example, you could repeat this pattern on the API, right? Implement the Start method and wrap it with the logger, so you can add a nice Listening on port :yourport

  • @0zema
    @0zema Год назад +18

    its not just about the bigger lesson in the video, your tips and hints - such as the defer trick with named returns - are valuable beyond reason!
    I'll say it again, I came for copper and I found gold!

    • @anthonygg_
      @anthonygg_  Год назад

      ❤️

    • @larrasket
      @larrasket Год назад

      IMO he really gives useful tips even for progophers

  • @typ0_cratz
    @typ0_cratz Год назад +8

    I love how straight to the point this video was. I just landed a go job, and I am looking for content that gets me up to speed with real-life examples like this. Thank you for making great content!

  • @bjugdbjk
    @bjugdbjk Год назад +7

    Ur channel differs from others in terms of " How you bring up real prod scenario's to explain the concepts" This s too good man !!
    Extremely helpful !!

  • @ezrahel
    @ezrahel 11 месяцев назад +2

    You got a subscriber man! I love how simple and straightforward this is. No drama whatsoever.
    But I have a request, please make a video on making microservices whilst working with frontend.

    • @anthonygg_
      @anthonygg_  11 месяцев назад

      Ty

    • @ezrahel
      @ezrahel 11 месяцев назад

      @@anthonygg_ what does Ty mean?

    • @anthonygg_
      @anthonygg_  11 месяцев назад

      Thank you
      @@ezrahel

  • @danijelpremus5177
    @danijelpremus5177 10 месяцев назад +1

    I think that most value of your tutorial is that you show how to think on another way (you simply made chain of services). Changing way of thinking is most difficult for us who are coming from another programming languages.
    Great work, Anthony.

  • @TechJunc
    @TechJunc Год назад +4

    9:40 till 9:43 "Only 10% of the Go devolopers know this stuff. Now you do also" Great video!

  • @ehiojehenryerabor6960
    @ehiojehenryerabor6960 6 месяцев назад

    I am awe struck at the level of your delivery. This has been so helpful. Thanks.

  • @jondoe79
    @jondoe79 Год назад +1

    The more I keep repeatedly watching the more new things I learn.... superb 👍

  • @mwnkt
    @mwnkt Год назад +2

    been watching your videos for months, and they are always informative, i'd really love to see you made a full where you write a full micro service, with microservices, caching and everything neccessary

  • @Ben-ej1xp
    @Ben-ej1xp Год назад +4

    I’ve been using node since 2011 and have defaulted to it literally for every backend. Prior to that I was objective C and C. I’ve just started with Go again - hate TS and node has got so bloated as an ecosystem. Go feels immediately comfortable and I see some similarities with my old iOS days. Your videos are very helpful 👍🏼

  • @petrhanzl8399
    @petrhanzl8399 Год назад +1

    Love the pace! As a Go dev. I look exactly for this kind of videos! Thanks dude

  • @AndreiTheDev
    @AndreiTheDev 3 месяца назад +1

    Doing some research for Golang with microservices and stumbled upon this video and I have 2 things to say about it:
    1. Great video, fast and on the subject
    2. Didn't know Zizou does programming in his spare time:)

    • @anthonygg_
      @anthonygg_  3 месяца назад +1

      Haha. The first time someone called my Zizou. Most of the time its GSP, Arjan Robben or Johnny Sins. Anyhow, I take Zizou each time of the day. Viva La France

  • @tpotjj2979
    @tpotjj2979 Год назад +2

    Great content as usual! Keep this quality coming🚀

  • @danielvega646
    @danielvega646 3 месяца назад +1

    Really professional and clean video!

  • @bjugdbjk
    @bjugdbjk Год назад +1

    💪u r a Champ !! u r the best Gopher from Golang RUclips Community !! Amazing Content.Kudos to uu brooo

  • @TheFourOnSix
    @TheFourOnSix Год назад +2

    Love the content. Love the attitude around building up yourself and career. Thank you for the inspiration.

  • @manfrombritain6816
    @manfrombritain6816 7 месяцев назад

    THISSS is the programming content I've been looking for. real-world application, project structure, higher level ans more abstract. other channels only blag on about algorithms and syntax which is only step 1

  • @bfkgod
    @bfkgod Год назад +1

    You are legit man! Great channel and content.

  • @TheSupahG
    @TheSupahG Год назад +1

    Anthony delivers again!

  • @efehanturhan6763
    @efehanturhan6763 Год назад +4

    you are a LEGEND

  • @amardeep6088
    @amardeep6088 2 месяца назад

    It was awesome. I am new to go and learned a lot of stuffs.

  • @DillPL
    @DillPL Год назад +4

    Very useful trick with defer :D
    The only issue I can see here is that interface Service (abstraction) uses struct CatFact at 2:15, which has annotation used by serialization tool.
    IMO when it is a part of Service API, it should not be coupled to specific network representation :p
    It breaks separation of concerns you mentioned at the beginning

    • @anthonygg_
      @anthonygg_  Год назад +6

      Hey! Very good point. I think the Service should just return a (string, error) so it is not coupled with the CatFact struct, which is actually part of the JSON transport layer. Thanks for reminding me! Very good catch.

  • @tintin537
    @tintin537 Год назад +1

    Greate content I've missed. Thank you

  • @suryakantasahoo9935
    @suryakantasahoo9935 Год назад +1

    Man your content is Gold🌟🌟

  • @nth-prog8562
    @nth-prog8562 Год назад +2

    Man u are the best. I like your voice)

  • @themichael8767
    @themichael8767 Год назад +1

    Thank You very much, Sir 🤍

  • @none_the_less
    @none_the_less Год назад +2

    I've just came from r/golang.
    Subscribed.

  • @jnchrlsbrq
    @jnchrlsbrq Год назад +1

    I didn't get how the new files are created on the fly using ":e" ...

  • @jinendrajain7672
    @jinendrajain7672 Год назад +2

    CFBR, Great video , keep it up Anthony

  • @webdevcoursestv
    @webdevcoursestv Год назад +1

    I’m generally down on micro, but I bet golang is perfect for this architecture

  • @jazzindo8545
    @jazzindo8545 11 месяцев назад

    this is awesome, can you recommend a framework/lib that does this approach as boilerplate?

  • @faizulla5838
    @faizulla5838 10 месяцев назад

    Everything looks beautiful and good, of course, BUT!
    What if I have 3-5 entities and each one needs a microservice?
    For example
    1 Authorization
    2User
    3 Supplier
    4Admin
    and everyone has a different entrance????
    Thank's Broo!

  • @radimkozl3270
    @radimkozl3270 Год назад

    Cool, very nice.

  • @louislane318
    @louislane318 Год назад +1

    Hi Anthony, I am new to go and sometimes wonder why you are using the design patterns (the use of structs, interfaces, and code pattern in general). Do you have a recommended resource that covers these patterns?

    • @anthonygg_
      @anthonygg_  Год назад +1

      Not directly, I will make video about this. But a lot of the decisions I make comes with experience.

  • @neilr99
    @neilr99 Год назад

    Is the code for this project on your GitHub? I like that it's a to-the-point example of a complete microservice that doesn't use gRPC. :-)

  • @cristianarmandofloresalvar5966

    Is it recommended to use the hexagonal arquitecture for a microservice?

  • @alexobzor
    @alexobzor Год назад

    i am new to golang, so i can't understand this concept on 9:14 with deferred lambda function in func(s *LoggingService) GetCatFact. I don't understand, how we get variables "fact", "err" in the lambda. I understand, that firstly we have execution of s.next.GetCatFact, but where do this lambda take this variables from.. Could you help me? 👉👈

    • @TinyTeaKettle
      @TinyTeaKettle Год назад +2

      He has declared named return types. Those act like variable declarations within your functions body. You're able to access variables of the outer scope of the lambda within the lambda itself (like you can in Java; in C++ you'd do that through capturing). The defer puts the function call on the stack that is "consumed" when the GetCatFact functions scope ends. So after the return statement. The statement of the return itself though yields the values for fact and err which are then consumed by the function on the defer stack.

  • @howtodoit7802
    @howtodoit7802 Год назад +1

    Which go framework do you advise a beginner to use

  • @poaleell
    @poaleell Год назад

    Спасибо!

  • @tomjones8293
    @tomjones8293 Год назад +1

    Why do you always say w wee ? is that Golang jargon ? Wee means little or an act of urinating in English just curious ..top content otherwise Anthony 👍

  • @InvincibleMan99
    @InvincibleMan99 Год назад

    Would you mind to share github code ?

  • @Dudarinho
    @Dudarinho 5 месяцев назад

    hilarious how half of inputs are incorrect and all the time is spent to rewrite written

  • @MakeAsPro
    @MakeAsPro 4 месяца назад +1

    If this video wos as "How I Structure New Projects In Golang" , it will soo mutch interesting & useful. This is boring

  • @soy7ent
    @soy7ent 8 месяцев назад +1

    Holy shit is it annyoing to watch. You type everything at least 2-3 times, your cursor jumps around 5x for each action... Doesn't mean your content is not good, it really is, but that lowers the quality so much for me as it's just stressful to watch.

    • @anthonygg_
      @anthonygg_  8 месяцев назад

      I agree. Thats already way better in my lasts videos. I can image its annoying. 😘

  • @bandinopla
    @bandinopla 3 месяца назад

    why you make mistakes every single keystroke you type. it is annoying...

  • @sunilanthony17
    @sunilanthony17 9 месяцев назад +1

    Love your videos but your typing is driving me nuts.

    • @anthonygg_
      @anthonygg_  9 месяцев назад

      Its driving me nuts also. 😓

    • @sunilanthony17
      @sunilanthony17 9 месяцев назад

      @@anthonygg_ We need to buy you a mechanical keyboard. :-) Thanks for all the GO videos, I came from C, C#, and Java but GO is my new favorite.

  • @BrunoRobertoReisAlves
    @BrunoRobertoReisAlves 10 месяцев назад

    This isn't a microsservice lol

  • @mayurupadhyay3216
    @mayurupadhyay3216 Год назад

    Thanks for the detailed explaination -- I am able to write many examples github.com/mayur2011/gokit-microservices