简体   繁体   English

使用 Apache 点燃 Django

[英]Using Apache Ignite with Django

We have an existing Apache Ignite in-memory DB with lots of stored data.我们有一个现有的 Apache Ignite 内存数据库,其中存储了大量数据。 I want to connect my existing Django web application to the Ignite DB in order to query the existing data.我想将我现有的 Django web 应用程序连接到 Ignite DB 以查询现有数据。 Are there any examples of how to connect a Django application to an Apache Ignite DB and how to query the DB using the Django ORM?是否有任何示例说明如何将 Django 应用程序连接到 Apache Ignite DB 以及如何使用 Django ORM 查询数据库?

You can use JDBC drivers with Django ORM: How to write custom database adapter for django using JDBC drivers?您可以将 JDBC 驱动程序与 Django 一起使用 ORM: 如何使用 JDBC 驱动程序为 django 编写自定义数据库适配器?

Then, you can use Ignite JDBC driver: https://ignite.apache.org/docs/latest/SQL/JDBC/jdbc-driver然后,您可以使用 Ignite JDBC 驱动程序: https://ignite.apache.org/docs/latest/SQL/JDBC/jdbc-driver

Django ORM requires a special adapter for each kind of database server. Django ORM 需要针对每种数据库服务器的特殊适配器。 Such an adapter is called “database backend” in Django terminology.这样的适配器在 Django 术语中称为“数据库后端”。 There is no Django database backend for Ignite. Ignite 没有 Django 数据库后端。 There is also no universal, middle-ground backend I know of, that can be used with Ignite.据我所知,也没有可以与 Ignite 一起使用的通用中间后台。

You can implement your own custom backend ( guidelines ) or try to pick up the latest attempt in creating a more-or-less server-independent ODBC backend .您可以实现自己的自定义后端( 指南)或尝试获取创建或多或少独立于服务器的ODBC 后端的最新尝试。 But in your place I'd probably not get involved in any of this, since it implies a lot of work not directly related to your task.但在你的位置,我可能不会参与其中的任何事情,因为这意味着很多工作与你的任务没有直接关系。

I'd just convert the data with one-off script (or Django management command), using pyodbc or pyignite as a source and Django model as a target.我只是使用一次性脚本(或 Django 管理命令)转换数据,使用pyodbcpyignite作为源,使用 Django model 作为目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM