You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/11_cluster.md
+28-17Lines changed: 28 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,17 @@
11
11
12
12
### Description
13
13
14
-
The server is the starting point of the whole application. Deriving from other languages and systems, such as Ruby or Java, it represents the application server.
15
-
16
-
The server implementation also represents the cluster master. It manages the whole IPC pool and starts and restarts the workers in case they crash. A crashing worker is called a worker crash.
17
-
18
-
The master takes care of an application's high availability to keep it operable even if the worker crash. To ensure that goal, the master's implementation is as easy and definitive as possible.
19
-
20
-
If the master crashes, the application's availability cannot be ensured anymore. This case is called a master crash.
14
+
The server is the starting point of the whole application. Deriving
15
+
from other languages and systems, such as Ruby or Java, it represents
16
+
the application server. The server implementation also represents the
17
+
cluster master. It manages the whole IPC pool and starts and restarts
18
+
the workers in case they crash. A crashing worker is called a worker
19
+
crash. The master takes care of an application's high availability
20
+
to keep it operable even if the worker crash. To ensure that goal,
21
+
the master's implementation is as easy and definitive as possible.
22
+
23
+
If the master crashes, the application's availability cannot be
24
+
ensured anymore. This case is called a master crash.
21
25
22
26
## Worker
23
27
@@ -33,14 +37,17 @@ If the master crashes, the application's availability cannot be ensured anymore.
33
37
34
38
The worker is started and managed by the cluster master.
35
39
36
-
After forking the worker process, the backend configuration is loaded and all connections for the specific modules are established.
37
-
38
-
Once completed, the Express application is initialized and middleware is loaded into the application's request stack. Subsequently, the specific modules are searched for controllers and integrated into the application.
39
-
40
-
Furthermore, the ``configure`` method is called to load worker specific middleware or to start other bootstrapping processes.
41
-
42
-
Finally, the HTTP server is provided with the configured Express application and starts listening to the configured TCP port.
43
-
40
+
After forking the worker process, the backend configuration is loaded
41
+
and all connections for the specific modules are established.
42
+
Once completed, the Express application is initialized and middleware
43
+
is loaded into the application's request stack. Subsequently, the
44
+
specific modules are searched for controllers and integrated into
45
+
the application. Furthermore, the ``configure`` method is called
46
+
to load worker specific middleware or to start other bootstrapping
47
+
processes.
48
+
49
+
Finally, the HTTP server is provided with the configured Express
50
+
application and starts listening to the configured TCP port.
44
51
The application is ready by this point.
45
52
46
53
## Worker Context
@@ -52,7 +59,11 @@ The application is ready by this point.
52
59
53
60
### Description
54
61
55
-
The worker context is different from the generic worker as it provides the worker with additional information. Theoretically, the generic worker would suffice to run an application, it wouldn't describe an application specific profile, though.
62
+
The worker context is different from the generic worker as it provides
63
+
the worker with additional information. Theoretically, the generic worker
64
+
would suffice to run an application, it wouldn't describe an application
65
+
specific profile, though.
56
66
57
-
To add another worker to the project, only a new context is needed, even if it isn't specialised in anything.
67
+
To add another worker to the project, only a new context is needed,
Copy file name to clipboardExpand all lines: docs/guide/20_backend.md
+46-31Lines changed: 46 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,40 @@
2
2
3
3
## Managing the backend with db-Store
4
4
5
-
To manage the framework's backend connections, a special backend layer was implemented.
6
-
7
-
The db-Store now acts as the layer's head. It processes the backend configuration and intializes all backends with their corresponding connections. Furthermore, it provides the possibility to integrate different a different ORM for each backend.
8
-
9
-
db-Store works absolutely asynchronous, which results in the layer's high performance.
10
-
11
-
Additionally, db-Store includes and defines a set of methods for every backend interface. A purposeful and easy workflow is etablished using these methods. The current backend adapters are currently limited to MySQL, MongoDB, and Memcached.
12
-
13
-
Every adapter provides the possibility to use the backend's native implementation, making specialised accesses easy.
5
+
To manage the framework's backend connections, a special backend
6
+
layer was implemented. The db-Store now acts as the layer's head.
7
+
It processes the backend configuration and intializes all backends
8
+
with their corresponding connections. Furthermore, it provides the
9
+
possibility to integrate different a different ORM for each backend.
10
+
db-Store works absolutely asynchronous, which results in the layer's
11
+
high performance. Additionally, db-Store includes and defines a set
12
+
of methods for every backend interface. A purposeful and easy workflow
13
+
is etablished using these methods. The current backend adapters are
14
+
currently limited to MySQL, MongoDB, and Memcached.
15
+
Every adapter provides the possibility to use the backend's
16
+
native implementation, making specialised accesses easy.
14
17
15
18
## db-Store's methods
16
19
17
-
db-Store should be the first big initialisation as it is of vital importance for persisting data.
20
+
db-Store should be the first big initialisation as it
21
+
is of vital importance for persisting data.
22
+
If the adapter's configuration fails, the worker has to
23
+
be shut down by normal means. After shutting down the worker,
24
+
the master tries to spawn a new worker to take the previous
25
+
one's place which enables the worker to start a fresh
26
+
backend connection.
18
27
19
-
If the adapter's configuration fails, the worker has to be shut down by normal means. After shutting down the worker, the master tries to spawn a new worker to take the previous one's place which enables the worker to start a fresh backend connection.
20
-
21
-
Unless interrupted manually, the server tries to spawn workers indefinitely until the designated amount of workers is reached. Database failures and other external failures can be bypassed by this measurement, without requiring manual interference.
28
+
Unless interrupted manually, the server tries to spawn workers
29
+
indefinitely until the designated amount of workers is reached.
30
+
Database failures and other external failures can be bypassed by
31
+
this measurement, without requiring manual interference.
22
32
23
33
## db-Store in action
24
34
25
35
### Configuration
26
36
27
-
db-Store can handle multiple backend connections by using a structure like these:
37
+
db-Store can handle multiple backend connections by
38
+
using a structure like these:
28
39
29
40
/**
30
41
* Current Environment specific Database connections
@@ -49,30 +60,34 @@ db-Store can handle multiple backend connections by using a structure like these
49
60
50
61
### Initialisation
51
62
52
-
Inside the generic worker, you can use db-Store like this:
63
+
The generic worker implementation will setup the db-Store automatically
64
+
by your given configuration. So after booting the worker you can use all
0 commit comments