This repository has been archived by the owner on Jan 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TODO
100 lines (76 loc) · 2.04 KB
/
TODO
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
restrictions :
key size = 32
value size = 32
Commands :
Commands are not case sensitive
put <key> <value>
get <key>
set <key>
list
rmv <key>
TODO:
incr (optionnaly add a number to increment by)
decr (optionnaly add a number to increment by)
list -> use filtering (list for primary base, and hashmap entries)
count (with filtering)
sort (for lists)
expire
quit
status --->> return server status
Data types:
strings (size 32)
define keys and value size in config file
in table : A used element should point to the next used element. Then use this when rebuilding
index tables. This will avoid browsing the all table and unused elements.
TODO :
numbers (int, float, ...)
hashmap
btree
list
TODO : Special syntax (start line with %)
to use with commands
$(entry_name) ---->> get the values whose key is stored in entry_name (can use *******...)
$($(entry_ptr))
$(key.hash_key)
$($(key_ptr).$(hash_key_ptr))
key.hash_key ------>> get a value from key in a hash map entry, position in a list or weight in a btree
key.hash_key.sub_hash_key
$(key_ptr).hash key
key.$(hash_key_ptr)
$(key_ptr).(hash_key_ptr)
Protocol :
string : (currently commands are sync)
request:
<command>[\r]\n
reply:
OK\r\n | NOK\r\n
<value>\r\n (only for "get" replies) OR error message
TODO :
multiple attributes request and replies
async protocol
return code
TODO:
Binary protocol
Other TODOs :
IMPORTANT !!!!! --->> Spaces in values
Make command case unsensitive
Add console color capability in utils.h ---->> http://en.wikipedia.org/wiki/ANSI_escape_code
Configure name of database file
Client API
Ideas for future :
Direct acces by hash code
Transaction client side
Transaction
Defense
Clustering / Distribution
Replication
Resize index table and data table
Datamodel restriction + design file
Events
Use poll or epoll with socket
Use worker threads
Architecture:
Threads:
1 Thread for main thread
1 Thread for accepting connections
1 Thread for each client connection