Talking Go with the Go God feat. AnthonyGG | Backend Banter 055

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ •

  • @WebDevCody
    @WebDevCody 5 місяців тому +7

    I watched Anthony and now I can run 6 miles every morning without sweating

    • @Unixgreybeard
      @Unixgreybeard 8 днів тому

      Real Q: Did @anthonygg discover a Go subroutine for getting younger? He definitely looks ~10 yrs younger in this than a 3 year-old vid I saw him in last 😳- Amazing, Go has that technology?! What is it, concurrency for a fountain of youth switch statement? ...Error handling so good you get pissed-off in reverse...?

  • @mitchellblair3935
    @mitchellblair3935 7 місяців тому +20

    You know Anthony is an OG when his intro is , "yeah I got into coding by making Call of Duty Clan websites as a teen".

  • @Regnum0nline
    @Regnum0nline 7 місяців тому +33

    I watched Anthony and now I can bench press 80 kg

    • @Go_with-Christ
      @Go_with-Christ 7 місяців тому

      Thats what my side hoe benches

    • @xmorse
      @xmorse 7 місяців тому

      This is not the flex you think it is

    • @dasdos002
      @dasdos002 7 місяців тому

      @@xmorsewith no training whatsoever? That’s not bad at all. Especially if you’re considering body weight.

  • @LukasRotermund
    @LukasRotermund 7 місяців тому +1

    20:22 I don't know if you already found a solution but within the AWS ECS world, you can just define a task that executes a special "task" and then dies.
    AWS ECS tasks can be compared to Kubernetes "Jobs" in the context of special migration tasks. With Kubernetes, you can create Jobs that run to completion and are triggered manually rather than automatically alongside other services. This allows you to run specific tasks like database migrations or batch processing without affecting the rest of your running services. It's a flexible way to handle one-time or periodic tasks separately from your main application workloads.

    • @LukasRotermund
      @LukasRotermund 7 місяців тому

      Or just use a lock via redis, so only one of your services runs the migration and defer remove the lock from redis

  • @covle9180
    @covle9180 7 місяців тому +8

    Db migrations should be backwards compatible in most cases. So don't delete columns, just mark them as nullable. (Remove them manually in the future a few versions down the line), make sure new columns have default values so that your old deployments can still continue to work.
    That way you can always safely deploy and rollback without destroying your db. Also rolling deployments can work now. For more complex migrations, accept the down time. But these cases should be rare.
    As for deploying migrations in k8s, you want to start a migration job first, separate from the deployment. Once that job finishes successfully, update the deployment.
    You definitely don't want race conditions in your db migrations. That is scary af.

    • @peterszarvas94
      @peterszarvas94 7 місяців тому

      great advice thanks!

    • @radicalcto
      @radicalcto 7 місяців тому +1

      The way I’ve done this in the past, have an environment variable for a migration instance, which solely runs the migrations.

    • @dandogamer
      @dandogamer 7 місяців тому

      Separating app from migrations sounds like good advice thanks

  • @KuzyoYaroslav
    @KuzyoYaroslav 7 місяців тому

    Enjoining those podcasts, keep up great work. Thanks Anthony for his tutorials too.

  • @dandogamer
    @dandogamer 7 місяців тому

    I tend to have a docker-compose with 2 services. One that runs the migration script then the other one that starts the app when the migrations have completed.

  • @JT-mr3db
    @JT-mr3db 7 місяців тому

    27:12 It's like a fake sum type, and it's a great pattern! This is how http errors are handled in Elm as well. The sucky thing about it in Go is you need to opt in to wrapping your values in these interfaces, much like the "Effect" package for javascript, a great pattern, but at the end of the day it's a wrapper.

  • @ArturdeSousaRocha
    @ArturdeSousaRocha 7 місяців тому +1

    The episode everyone was waiting for. 😊

  • @fletchercutting7301
    @fletchercutting7301 7 місяців тому +3

    In terms of your migration race condition problem, I personally think it's because you're running the migrations on service startup. At my work we run our migrations as part of the CI/CD. After all our tests have run, docker images get built, then the very last thing is migrations are run and then docker images get deployed to the cluster. That way it only happens once and doesn't even require a microservice.

    • @moveonvillain1080
      @moveonvillain1080 6 місяців тому

      But what about the version out of sync problem that he mentioned.... Like pod deployment fails but the migration is successful? Just curious to know what happens in that case

    • @fletchercutting7301
      @fletchercutting7301 6 місяців тому

      @@moveonvillain1080 We make our migrations backwards compatible and that if our migration runs but the new pods don't spin up, the old ones will still work as normal. For bigger changes in our datase (like changing the name of a column) we do it in multiple steps and even support two different columns at the same time until the old one is decomissioned.

  • @br3nto
    @br3nto 7 місяців тому

    20:51 in the opposite. Manual migrations make me soo nervous. I’m slow and what if I f up? I’ll be slow to unwind. Automated migrations are fast and precise… exactly as programmed.

  • @zyr4c31
    @zyr4c31 7 місяців тому +2

    Why not gitignore the generated sqlc code and have air run the sqlc command?
    In any case I don't think sqlc is perfect but it definitely speeds up development. Thanks for all the go content.

    • @andreffrosa
      @andreffrosa 7 місяців тому

      He was still a timmy back then

  • @Andy-ou8ni
    @Andy-ou8ni 7 місяців тому +5

    technically, he has a CS degree. (Counter Strike)

    • @rubyciide5542
      @rubyciide5542 6 місяців тому

      I have a Counter Science degree

  • @trietang2304
    @trietang2304 7 місяців тому +12

    docker compose, makefile, air, htmx with go template make me feel so productive in go

    • @cariyaputta
      @cariyaputta 7 місяців тому +1

      Nice pipeline, but adding air is bloated.

    • @thisbridgehascables
      @thisbridgehascables 7 місяців тому

      I use a similar setup for my go work.

    • @trietang2304
      @trietang2304 7 місяців тому

      @@cariyaputta Do you suggest any alternative? I'm not that good at frontend so auto reload is pretty helpful for me.

    • @cariyaputta
      @cariyaputta 7 місяців тому

      @@trietang2304 if your app already using docker then you can just use compose watch.

    • @MrDadidou
      @MrDadidou 7 місяців тому

      use magefile/mage instead of make for your go apps, it's a banger

  • @StingSting844
    @StingSting844 7 місяців тому

    For the DB race condition issue you can take a couple of approaches:
    1. Bring down all services and start one after the other (downtime)
    2. Do a rolling deployment. There are multiple issues in this. Two different pods with different schemas can run simultaneously. You can maintain a schema version table to handle this at the app layer. The new pods should process requests only according to the correct schema version.
    3. Offload schema handling to PostgreSQL's ALTER command. This will ensure old and new schemas active at the same time

    • @backendbanterfm
      @backendbanterfm  7 місяців тому

      Ah, very good, very good

    • @andreffrosa
      @andreffrosa 7 місяців тому +1

      You can also run an helm hook to migrate before deploying the new pods

    • @StingSting844
      @StingSting844 7 місяців тому

      @@andreffrosa yes I just know these few basic techniques

    • @loweschmidt3810
      @loweschmidt3810 7 місяців тому +2

      Or use an init container that does the migration, and only do a rolling deploy with a max of 1.

    • @Patmorgan235Us
      @Patmorgan235Us 7 місяців тому

      Could also elect a "leader" pod responsible for migrations

  • @Rcls01
    @Rcls01 Місяць тому

    Dude has the same origin story as I did. CS, gaming, websites, Drupal and PHP, later consulting and Golang

  • @wmendezt
    @wmendezt 7 місяців тому +1

    Migrations: your changes should not break the existing code, you should be able to have two code versions running at once. That goes beyond databases but to all external services

  • @adriancaor
    @adriancaor 7 місяців тому +2

    I watched Anthony and now I can do lateral raises with 80kg

  • @anicolaspp
    @anicolaspp 2 дні тому

    Context.Background only in composition root of the app

  • @RA-xx4mz
    @RA-xx4mz 7 місяців тому

    I remember when Dreamweaver CS2 was a god tier editor. Could push to straight to the server from the FTP tab or whatever. Shit was nuts.

  • @codingwithmat
    @codingwithmat 7 місяців тому +8

    compaany - love his accent!

    • @dionverbeke1975
      @dionverbeke1975 7 місяців тому

      Come to belgium, everybody speaks like that here...

    • @liu-river
      @liu-river 7 місяців тому

      @@dionverbeke1975 what's up with the 'ish' at the end of some words? for example, 'hereish', lol

  • @beertrader9385
    @beertrader9385 7 місяців тому +2

    I was wondering when this would happen!

  • @abdelilahou2822
    @abdelilahou2822 7 місяців тому +2

    Lets gooooooo, Im surprised you brought anthony ❤

  • @dixztube
    @dixztube 7 місяців тому

    Bun has a router too. I’m using it and it’s pretty nice. I’ve enjoyed their orm as well.

  • @interstellar1873
    @interstellar1873 7 місяців тому +2

    Finally 🥂

  • @emuzehh
    @emuzehh 7 місяців тому +2

    you need to do a rollout deployment in kubernetes for your race condition issue, it’s not a postgres issue

    • @ark_knight
      @ark_knight 6 місяців тому

      He nevere said its a postgres issue or a goose issue. He just wondered how he could tackle it and if the goose team knows about it.

  • @j.r.r.tolkien8724
    @j.r.r.tolkien8724 7 місяців тому

    This is a good show.

  • @jspnser
    @jspnser 7 місяців тому

    we need anthony course on bootdev, lets make it

  • @meni181818
    @meni181818 7 місяців тому

    migrations is a thing for ci/cd pipeline

  • @thisbridgehascables
    @thisbridgehascables 7 місяців тому

    Magento which is now Adobe Commerce .. is still going strong. I do a lot of Magento 2 development and it can be a nightmare. Lol

    • @zyr4c31
      @zyr4c31 7 місяців тому

      It's a good experience but the way they built up the framework honestly sucks

  • @ChadRStewart
    @ChadRStewart 7 місяців тому

    Anthony 100% has a CS Degree, with a concentration in head shots!

  • @anicolaspp
    @anicolaspp 2 дні тому

    This is why your API should be done with RPC services

  • @JT-mr3db
    @JT-mr3db 7 місяців тому

    After watching Andrew I have started adding 'esh' to the end of every word.

  • @nafakirabratmu
    @nafakirabratmu 7 місяців тому

    X stands for eXperimental and not eXtended

  • @erictrinque6513
    @erictrinque6513 7 місяців тому

    LeGGendary GG Tony

  • @kulvir.07
    @kulvir.07 7 місяців тому

    Anthony Huge W guy!!

  • @s1dev
    @s1dev 7 місяців тому

    he is the coolest gg

  • @siestoelemento1019
    @siestoelemento1019 7 місяців тому

    banger

  • @xregularxjohnx
    @xregularxjohnx 7 місяців тому +1

    liquibase ftw

  • @JLarky
    @JLarky 7 місяців тому +2

    What Is This, a Crossover Episode?

  • @SyntaxErrorz1
    @SyntaxErrorz1 7 місяців тому

    I didn't know George St. Pierre is a programmer

  • @Paddy-McNasty
    @Paddy-McNasty 7 місяців тому +1

    Oh shit

  • @anicolaspp
    @anicolaspp 2 дні тому

    Generics only for low level APIs

  • @monkeyDluffy-sd3zp
    @monkeyDluffy-sd3zp 7 місяців тому

    go god 😂 nice title

  • @colbyberger1881
    @colbyberger1881 7 місяців тому

    K8s, golang, http, and I'm good

  • @pythagoran
    @pythagoran 7 місяців тому +1

    Should've mentioned ELIXEEEERRR

  • @pookiepats
    @pookiepats 7 місяців тому +3

    I tried this guy’s course and got a refund, could have been me could of been the teaching style-cool guy but would recommend a trial first make sure the style works for you.
    It is fine for UA-cam videos but i never expected that for a formal course but that’s on me.

  • @victormadu1635
    @victormadu1635 7 місяців тому +1

    YavaScript

  • @duke605
    @duke605 7 місяців тому

    As someone currently working on a magento project... ya... it fucking sucks

  • @el_chivo99
    @el_chivo99 7 місяців тому +1

    this is a weird podcast episode. you jump right into niche questions about the Go db migration tooling you use and problems you’ve run into in prod. you’ve trying to leverage his expertise to solve your own problems instead of learning about his experience

    • @jeffreysmith9837
      @jeffreysmith9837 7 місяців тому

      I don't see it like that. Go lacks opinions so it's cool to see how people handle things. I often wonder how others handle migrations, passing user context around, dependency injection, etc.

  • @Dekutard
    @Dekutard 7 місяців тому

    love the show but man that has to be the worst intro theme song ever