一个django实例一个数据库vs不同的django实例 [英] One django instance one database vs different django instances
问题描述
用户支付 - >成功付款后 - >创建DB(MySQL) - >
django实例被创建 - >
不知何故django设置文件使用db凭据更新 - > syncdb运行
,此过程必须自动化。最好用一个数据库和分离来完成模型(使用外键等)吗?还是一个统一的数据库不是一个很好的解决方案(安全方面)?你怎么看?
也许你可以看看多租户数据架构。
https://github.com/bernardopires/django-tenant-schemas
http://msdn.microsoft.com/en-us/library/aa479086.aspx
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?
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
这篇关于一个django实例一个数据库vs不同的django实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!