Monday, October 19, 2020

Re: Periodic Execution of django functions or tasks

Not exactly automatic, but can be set up to do so, something along the lines:


This solution is Postgresql specific, although I've done effectively the same with mysql with some help in the code.

Partitioning the db in this way makes it (almost) completely transparent to the application except when it comes to reporting. In mysql you can use the MERGE storage engine to aggregate a reporting period, which requires special rollover handling each month to manage. Otherwise crafted views is an alternate solution, again a requiring month rollover to regenerate.

Management of indexes is another issue - you lose index unique constraints across different months except with the partitioning date field that determines the table where records are inserted.

HTH, David

On 20 Oct 2020, at 00:53, MUGOYA DIHFAHSIH <dihfahsihm@gmail.com> wrote:

Hello fellow django developers, i am working on a web app in which reports are archived in the database at the end of every month automatically, i have searched on internet and many folks are suggesting celery which i have tried but not fruitful, is there any other library i use to accomplish this.

am using Python 3.8, django 2.2.8 and ubuntu

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP%3DJD9wJGPFZaCJOefqzt48nqb%3DNbZNXoTtdLv5EzX%2BoUM880Q%40mail.gmail.com.

No comments:

Post a Comment