pssst... I'm using Go in my side project now

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • Become a YT Members to get extra perks!
    www.youtube.co...
    My Products
    💀 Scary Story Generator: scarystorygene...
    🏗️ WDC StarterKit: wdcstarterkit.com
    📖 ProjectPlannerAI: projectplanner...
    🤖 IconGeneratorAI: icongeneratora...
    Useful Links
    💬 Discord: / discord
    🔔 Newsletter: newsletter.web...
    📁 GitHub: github.com/web...
    📺 Twitch: / webdevcody
    🤖 Website: webdevcody.com
    🐦 Twitter: / webdevcody

ความคิดเห็น • 85

  • @ZanarkandStarplayer
    @ZanarkandStarplayer 2 วันที่ผ่านมา +42

    These are my favorite types of videos. I love hearing the design decisions and justifications on why someone picked something.
    Great job Cody

  • @SeibertSwirl
    @SeibertSwirl 3 วันที่ผ่านมา +30

    Some of the main things that will cost you money… is a wife lol it’s me, hi, I’m the problem it’s me. Lol love you babe! You’re doing a great job

    • @kazmi401
      @kazmi401 2 วันที่ผ่านมา +4

      He’s switching to Golang to save costs, but still keeping the premium Wife plan. Must be worth every penny!

  • @al3030
    @al3030 2 วันที่ผ่านมา +6

    Great video. Nice to see you come back to GO. It’s very efficient for such backend work.

  • @yassinesafraoui
    @yassinesafraoui 2 วันที่ผ่านมา +4

    It's important to note that you have to make sure ressources have unique ids because there is no way to invalidate cloudflare cache afaik

  • @xoutaku7600
    @xoutaku7600 2 วันที่ผ่านมา +6

    set your proxy so it only only accepts requests through the cloudflare cdn , either directly in the proxy code or through the server firewall if the cdn has a static dns entry you can take advantage of

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา +2

      I could probably just setup a firewall on the docker image itself

  • @beemkhan
    @beemkhan 2 วันที่ผ่านมา

    I've watched a lot of your content, this is exactly what i expect a good engineer to share, youve looked at tech with your own initiative and shared the knowledge with everyone. Very much appreciated. Thank you

  • @alessioragonesi8549
    @alessioragonesi8549 3 วันที่ผ่านมา +3

    To avoid ddos on the go proxy you can block direct ip access over http to your server. I remember it being an option for a wordpress website with cloudflare so there has to be a way to do it outsided of wordpress too.

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      @@alessioragonesi8549 I think I could only allow cloudflare ip address as well

  • @joeyywill1234
    @joeyywill1234 3 วันที่ผ่านมา +26

    so what is the go proxy actually doing?

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +25

      I’m not sure

    • @ali2kan
      @ali2kan 3 วันที่ผ่านมา +2

      from my understanding from the video, wasn't he using the proxy to route client requests to the db?

    • @sama7496
      @sama7496 3 วันที่ผ่านมา +1

      same here i didn't get it too

    • @the-engineer-r4j
      @the-engineer-r4j 3 วันที่ผ่านมา +3

      The proxy is just being used as a way to request files from the DB without having direct frontend => DB requests

    • @mohamedElbadwi-k5f
      @mohamedElbadwi-k5f 3 วันที่ผ่านมา +1

      I think just to save bandwidth streaming those videos with js is expensive

  • @vhhhus
    @vhhhus 3 วันที่ผ่านมา

    good job mate, love it

  • @damonguzman
    @damonguzman 2 วันที่ผ่านมา +2

    This is peak, “I built because I could not because I should.”

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา +1

      Isn’t it fun?!

  • @agb2557
    @agb2557 2 วันที่ผ่านมา

    Thanks for you videos!
    It would be great so know how you organise your various services and any config in github repos. Is this a monorepo?

  • @eip408
    @eip408 2 วันที่ผ่านมา

    noice good to see you back using go hahaha

  • @dheerajs2838
    @dheerajs2838 2 วันที่ผ่านมา

    this is great.. I always wonder about this... fantastic.. do you have a video on how to deploy such setup?

  • @aaronstanton1259
    @aaronstanton1259 2 วันที่ผ่านมา +4

    6:23 "yoo-id" 💀

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      yoooooouuuuuuu-id

  • @briangugi
    @briangugi 2 วันที่ผ่านมา

    Imagine cody as your Project Manager.

  • @hhwjsw711
    @hhwjsw711 3 วันที่ผ่านมา

    From now on, I am a Cody disciple

  • @shahzaibshahzaibkhan6480
    @shahzaibshahzaibkhan6480 2 วันที่ผ่านมา

    Are you using the UI with a docker image? In my experience, if you dockerize your next app, it brings down the memory usage to somewhere around 80-120MBs atleast in my case, thought it would be usefull

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      Yes I am

    • @shahzaibshahzaibkhan6480
      @shahzaibshahzaibkhan6480 2 วันที่ผ่านมา

      @@WebDevCody the node:alpine image or the other one? The alpine one is the one that I used

  • @notgiorgi
    @notgiorgi 2 วันที่ผ่านมา +1

    When hosting nextjs on Railway, does it basically just run on a long-running express server?

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา +1

      yes, it's a stateful container

  • @Steel0079
    @Steel0079 3 วันที่ผ่านมา +1

    Hi, why didn't you use something like nginx? Is it because you are using convex?

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +1

      I need to hit an endpoint to convert an id. I don’t think nginx can run logic? I can also potentially add auth checks in the proxy if I want

  • @abhishekmehandiratta4241
    @abhishekmehandiratta4241 2 วันที่ผ่านมา +1

    Why not just have cloudflare cdn in front of convex static asset urls?

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      because I wasn't sure if someone would be able to figure out my convex project id via websocket events and then by pass cloudflare directly to hit my convex.cloud url directly. that did cross my mind, convex has the ability to setup custom domains, so technically I could just point cloudflare to convex via a domain, I just went with this approach first and didn't think too hard about it.

  • @y.m.o6171
    @y.m.o6171 2 วันที่ผ่านมา

    Hi Cody. I think you could do better by not reading all the file content in one shot. I see that you are using ReadAll. There are maybe better ways to stream that with i think a tee in go. cant remember what is called but it allows you to tie one buffer and reader and let the magic happen. I will look it up and see if i can find it

    • @y.m.o6171
      @y.m.o6171 2 วันที่ผ่านมา

      th-cam.com/video/8z6okCgdREo/w-d-xo.html
      this is a great talk about many details in how to build a proxy in go. so io.Copy should do what you want. if you need to do more processing `io.TeeReader` will do what you want if you need more complicated logic

  • @raideez
    @raideez 2 วันที่ผ่านมา

    So next.js wasn't just able to handle ur requests without consuming lots of bandwidth? So you added go backend to do the video requesting?
    For heavy loads its always recommended to have seperate backend.

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      I'm not too sure what was going on. There was two things I needed to debug. Was it the tunnel causing issues, was it next.js, or was it my javascript implementation. Overall I decided to instead just use a simple go proxy since I knew it would use little memory and run fast.

  • @codingislove3707
    @codingislove3707 2 วันที่ผ่านมา +1

    Always feels wrong to press like if the like count is 69... but great information as always.

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา +2

      You dirty dog you

  • @guyhazut9459
    @guyhazut9459 2 วันที่ผ่านมา

    where can you learn this stuff?

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd 2 วันที่ผ่านมา

    ❤❤

  • @sid4579
    @sid4579 2 วันที่ผ่านมา +2

    bro can't make his mind

    • @Alex-bc3xe
      @Alex-bc3xe 2 วันที่ผ่านมา

      Yes he s all around once he says one thing than he contradicts himself so often can’t trust him for sure

    • @Tekapeel
      @Tekapeel 2 วันที่ผ่านมา

      @@Alex-bc3xe Because smart people are always learning and when confronted with something that challenges their current conception are not only willing but happy to change their mind and embrace new information if it benefits them, their project or their users. And yes, if you can't read between the lines, I am suggesting that you two might not be smart people.

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา +3

      what's there to trust? I said in my previous videos Go is good solution for an api; I'm using it for an api proxy.

  • @davidsiewert8649
    @davidsiewert8649 3 วันที่ผ่านมา

    Has somebody already found out the ip of the go proxy?

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      @@davidsiewert8649 127.0.0.1

  • @saurabh9446
    @saurabh9446 2 วันที่ผ่านมา

    You're calling go proxy instead of cloudflare and getting files from cloudflare for a hit, how? Shouldn't u make request to the cloudflare?

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      The diagram shows ui makes a request to cloudflare, cloudflare hits proxy, proxy hits
      File storage

    • @adrian110288
      @adrian110288 วันที่ผ่านมา

      @@WebDevCody How do you tell cloudflare to go to the proxy? I am new to this

    • @WebDevCody
      @WebDevCody  วันที่ผ่านมา

      @@adrian110288 cloudflare is also a proxy, so it’ll route requests using a cname record

  • @SeibertSwirl
    @SeibertSwirl 3 วันที่ผ่านมา +3

    First!

  • @joeyywill1234
    @joeyywill1234 3 วันที่ผ่านมา

    SECOND!

  • @sergeyagronov9650
    @sergeyagronov9650 วันที่ผ่านมา

    basically free .... until they decide to shutdown your app 🤣🤣🤣

    • @WebDevCody
      @WebDevCody  วันที่ผ่านมา +1

      live on the edge

  • @CarlosDuque-e3j
    @CarlosDuque-e3j 23 ชั่วโมงที่ผ่านมา

    Hi Cody, I was wondering why do you need the proxy. Is it because you can't send a request directly from cloudflare to convex?
    Also, pretty cool video. I really like seeing this kind of system design videos that are not only explain the parts of the system but rather contextualize in a real project how they work.

    • @WebDevCody
      @WebDevCody  23 ชั่วโมงที่ผ่านมา +1

      I think the issue is that if someone knows my convex project id, they could potentially hit my convex http endpoint directly to download files and bypass cloudflare which would mean a larger bandwidth charge. I wasn’t sure if that project id was exposed anywhere in when someone loads up the convex client and starts sending web socket events. Basically I abstracted convex away from the user entirely in regards to files to keep all that hidden. Nothing can download files from convex except my go proxy.
      Maybe it’s over engineering, but I don’t want a silly ddos from a yt hater to run up my bill.

    • @CarlosDuque-e3j
      @CarlosDuque-e3j 22 ชั่วโมงที่ผ่านมา

      ​@@WebDevCody That makes sense, thanks for explaning that. It's sad you gotta worry about that stuff because of haters but I guess it makes you think more about security, which makes your project more "professional" if you will.

  • @crustydev5561
    @crustydev5561 2 วันที่ผ่านมา

    Doesn’t cloudflare frown on using the cdn for videos?

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      I can’t find where they say that

    • @jimbin93
      @jimbin93 วันที่ผ่านมา

      @@WebDevCody They emphasize multiple times that you shouldn’t serve most of your video cache. Content like HTML, JS, and CSS is acceptable, but for videos, they recommend using Cloudflare Streaming. You can find more information in Cloudflare's Terms of Service and forums. That’s my two cents!

  • @Oldbettie
    @Oldbettie 3 วันที่ผ่านมา

    Actually was load testing railway the other day it seems to not like sending images or videos from next apps i was getting horrid performance. This seems like a decent solution

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      @@Oldbettie yeah idk why, something is fishy about it. Were you using a tunnel?

  • @pedrofrazaopacheco
    @pedrofrazaopacheco 2 วันที่ผ่านมา

    Hey Cody
    I am not 100% sure about this but a while ago I saw an article that you can’t cache user generated assets on cloud flare and you need to use their service R2.
    I don’t know if this applies in your case but just to let you know that it can be against their terms of service

    • @WebDevCody
      @WebDevCody  2 วันที่ผ่านมา

      I'd be curious if you can find that article. Claude AI is saying caching dynamic or user generated content is allowed as along is it isn't illegal or copy written assets. The article needs to link directly to the cloudflare terms of service or else it's just hearsay imo, but it's always good to double check these things.

    • @pedrofrazaopacheco
      @pedrofrazaopacheco 2 วันที่ผ่านมา

      @@WebDevCodyok i think my comment was deleted because i added a link but basically this is from their website
      Unless you are an Enterprise customer, Cloudflare offers specific Paid Services (e.g., the Developer Platform, Images, and Stream) that you must use in order to serve video and other large files via the CDN

    • @nchomey
      @nchomey 2 วันที่ผ่านมา

      It's in their terms of service. Html only in the cache, unless you use a paid service (like r2). Yet, html isn't cached by default and scripts (and I think images) are...