Distributed-Storage-Project / Storage-Layer

0 stars 0 forks source link

(1) Research and select a suitable low-level database for time series data #1

Closed HannahBagtasos closed 1 year ago

HannahBagtasos commented 1 year ago

Background:

A low-level database for our distributed system is needed to ensure optimal performance, scalability, and fault tolerance.

Suggested low-level databases:

Resources:

1.Research and select a suitable low-level database for time series data:

a. Conducted research on low-level databases for time series data. b. Evaluated pros and cons of the different database based on criteria for scalability and performance. c. Selected a suitable low-level database based on research. d. Documented the process of research. e. Communicated findings to mentor and project team

HannahBagtasos commented 1 year ago

Using SQLite

Examples using timestamps: https://www.sqlite.org/lang_datefunc.html

Compute the current date.
SELECT date();

Compute the last day of the current month.

SELECT date('now','start of month','+1 month','-1 day');
Compute the date and time given a unix timestamp 1092941466.

SELECT datetime(1092941466, 'unixepoch');
SELECT datetime(1092941466, 'auto'); -- Does not work for early 1970!
Compute the date and time given a unix timestamp 1092941466, and compensate for your local timezone.

SELECT datetime(1092941466, 'unixepoch', 'localtime');
Compute the current unix timestamp.

SELECT unixepoch();
SELECT strftime('%s');
Compute the number of days since the signing of the US Declaration of Independence.

SELECT julianday('now') - julianday('1776-07-04');
Compute the number of seconds since a particular moment in 2004:

SELECT unixepoch() - unixepoch('2004-01-01 02:34:56');
Compute the date of the first Tuesday in October for the current year.

SELECT date('now','start of year','+9 months','weekday 2');
Compute the time since the unix epoch in seconds with millisecond precision:

SELECT (julianday('now') - 2440587.5)*86400.0;