Hi guys I need some help figuring out this pattern. I have a web application currently running on flask at site.com
for each of my customer, I want to have a droplet from digitalocean running the copy of the flask app.
I want to consolidate them under a subdomain like customername.site.com
so when they go to customername.site.com, the ip points to their own server.
Now the problem I have is handling cases like:
The reason I have one user per one droplet is because they run cpu and network intensive background jobs in parallel. I don’t want them to interfere with each other.
I guess I’m trying to achieve horizontal scalability, by just cloning an instance of my original web application, instead of trying to force everyone on the same instance.
Any suggestions or feedback would be very useful.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In order to deal with the login use case, you could use OAuth. site.com would be the OAuth provider with the customername.site.com sites as consumers. Check out Flask-OAuthlib.
A different approach might be to have site.com act as the front end for all users, but have a scalable backend. That way all of the long running, cpu and network intensive jobs will actually be running on different servers, but the user would only login to the frontend.
As for updating all customer droplets with new code, I’d suggest you look into git hooks. You could setup a git repository with a post receive hook to pushes to each server. You could also use something like Fabric to do automated deployments.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.