0

I have a project that :

  • fetches data from active directory
  • fetches data from different services based on active directory data
  • aggregates data
  • about 50000 row have to be added to database in every 15 min

I'm using Postgresql as database and django as ORM tool. But I'm not sure that django is the right tools for such projects. I have to drop and add 50000 rows data and I'm worry about performance. Is there another way to do such process?

3 Answers 3

1

50k rows/15m is nothing to worry about.

But I'd make sure to use bulk_create to avoid 50k of round trips to the database, which might be a problem depending on your database networking setup.

Sign up to request clarification or add additional context in comments.

Comments

0

For sure there are other ways, if that's what you're asking. But Django ORM is quite flexible overall, and if you write your queries carefully there will be no significant overhead. 50000 rows in 15 minutes is not really big enough. I am using Django ORM with PostgreSQL to process millions of records a day.

2 Comments

could you suggest another way please? Thank you
You can use SQLAlchemy, or use another ORM, or use psycopg2 directly, which allows you to do low-level COPY functionality.
0

You can write a custom Django management command for this purpose, Then call it like

python manage.py collectdata

Here is the documentation link

2 Comments

Is Django the right tool for such projects? I have to drop and add 50000 rows data and I'm worry about performance.
@jojo, Django is just a framework. Dropping and adding rows happens at database level. Postgresql is definitely capable of doing that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.