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

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

问题描述

我想在我的下一个 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 项目可以让您在使用 Django ORM 的同时在下面使用 DynamoDB.

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 或 PynamoDB 或类似方式).

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 PynamoDB or similar ).

就我而言,我使用混合.我保留了我的所有用户和其他大部分在 Postgres (RDS) 和 Django ORM 上只读的模型,但将 DynamoDB 用于需要大量写入的模型(使用 pynamodb).

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.

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

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