How to store Images and data?
Unanswered
Dwarf Crocodile posted this in #help-forum
Dwarf CrocodileOP
I am building a project where I am generating 1 image each from Recraft AI and Ideogram models based on a single user prompt. Afterward, I will ask the user to choose which image they liked the most.
1) I want to store the following data (to analyze user preferences and determine which model is liked more) :
- user prompt
- generated image
- model name that the user liked
2) Additionally, when a new user visits, they need to authenticate first.
I am using Nextjs, Firebase (for authentication).
How to store the other data (prompt, image, liked model name)?
And is there any other better alternative to my approach?
1) I want to store the following data (to analyze user preferences and determine which model is liked more) :
- user prompt
- generated image
- model name that the user liked
2) Additionally, when a new user visits, they need to authenticate first.
I am using Nextjs, Firebase (for authentication).
How to store the other data (prompt, image, liked model name)?
And is there any other better alternative to my approach?
9 Replies
Dwarf CrocodileOP
Also, image links created by the Ideogram and recraft API expire after certain period of time.
Roseate Spoonbill
There's a lot of possible approaches here:
1. Store everything in database - not scalable, but will get you through initial development and first clients. Use any database you like for it. There are both classical databases and pretty much serverles offerings for those
2. Store data in database, upload to s3, azure blob, or (a bit easier to get things done) places like UploadThing. Firebase itself also has both database and object storage offerings and if that's easiest path for you, then you should also consider it. Again, "serverless" (or similar) databases are a thing and worth looking into it - things like SingleStore.
3. Store everything in Headless CMS - There is a lot of products that allow you to define data you want to store and just put it there with simple and typed SDK. I'd look at Flotiq, Contentful or Strapi (short disclaimer, I work for the company that created Flotiq and I worked on it in the past). Firebase to some extent can be treated also as such, although it falls short when it comes to ease of use.
1. Store everything in database - not scalable, but will get you through initial development and first clients. Use any database you like for it. There are both classical databases and pretty much serverles offerings for those
2. Store data in database, upload to s3, azure blob, or (a bit easier to get things done) places like UploadThing. Firebase itself also has both database and object storage offerings and if that's easiest path for you, then you should also consider it. Again, "serverless" (or similar) databases are a thing and worth looking into it - things like SingleStore.
3. Store everything in Headless CMS - There is a lot of products that allow you to define data you want to store and just put it there with simple and typed SDK. I'd look at Flotiq, Contentful or Strapi (short disclaimer, I work for the company that created Flotiq and I worked on it in the past). Firebase to some extent can be treated also as such, although it falls short when it comes to ease of use.
I'd take something more managed and with high abstraction level (Headles CMS, or serverless DB with UploadThing) - it will get your development faster without worrying about infrastructure.
Roseate Spoonbill
I highly encourage you to take a look into those products and choose a style of integration that suits you the best. Pretty much any cloud deployment platform (vercel, netlify, aws, azure) have their own equivalents of mentioned products. So you can start with looking into those. In low traffic apps, it shouldn't matter what you pick.
Dwarf CrocodileOP
thanks for explaining
yeah, right now we wont have much traffic
i was thinking supabase?
it would provide both auth and a database (for images and user data)
I don't want to go with CMS..