Question

Based on the subdomain that is accessing my application I need to include a different configuration file that sets some variables used throughout the application (the file is included on every page). I'm in two minds about how to do this 1) Include the file from GCS 2) Store the information in a table on Google Cloud SQL and query the database on every page through an included file.

Or am I better off using one of these options and then Memcache.

I've been looking everywhere for what is the fastest option (loading from GCS or selecting from cloud SQL), but haven't been able to find anything.

NB: I don't want to have the files as normal php includes as I don't want to have to redeploy the app every time I setup a new subdomain (different users get different subdomains) and would rather either just update the database or upload a new config file to cloud storage, leaving the app alone.

Était-ce utile?

La solution

I would say the most sane solution would be to store the configuration files in the Cloud SQL as you can easily make changes to them even from within the app and using the memcache since it was build exactly for this kind of stuff.

The problem with the GCS is that you cannot simply edit the file and you will have to delete and add a new version every time which is not going to be optimal in a long run.

Autres conseils

GCS is cheaper, although for small text files it does not matter much. Otherwise, I don't see much of a difference.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top