-
Notifications
You must be signed in to change notification settings - Fork 77
/
README.txt
80 lines (53 loc) · 2.82 KB
/
README.txt
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
Domain
------
The application provides users with ability to continuosly monitor various social networks.
Users create topics of interest, which then used in queries to a particular vendor search APIs.
Requirements
------------
1. Reliable searching
Search API could fail and be temporariliy unavailable for some time.
It could be an intermittent connection failure or it could be a serious outage.
Intermittent failures should be gracefully handled without introducing unneccessary delays.
In case of serious problems (API outages) human intervention is ok.
2. Economically scalable
As the number of users increase, the per-user cost of the
overall system must decrease in order to sustain the system.
3. Fair use of resources
Certain social networks have certain limits for search requests per-day (hour, second).
That said, the solution should take this into account and provide fair search request
distribution across all users (topics).
4. Designed for availability
The application should aim for high availability while meeting
defined performance targets (sub-second response time)
NOTE: "Fair use of resources" is out of scope for the sample project
Actors
------
Api is the singleton actor per search provider (social network)
- Api performs search requests against certain search provider APIs
- Api implements CircuitBreaker pattern:
- Api could lock itself and won't issue "real" search requests
until certain search provider API is available again
- Api could notify when availability changes
- Api manages search provider's request limits (*not in the sample project*)
Topic executes user specified queries against particular Apis on a recurrent schedule
- Topic aggregates results received from Api
- Topic stores aggregated total in a BLOB
- Topic stores configured schedule in another BLOB
- Topic restores its schedule upon activation, ie updates persistent reminders
SystemConsole is an external client which monitors availability of Api
- Subscribes to notifications from Api
- Administrators could use it to re-enable searches for particular Api
NOTE: Store/restore of Topic's schedule is out of scope for the sample project.
Scenarios (in progress)
-----------------------
First time Topic get failed reply from Api,
it should schedule local timer to retry request every 5 seconds
If Api is still unavailable for 3 consecutive retries:
Topic should disable search for that Api (ie, delete persistent reminder)
Topic should cancel local retry timer
If during retries Api is back avaiable again
Topic should cancel local retry timer
Topic should allow scheduled searches
If Topic receives scheduled search request (from persistent reminder)
While in retry state - it should ignore it
Otherwise it should issue search request to particular Api