This runs on python and works with several backends including SQLite. https://requests-cache.readthedocs.io/en/stable/
SQLite is used in some HPC work.
ISO-8601 datetime strings can easily wreck your L1 cache. Instead of filling an eighth of the cache with a 64-bit value, you wind up filling almost half with a 27-character-long string.
What format works well for hardware caching?
As small as you can tolerate tbh. The game is played by keeping data as small as possible and ensuring that related data has good locality in memory.
The gap between how fast your CPU works and how fast data can be retrieved from RAM is enormous.
This is what we do. Have been storing 100% of our timestamps this way in SQLite for ~8 years now. Using .NET to handle the actual conversion to/from long.
var myTimeUtc = DateTime.UtcNow;
var myTimeUnix = new DateTimeOffset(myTimeUtc).ToUnixTimeSeconds();
var myTimeUtc2 = DateTimeOffset.FromUnixTimeSeconds(myTimeUnix).UtcDateTime;
No drama at all. No weird libraries or utility methods. It's all simple built-ins these days.I am doing something very similar with .NET stack (single file deployments), SQLite and offline scenario...
Please contact me on my username's email (gmail).
Any code (usually one codebase) which looks at dates in a SQLite DB can already easily do these conversions, even at the application-level.
- Store the date as a huge, wasteful string in ISO8601 format
- Store it as Unix epoch seconds
- Store it as a fractional Julian day
Besides the first one, you have to remember how the date is stored and ensure all client libraries handle the conversion. If you want to view or manipulate the latter 2 formats in SQL, you need to chain a bunch of conversion functions.