#Deploying my Golang Backend

50 messages · Page 1 of 1 (latest)

peak coral
#

I just bought a domain from Hostinger. I created my backend in golang and I have my database being hosted in the cloud right now. However for my backend I don't know how I should go about it.. I will probably host my domain with Hostinger later today but do I connect my backend in Hostinger's platform or spin up a VM on AWS or GCP and connect it via some dns configuration in Hostinger? I am very confused first time deploying please help me fellow gophers ❤️

chrome zinc
#

yes you are correct
you go to your domain registar(hostinger in this case)
tell it you want an A record pointing to your VPS/server's IP

#

that's all it should take, a dns config

peak coral
#

thank you so much 🙏 appreciate the confirmation

chrome zinc
#

when i read hostinger i was concerned for a sec thinking you purchased hosting from them

#

because there's no way you can host golang on a PHP hosting platform

#

(might been changed now, but back then it's just PHP only from them)

peak coral
#

Haha yeah that wouldve been bad , do you think I should purchase hosting from them? I just bought the domain , my plan is put my nextjs frontend in their hosting plan, and configure the dns A record to my golang backend on an aws ec2 server. Is this a valid setup 😂 it may be very unoptimized but this is how I see it would work

chrome zinc
#

it is but can you even host nextjs on there?

#

also it's a unoptimal configuration for your money

#

like if you are made of gold sure
but i would keep frontend and backend on the same vps

peak coral
chrome zinc
#

just for cost measure so i dont need to pay twice for hosting

#

*there's valid cases if you ware to scale bigger but scalling bigger was never wallet friendly to begin withh

peak coral
#

so should i just stick to one cloud provider platform like GCP or AWS? Yes true my project is just a personal site so I believe this can be fine for me

chrome zinc
#

like unless your backend server cant handle hosting frontend and the backend
there's no reason to justify splitting it

peak coral
#

very true. I am gonna dockerize them both to save up more space

#

and just run them with docker-compose is this okay?

#

i could learn k8 but man that stuffs quite a process

chrome zinc
#

though if you want to use this to say you have experience using gcp/aws i guess it's an okay justtification

#

good site to find a budget host to your liking spec wise
that said: as the old adage goes "you get what you pay for"

chrome zinc
peak coral
#

interesting man , hetzer i will look into this. Thank you for the server site , I always jump to cloud i forget that my project doesn;t need all the services they offer. a VPS sounds like a more friendlier solution to me.

#

Hey thanks for all the words of wisdom brother approaching this deployment for the first time it really gave me some sense of what im doing now 🤝 appreciate it man

chrome zinc
#

watch out for prices, just because it looks low doesnt mean it's a good fit
some stuff have good storage but slow cpu they might be designed for bulk storage instead of running a website etc etc

#

do check the spec if they match your expectation

#

cuz on the lowest of low budget you get stuff that are specialized for one thing

#

on hetzer though it should be good, it does cost more though

#

also the server auctions you might be able to get a good deal on a server there
assuming you understand spec and value

peak coral
#

yeah I was looking at some of them that are incredibly cheap hahah , I do understand the specs so I should be alright navigating the prices. Tbh i think i should get away with 4gb of memory i hope

chrome zinc
#

probably 8gb if you intend to run more stuff in the future

#

also the cpu

#

make sure it's not some pentium crap

#

otherwise everything will be stupidly slow

peak coral
#

hahahah thanks man so intel cpu or amd cpu is the way to go?

chrome zinc
#

i cant advise on that end

#

but check the generation

#

what generation of cpu they are selling

#

and what tier is it(intel has i3, i5, i7, i9 if it's desktop cpu)
the i3 one is lowest, and probably cheaper, but it's cheap for a reason

#

good if you dont expect much load etc etc etc

#

i am not sure about amd's tiers are

#

you will have to do a bit of research(shouldnt be hard)

peak coral
#

I see brother yeah the gen i see is i3 and i5 mostly

chrome zinc
#

but personally generation is most important

peak coral
#

Yeah thanks for this man buying a vps is the way to go for me

#

oh ya so i should probably get i7

chrome zinc
#

sure an i9 is cool but what if it's from 2018? that's like 6 years ago!!