问题
I am building a software that will store and manage doctor's data. I would like to ask something that came to me and has to do with how I want to deploy my project. At first I wanted to have different django instance for each client. Each clinet would have his own database and run seperatelly from the others. But I am not sure I can automate this procedure, because for each instance I need to have different database, different password different db username, something that I am not sure It can be automated while creating a every new instance of my django project. Or is it in some way. Imagine the following scenario
User pays -> After successfull payment -> DB(MySQL) is created ->
django instance is created ->
somehow django settings file is updated with db credentials -> syncdb is run
and this procedure must be automated. Is it better to have one db with and the seperation to be done from models (with foreignkeys etc)? Or is one unified database not a good solution (security side)? What do you think?
回答1:
maybe you can have a look on multi-tenant data architecture.
https://github.com/bernardopires/django-tenant-schemas
http://msdn.microsoft.com/en-us/library/aa479086.aspx
来源:https://stackoverflow.com/questions/23366110/one-django-instance-one-database-vs-different-django-instances