While developing, the loading of the events from Google was slowing down the development. So I start implementing the necessary methods for IndexedDb:

Model Description get find put delete Changes
EventsGoogle Interface to all Google Events
EventsMemCache An In-Memory temporal Store (mostly for testing) unused now
EventsIndexedDb An local permanent cache Interface Created 🎉
EventsSync A sync between a data source like google and a local cache like EventsMemCache or EventsIndexedDb With "smart sync"
EventsApi A collection of EventsSync

Smart Sync

Once implemented the find events methods on google, I want to create a way to maintain the events of google calendar in sync with the local cache.

I wrote EventsIndexedDb to support only put and find. That enabled me to start creating a sync "algorithm".

The algorithm is quite simple. Ask google for all the events that were modified after the last event modifiedAt that we have on the cache, and download them.

Now I can easily browse my google calendar events in Kalena.

Google Calendar Events in Kalena