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

  Рет қаралды 9,327

Web Dev Cody

Web Dev Cody

Күн бұрын

Пікірлер: 85
@ZanarkandStarplayer
@ZanarkandStarplayer 3 күн бұрын
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 күн бұрын
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 күн бұрын
He’s switching to Golang to save costs, but still keeping the premium Wife plan. Must be worth every penny!
@al3030
@al3030 3 күн бұрын
Great video. Nice to see you come back to GO. It’s very efficient for such backend work.
@yassinesafraoui
@yassinesafraoui 2 күн бұрын
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 3 күн бұрын
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 күн бұрын
I could probably just setup a firewall on the docker image itself
@beemkhan
@beemkhan 3 күн бұрын
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 күн бұрын
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 күн бұрын
so what is the go proxy actually doing?
@WebDevCody
@WebDevCody 3 күн бұрын
I’m not sure
@ali2kan
@ali2kan 3 күн бұрын
from my understanding from the video, wasn't he using the proxy to route client requests to the db?
@sama7496
@sama7496 3 күн бұрын
same here i didn't get it too
@the-engineer-r4j
@the-engineer-r4j 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 күн бұрын
I think just to save bandwidth streaming those videos with js is expensive
@vhhhus
@vhhhus 3 күн бұрын
good job mate, love it
@damonguzman
@damonguzman 2 күн бұрын
This is peak, “I built because I could not because I should.”
@WebDevCody
@WebDevCody 2 күн бұрын
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 3 күн бұрын
this is great.. I always wonder about this... fantastic.. do you have a video on how to deploy such setup?
@aaronstanton1259
@aaronstanton1259 3 күн бұрын
6:23 "yoo-id" 💀
@WebDevCody
@WebDevCody 2 күн бұрын
yoooooouuuuuuu-id
@briangugi
@briangugi 3 күн бұрын
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 күн бұрын
When hosting nextjs on Railway, does it basically just run on a long-running express server?
@WebDevCody
@WebDevCody 2 күн бұрын
yes, it's a stateful container
@Steel0079
@Steel0079 3 күн бұрын
Hi, why didn't you use something like nginx? Is it because you are using convex?
@WebDevCody
@WebDevCody 3 күн бұрын
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 күн бұрын
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 күн бұрын
kzbin.info/www/bejne/bquZoJ55nMmFe9E 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 3 күн бұрын
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 3 күн бұрын
Always feels wrong to press like if the like count is 69... but great information as always.
@WebDevCody
@WebDevCody 3 күн бұрын
You dirty dog you
@guyhazut9459
@guyhazut9459 3 күн бұрын
where can you learn this stuff?
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd 2 күн бұрын
❤❤
@sid4579
@sid4579 3 күн бұрын
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 күн бұрын
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 3 күн бұрын
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 3 күн бұрын
The diagram shows ui makes a request to cloudflare, cloudflare hits proxy, proxy hits File storage
@adrian110288
@adrian110288 2 күн бұрын
@@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 күн бұрын
First!
@joeyywill1234
@joeyywill1234 3 күн бұрын
SECOND!
@sergeyagronov9650
@sergeyagronov9650 Күн бұрын
basically free .... until they decide to shutdown your app 🤣🤣🤣
@WebDevCody
@WebDevCody Күн бұрын
live on the edge
@CarlosDuque-e3j
@CarlosDuque-e3j Күн бұрын
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 Күн бұрын
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 Күн бұрын
​@@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...
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 290 М.
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 8 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 54 МЛН
CloudFlare - Trie Hard - Big Savings On Cloud
26:04
ThePrimeTime
Рет қаралды 74 М.
Setting up a production ready VPS is a lot easier than I thought.
29:50
Picking out my new iPhone! - iPhone 16 and 16 Pro
15:02
ShortCircuit
Рет қаралды 321 М.
This is why you can't blindly use AI
8:57
Web Dev Cody
Рет қаралды 9 М.
Here's an overview of all my revenue generating side projects
19:38
The Biggest Lie in Web Development
12:35
Awesome
Рет қаралды 4 М.
How To Find A Co-Founder | Startup School
20:38
Y Combinator
Рет қаралды 2,8 М.
A New Drag And Drop Library For EVERY Framework
16:02
Theo - t3․gg
Рет қаралды 134 М.
Breaking down React "head" drama
19:55
Theo - t3․gg
Рет қаралды 46 М.
Electric Flying Bird with Hanging Wire Automatic for Ceiling Parrot
00:15