最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Django with Regional Databases and Users - Stack Overflow

programmeradmin0浏览0评论

I'm looking to provide reliable uptime with a horizontally scaled Django service. I want to run migrations on a somewhat timezone based schedule such that migrations are run when the fewest users are online. Those users have static locations, so we can reliably assign them to regions.

For this, I was thinking I would have separate databases depending on region. eu_east, eu_west, etc and using a database router to keep users and their data separate.

The challenge is, I don't want users to have to enter the region they're in every time they authenticate. I want them to just enter username and password, and have the regional aspect of the site be transparent to them. I'm imagining some sort of user->region default database lookup, but I was wondering if there was a best-practice for this use case, or something I'm not considering?

发布评论

评论列表(0)

  1. 暂无评论