reisman-internship-2019-greenmap / GreenMap-server

The Server for the GreenMap project. MVP Submitted and closed.
https://documenter.getpostman.com/view/3989380/SVYqNe4f?version=latest#deeeef3a-93dd-450f-856f-c725ab237da5
3 stars 0 forks source link

Create Greenmap Service Worker script #55

Open evscott opened 5 years ago

evscott commented 5 years ago

Requirement

Notes

rijaali144 commented 5 years ago

LGTM :) It might not be an issue for now, but we could add batch processing when moving entries from staging to prod. This brings an interesting question: Are entries in staging db unique? If not, through batch processing we might be able to decrease processing of same entries hence decreasing queries to Datainfiti for the same product too. Just a suggestion (could be a TODO for later).

evscott commented 5 years ago

LGTM :) It might not be an issue for now, but we could add batch processing when moving entries from staging to prod. This brings an interesting question: Are entries in staging db unique? If not, through batch processing we might be able to decrease processing of same entries hence decreasing queries to Datainfiti for the same product too. Just a suggestion (could be a TODO for later).

That's a good question. I'm not actually sure about the uniqueness of products in our staging database. This will depend on what barcodes we intend to support.

If we only support a single barcode type, i.e. EAN, then products in our staging database should theoretically always be unique. If we support many barcode types, i.e. EAN, UPC, and ISBC etc, then products in our staging database may not always be unique - we may encounter several virtually identical products in our staging database that derive their data from different barcodes of different types. I'll speak with @ShekharDewan to figure this out.

In any case, I think batch processing the transfer of unique valid products from our staging to production database is a good idea.

ShekharDewan commented 5 years ago

I think its okay to have products duplicated with different barcodes. Most products will have one or two, and a few may have 5-6, but on the whole I think product to barcode ratio will be under 2.5, which is perfectly acceptable. So we should support at least EAN and UPC, and we can consider more formats on top of that.

ShekharDewan commented 5 years ago

Okay, when we say product is incomplete, we should be checking for a few essential fields. Datafiniti has a lot of fields, some of which we can keep even if they aren't always present for all the products. Someone who has interacted with Datafiniti should tell us what to expect here @nimeshnayaju

ShekharDewan commented 5 years ago

We will also need to query ESG information for the manufacturer of the product from our server and add to the document. @evscott @Reithger

nimeshnayaju commented 5 years ago

The current implementation allows duplicate products with different barcodes but the same product information. This is done in order to keep the querying simple and efficient.

evscott commented 5 years ago

The current implementation allows duplicate products with different barcodes but the same product information. This is done in order to keep the querying simple and efficient.

I think this is the way to go.