title: Angular 7 PWA web storage choices
body: <p>I am creating a PWA application using Angular 7. I am deciding on how to store some data locally and have two choices:</p>
  
  <ol>
  <li>LocalStorage</li>
  <li>IndexedDB</li>
  </ol>
  
  <p>The advantages of the localstorage are</p>
  
  <ol>
  <li>Syncronous</li>
  <li>Returns string</li>
  </ol>
  
  <p>The disadvantges of the locstorages</p>
  
  <ol>
  <li>ServiceWorker cannot access localstorage</li>
  <li>Not secure</li>
  </ol>
  
  <p>Advantages of IndexedDB is</p>
  
  <ol>
  <li>More storage space than localstorage</li>
  <li>Can store and retrieve objects</li>
  <li>Promise based</li>
  </ol>
  
  <p>Disadvantes of IndexedDB</p>
  
  <ol>
  <li>Not available in Firefox Private Sessions</li>
  </ol>
  
  <p>Now for storing data if I use IndexedDB, users from Firefox Private sessions will not be able to use my web site and If I use localstorage I cannot leverage ServiceWorker.</p>
  
  <p>How do you overcome the above issues with IndexedDB and LocalStorage?</p>