2

I have a Rails API only app that is being used for the backend and two VueJS apps that I am using as the front ends. Both Vuejs apps make a number of calls to the Rails API. I am also considering deploying to Digital Ocean.

My question is: What is best practice to layout a server architecture seeing that I'm using rails and vuejs. I was thinking of keeping it very separate but could be overkill and repetitive, anyone else have any thoughts?

Vuejs App 1

LoadBalancer -- Web Server 1
                Web Server 2

Vuejs App 2

LoadBalancer -- Web Server 1
                Web Server 2

Rails API

LoadBalancer -- Web Server 1
                Web Server 2
                Worker Server
                Postgres    

1 Answer 1

2

I'm not sure you need to load balance the Vue app since its just static minified files you send once to each user right? I mean unless you are planning on billions of hits I think that might be overkill?

Depending on the amount of traffic and complexity of the API it makes sense that that's where the load balancing needs to happen if anywhere.

I have just done this exact same thing using Rails as the api for a Vue SPA and I used AWS Elastic Beanstalk.

If you haven't used it before I highly recommend it! It makes deployment and scaling an absolute breeze!

So here was my set up:

Vue SPA - served directly from S3

RDS Database instance x 1 - Part of EB out of the box

Load balancer - Part of the EB out of the box

App Server x 4 - EC2 Instances out of the box with EB

All the above is stupidly easy to configure and you can change the size of your servers, or the number you have running in just a few clicks. It really does make this whole process fantastically easy. And deployment of your app is as easy as eb deploy :)

One word of warning, watch the default sizes and number of servers a fresh EB setup gives you, I did spend more money than I anticipated in the first month since I was running much larger servers than I actually needed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.