Member-only story
Using IndexedDB in Web Browser — All in Java with Mrs. Gwitany and Dr. Jackl
This story isn’t about Java Applet or Java WebStart, this story is a pure JavaScript story presented by Mrs. Gwitany and Dr. Jackl, generally known as GWT and J2CL.
In the world of web browser JavaScript is the king, so all the Web APIs are based on JavaScript. The Mozilla Developer Network (MDN) is the source of truth for the Web APIs. It looks awesome and it explains everything with examples very nicely. So if you want to build web apps you surely need the MDN documentation.
Lesson 1: consider Mozilla Developer Network (MDN) and Web APIs as your best friend.
In this story I will show you how we can use Web APIs from GWT / J2CL transpiler. For this purpose I chose IndexedDB API. From the documentation on MDN here is the definition of IndexedDB API:
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high-performance searches of this data. While Web Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution.
Following simple logic should be implemented with IndexedDB:
- The web app will create an…