# Best practices for dynamically spinning up apps on behalf of our end users

**URL:** <https://community.fly.io/t/best-practices-for-dynamically-spinning-up-apps-on-behalf-of-our-end-users/21807>\
**Category:** General\
**Tags:** machines, nodejs, autoscaling, login-only\
**Created:** [September 12, 2024, 10:54pm UTC](https://community.fly.io/t/best-practices-for-dynamically-spinning-up-apps-on-behalf-of-our-end-users/21807 "2024-09-12T22:54:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjreinhart-axflow](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@benjreinhart-axflow](https://community.fly.io/u/benjreinhart-axflow)\
**Post date:** [September 12, 2024, 10:54pm UTC](https://community.fly.io/t/best-practices-for-dynamically-spinning-up-apps-on-behalf-of-our-end-users/21807/1 "2024-09-12T22:54:20Z")

</div>

Hello Fly folks, I’m trying to understand if my use case is supported and what the best practices are.

**What I’m trying to do**

We have a product that makes it very easy to create Node.js apps + SPA frontends locally. We want to create a cloud-hosted version where users can deploy these apps through our service with one click of a button. I am investigating if I can use Fly as the backend where we deploy these apps (seems way more fun than AWS :).

TLDR: we want to deploy N small apps dynamically on behalf of our users.

**What I want to know**

1. Is this a supported use case?
2. What, if any, limits are there? Can we spin up tens of 1000s of apps? More? Is there a ceiling?
3. Are there recommended ways to handle billing in these cases? If each end-user app is also a Fly app, is there an API where I can get the billing details for each app individually?
4. What other challenges or gotchyas should I be aware of for this use case?

**Rough architecture plan**

Does the following sound right? Are there best practices I’m missing?

1. We create a Fly app in our Fly organization for each app created by one of our end-users.
2. The Fly app has its own custom network to be isolated from other end-user apps (later, we can also assign custom domains to these apps)
3. We can spin up N machines or other resources under this app, though most deployments will probably have the lowest tier shared CPU etc to start. We autoscale it to 0 when it’s not in use to avoid consuming unused resources and reduce charges.
4. We charge our end-users by adding up the cost of all the apps they deployed.
5. We use the REST API to implement the above programmatically

Anything else I should know?

Thank you 🙏

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [September 19, 2024, 10:55pm UTC](https://community.fly.io/t/best-practices-for-dynamically-spinning-up-apps-on-behalf-of-our-end-users/21807/2 "2024-09-19T22:55:20Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
