-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.cql
76 lines (58 loc) · 1.81 KB
/
data.cql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
-- Keyspace
CREATE KEYSPACE IF NOT EXISTS retrospect WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : '1' };
-- Back-end
CREATE TABLE IF NOT EXISTS retrospect.spans (
span_id text,
trace_id text,
session_id text,
user_id text,
chapter_id text,
time_sent bigint,
trigger_route text,
status_code smallint,
data ascii,
request_data ascii,
time_duration duration,
PRIMARY KEY(span_id, session_id, time_sent)
) WITH CLUSTERING ORDER BY (session_id DESC, time_sent DESC);
CREATE INDEX ON retrospect.spans (trace_id);
CREATE INDEX ON retrospect.spans (session_id);
CREATE INDEX ON retrospect.spans (user_id);
CREATE INDEX ON retrospect.spans (chapter_id);
CREATE INDEX ON retrospect.spans (time_sent);
CREATE INDEX ON retrospect.spans (request_data);
-- Front-end
CREATE TABLE IF NOT EXISTS retrospect.events (
session_id text,
user_id text,
chapter_id text,
data ascii,
PRIMARY KEY(data, session_id)
);
CREATE INDEX ON retrospect.events (session_id);
CREATE INDEX ON retrospect.events (user_id);
CREATE INDEX ON retrospect.events (chapter_id);
-- Full dom snapshots
CREATE TABLE IF NOT EXISTS retrospect.snapshots (
session_id text,
data ascii,
PRIMARY KEY(data, session_id)
);
CREATE INDEX ON retrospect.snapshots (session_id);
-- DB Span Queue
CREATE TABLE IF NOT EXISTS retrospect.db_span_buffer (
span_id text,
trace_id text,
chapter_id text,
session_id text,
user_id text,
trigger_route text,
time_sent bigint,
status_code smallint,
data ascii,
request_data ascii,
time_duration duration,
PRIMARY KEY(span_id)
);
CREATE INDEX ON retrospect.db_span_buffer (session_id);
CREATE INDEX ON retrospect.db_span_buffer (trace_id);