简体   繁体   中英

In a web application, what's the best way to store custom user data

We have a web application that we're refactoring. We want to make an environment per version with different users (companies) that share the same codebase.

It know this is a somewhat simple question but I just want to make sure we make the right decision (according to webapp best practice).

Say companya.webapp.com points to /1.00/public
and companyb.webapp.com points to /1.30/public

I'm wondering what the best way is to store custom data from these users. Custom data could be uploaded documents, photos and also generated static data like PDF documents/invoices.

When I migrate a user to a different version I want his data to be available in the other version too. The documents also have a record in the database with the path description.

Would it be OK to do something like this structure:

/data/[companyname]/pictures
/data/[companyname]/documents
/data/[companyname]/documents/pdf
/data/[companyname]/documents/csv
/1.00/public

Sure, use whatever structure you like. There's no real "correct" answer, and it's very hard to do it wrong. Just make sure the permissions are properly set, so that each company can't read each other's files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM