Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The default storage will be sqlite. The scenario for cache storage have these characterstics:

  1. Sequential writing

  2. Adapt to limited CPU+Memory platform

  3. Async, await mechanism (non-transaction)

  4. Append-only, No Edit

We will use these sqlite configurations by default:

  1. Set Page Size as same as OS’s page size (getconf PAGESIZE)
    PRAGMA page_size = 4096;

  2. Set as WAL mode 
    PRAGMA journal_mode=WAL;

  3. Set synchronous mode as full, so that it won’t corrupt the database file when experiencing power down.
    PRAGMA synchronous=FULL 

  4. Set checkpoint to auto or disable it and mange it by self-define interval. 
    Enable: PRAGMA wal_autocheckpoint; or sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
    Disable: PRAGMA wal_autocheckpoint=N;

Implementation consideration

...