Search⌘ K

Parallel Upgrade Problem

Explore how to handle the parallel upgrade problem in IndexedDB when multiple tabs access different database versions. Understand the role of the versionchange event in closing outdated connections and prompting users to reload for the latest version. This lesson equips you to maintain data integrity during app updates across tabs.

Problem

Assume a user is using our web app in a tab, “TAB_1,” with version 1 of the database. Meanwhile, we roll out a new version of the app with database version 2. When the user visits our app in a new tab, “TAB_2,” the browser will open the database in version 2. In this scenario, “TAB_2” tries to update the version of the database. But there’s another connection to the version 1 database open in “TAB_1.” As a result, the blocked event will be triggered for the open request in “TAB_2” ...