Skip to content

risper25/bulk-api-django-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model

Model

Endpoints

Run the application using the following command:

python manage.py runserver

Tests

Run tests using the following command:

python manage.py test

Solution 1: Sequential Insertion

Insert all products and their variants using the create method sequentially.

Endpoint: http://127.0.0.1:8000/inventory/products

Test Results:

Create Method

Solution 2: Bulk Insertion

Insert products and their variants using the bulk_create method.

Endpoint: http://127.0.0.1:8000/inventory/products-bulk

Test Results:

Bulk Create Method

Analysis:

Runtime:

  • Blulk Insertion solution has approximately less runtime than the sequential solution. Especially for the larger dataset as seen with the 1000 products the execution time decreased from 26.08s to 8.44s.

memory usage:

  • There was a slight increase in memory for the bulk insertion solution compared to the sequential insertion solution

Solution 2 Bulk Insertion is the more optimal solution because of faster runtime

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages