A
A
axel2018-03-20 23:09:43
Django
axel, 2018-03-20 23:09:43

What is the best way to update the data?

The situation is as follows: there is a giant database (MS SQL), and there is (more precisely, there will be) a site on Django, which should use not all, but some of the data from this database. This database is, as it were, "general", that is, not only this proposed site will use it, this database is already being used. You can't change its structure, you can't enter data there either. You can connect to the database via an ssh tunnel.
As I understand it, for a Django site it is necessary to have its own database, with its own structure, with its own tables. How to organize data exchange? The exchange is one-way, you only need to take data from a "large" database.
Is it possible to somehow open an ssh tunnel through Django, write the queries I need to fetch data directly with sql, write this data to some file, and from there read it into my database.
Am I thinking right?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2018-03-20
@sim3x

Dzhanga can use several databases
Dzhanga can map to an existing database structure
The secure channel should provide a DBMS
msskul is better to change to a DBMS, those to postgres

A
Astrohas, 2018-03-21
@Astrohas

Create DBRouter, Create a database on anything (yes, even on Sqlite3), Specify it as the main one.
attach MSSQL database as an additional one through this backend django-mssql.readthedocs.io/en/latest

M
mynigoo, 2018-03-21
@mynigoo

to access the mssql database, in any case, you need to create a separate user with read-only rights

R
Roman Mirilaczvili, 2018-03-21
@2ord

Is it possible to somehow open an ssh tunnel through Django, write the queries I need to fetch data directly with sql, write this data to some file, and from there read it into my database.
Am I thinking right?
This should not be done for the reason that connections can suddenly break off. It's over the internet.
I think a more correct way of working is either a one-time export of the necessary tables, or connecting to two databases at the same time, provided that they and the application are within the local network.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question