Closed SirWellington closed 7 years ago
Does this mean creating an algorithm that will detect images associated with a store and save them in a sub database? can you briefly explain the process for this?
@cordhernandez Great questions! I can explain when we meet in person.
@cordhernandez Great questions! I can explain when we meet in person.
So what I'm thinking is to store images in their own table, called Images
with no foreign keys, and to then store the relationships between images and stores in their own table, Store_Images
.
CREATE TABLE IF NOT EXISTS Images_External
(
image_id text PRIMARY KEY,
-- This is otherwise known as the image blob
binary BYTEA,
height INT,
width INT,
size_in_bytes INT,
file_type TEXT,
source TEXT
);
Field | Type | Description |
---|---|---|
Image_ID | String (Primary Key) | Unique Image ID |
binary | ByteA (Byte Array/Binary) | The Binary Blob of the image |
Height | Integer | Height of image |
Width | Integer | Width of image |
Size In Bytes | Integer | How many bytes the image takes up |
File Type | String | The type of file [PNG, JPG, BMP, RAW, etc] |
Source | String | Where did the image come from? [Google, Yelp, etc] |
Now that we have stores persisted in Postgres, we need design a way to remember and persist images associated with a Store.
Remembering images will greatly improve performance.