Fortnightly Discussion for 2025-08-15: How do you store data?

Hey Add-on devs!

Welcome to the first of (hopefully) many threads in a new fortnightly discussion series I’m kicking off here today. The idea is simple: get new and experienced developers alike to share their thoughts on a topic related to browser extension development.

Over the weekend I was tinkering on a side project extension and I found trying to decide which API I should use to store my extension’s data. When building cross-browser extensions, I usually reach for either the local or sync areas in browser.storage, but in my specific use case (logging) indexedDB had some advantages related to indexing and data retrieval performance.

That topic got me thinking about the pros and cons of these and several other options like Web Storage, SQLite via Wasm, a custom web server, etc. That in turn got me wondering how you think about which technologies to use and in what situations to use them.

So, let’s kick this off with a few questions to help guide you. Feel free to take or leave 'em.

  • How do you store data in your extension?
  • What considerations motivate that choice?
  • What libraries or helpers do you use, if any?
  • How do you feel about the choices available to you?

I’m curious to hear what you all have to say :slight_smile:

EDIT (2025-09-08): Updated to make these posts fortnightly (every other week) instead of weekly.

2 Likes

Let’s face it, the basic storage API is not very programmer friendly :upside_down_face: .
It works well, and it’s easy to understand, but without some wrapper, it’s hard to write readable and safe code…

Writing a simple wrapper was one of the very first things I had to do when I started developing addons ~9 yeas ago.
You know, something that allows me to define a key and the default value and then I can perform basic operation like get/set/reset/remove/addOnChangeListener on that key in the store.
Like this:

The IndexedDB has amazing powers, but the API is ********* :smiley: .
You just can’t use it directly in the app, writing a wrapper is a must.

I’m actually currently migrating one of my addons to “web application”, so I’m writing polyfill for the whole browser API, and I’ve used IndexedDB for the extension storage API and I’m totally surprised how well it works.

Thanks for starting this discussion! I’ve mostly used browser.storage.local in small projects because it’s simple and doesn’t require extra setup. For me, the main consideration is reliability across sessions.