[w3c/IndexedDB] Q objectstore-> objects names saved in each store overall hard drive space (#98)

starting off with example code, following up with questions....

example
var data = [
  {
    jobid:1,
    firstname:"ryan",
    lastname:"sanders",
    job:"developer"
  }
]

var db;
var request = indexedDB.open('testdb',1);
request.onsuccess = function(e) {
  db = e.target.result;
  var transaction = db.transaction('tstore', "readwrite");
  var objectStore = transaction.objectStore('tstore');
  objectStore.add(data);
}

open up chrome
goto developer tools
goto "application"
click on indexeddb 
click test 
click tstore 
click on "value" so i can see a drop down of the objects (id, firstname, lastname, developer)

===============

if i repeat this a few 1,000 times of adding folks to the given store.  am i overloading the database. with just the physical names "jobid", "firstname", "lastname", "job"?  

==================
would i be better off doing something like....
var data = [
  {
    1:1,
    2:"ryan",
    3:"sanders",
    4:"developer"
  }
]

and some place in code making a comment section....
// 1 = jobid
// 2 = first name
// 3 = last name
// 4 = job

this way i do not have space taking up jobid, firstname,lastname,job  a few 1,000 times as physical hard drive space for every entry that is made on the given objectstore. 

or is there already logic that saves "jobid, firstname, lastname,job"  and then serializes each type on the hard drive?

and if last sentence is true.... does creating "index" for each {"jobid", "firstname", "lastname", "job"} just add some additional info to data being stored on hard drive? 

===================
i have a lot of true/false stuff to take care of, and having a easily read name_scheme for the objects makes it easier to read code.  but if i am getting penalized, for

this_is_my_long_object_name_that_is_only_true_false_1_0

then i need to re think about the name scheme.  and most likely make the first record the comment record. and all records after that. regular 1:"jobid", 2:"someonesname", 3:"someoneslastname", 4:"job" notation.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/98

Received on Thursday, 13 October 2016 05:02:46 UTC