Saving user input to JSON?

I have a website hosted on Fly.io. What is the easiest way of capturing leads through a landing page? Specifically, can I save the user-submitted form fields to a JSON file within my app’s directory structure?

While this method seems to be the most straightforward (no relational database needed), I’m asking because I don’t know the details of how Fly.io implements file storage. For example, saving to a JSON file wouldn’t work on Heroku since the latter uses ephemeral file storage in which all files not specific to the app are routinely deleted.

Thanks!

With fly, you would put such data on a volume:

1 Like

Thanks, the many caveats associated with volumes make me wonder whether an SQLite or a Postgres DB would indeed be a better choice for the task. Any suggestions?

Hi. I’m not a Fly.io employee, but for what it’s worth, I think Upstash for Redis®* · Fly Docs is what you’re wanting for your use case. If the data you describe is the only storage you need, then using Fly’s integrated Upstash Redis for it would save you from needing any volume at all. Running either SQLite or PostgreSQL within Fly requires a volume.

1 Like

Another option is getting an S3 account from some provider (Amazon, Cloudflare, etc.) and uploading the json to there. That’s a perfectly good option, especially if you need this data available as file-like objects rather than entries inside of a Redis database, but it requires creating an account with that provider, whereas the Upstash Redis option is already integrated in Fly.

1 Like

Thank you for sharing your insights, Alex. I do need the prospects’ contact information stored as simply as possible, and flat file storage is what comes closest, it seems. So I’ll look into S3 storage.

Cheers!

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