Storage แบบต่างๆ

localStorage

localStorage เป็นการจัดเก็บไว้ใน browser ดังนั้นจึงมีข้อจำกัดในด้านขนาดข้อมูลที่จัดเก็บได้ และถ้าแอพเรารันในโหมด background อาจจะถูกลบ localStorage ได้ หรือถ้าระบบปฏิบัติการต้องการพื้นที่หน่วยความจำเพิ่มก็อาจจะลบ localStorage ได้เช่นกัน

Basically localStorage is a browser owned key/value system. You can store up to 5Mb depending on the platform. However the OS you are running your app under can decide to delete its content if your app is on the background and OS needs memory.

Storage

Storage จัดเก็บโดยใช้ permanent storage เช่น SQLite ดังนั้นข้อมูลจะคงอยู่ตราบใดที่แอพของเรายังติดตั้งอยู่
แต่การใข้ Storage ครั้งแรกจะมีปัญหา ดังนั้นต้องคำนึงถึงการเรียกใช้งานครั้งแรกด้วย ทางแก้ไว้ไปดูใน การใช้งาน Storage แบบ Promise

The Storage plugin will try to use permanent storage such SQLite. Therefore your data lives as long as your app is installed.

So details that need to be persisted such as first launch flag or authentication token and so on, need to go under Storage, where you can decide to store some recurrent data you get from the server at localStorage..

Link