对于Amazon DynamoDB,Django中是否有良好的数据库后端? [英] Is there a good database backend in Django for Amazon DynamoDB?

查看:632
本文介绍了对于Amazon DynamoDB,Django中是否有良好的数据库后端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的下一个Django项目中使用DynamoDB。我已经发现将会话数据存储到DynamoDB中,但是是否有Django的后端实现来存储所有数据库数据?

I would like to use DynamoDB for my next Django project. I have found implentation to store session data into DynamoDB, but is there backend implementation for Django to store all the database data?

推荐答案

我不认为在那里有任何Django DynamoDB项目允许您在使用DynamoDB下使用Django ORM。

I don't think there are any Django DynamoDB projects out there that allow you to use the Django ORM while using DynamoDB underneath.

但根据您的情况,您可能还会能够简单地忽略Django的ORM部分,并直接使用DynamoDB(通过boto或pun阳极或类似的)。

But depending on your case, you may still be able to simply ignore the ORM portion of Django and use DynamoDB directly (via boto or pun anode or similar ).

在我的情况下,我使用混合。我保留所有我的用户和其他大多数只读Postgres(RDS)和Django ORM的模型,但是对于需要大量写入(使用pynamodb)的模型,使用DynamoDB。

In my case, I use a mix. I keep all my users and other models that are mostly read only on Postgres (RDS) and Django ORM, but use DynamoDB for models that require heavy writes ( using pynamodb).

我仍然可以使用视图,模板,甚至通过Django-rest-framework添加API。我失去的是管理员页面(我不需要这些模型)和ORM给您的其他功能,但我一直对结果感到满意。

I still get to use the views, templates or even add an API via Django-rest-framework. What I lose is the admin pages ( that I don't need for these models ) and other features the ORM gives you but I have been happy with the result anyway.

这篇关于对于Amazon DynamoDB,Django中是否有良好的数据库后端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆