Computer-implemented method for processing an incoming message stream, the method comprising: storing context data of an application in a global database, wherein the context data describes a state of the application at a point in time, wherein the global database is accessible by a first process and by a second process, the first and second processes (100, 200) being two instances of the application; placing a plurality of messages from the incoming message stream. in an in-memory message queue, wherein the in-memory message queue is shared by the first and second processes (100, 200); and processing messages from the incoming message stream by each of the first and second processes (100, 200) in two phases, a first phase and a second phase, comprising executing one of the first phase and the second phase (MP, DP) at the first process and executing the other one of the first and second phases (MP, DP) at the second process, such that the first process and the second process alternately execute the first phase and the second phase and the first and second phases (MP, DP) performed by the first and second processes (100, 200) are not overlapping, wherein the first and second processes (100, 200) are coordinated and synchronized by using a first semaphore and a second semaphore for alternately processing the first phase and the second phase by the first process and the second process, respectively, wherein the first phase comprises: processing (S306 to S316) at least one message from the plurality of messages and storing at least one corresponding result in a local memory area (120, 220), wherein each of the first and second processes (100, 200) has a local memory (120, 220) used to store processing data resulting from executing the first phase; and storing at least one modification to the context data in the local memory area (120, 220) in accordance with the at least one corresponding result; and wherein the second phase comprises: performing (S328 and S330) a transaction of the at least one result and the at least one modification of the context data to the global database; and committing the transaction. storing context data of an application in a global database, wherein the context data describes a state of the application at a point in time, wherein the global database is accessible by a first process and by a second process, the first and second processes (100, 200) being two instances of the application; placing a plurality of messages from the incoming message stream. in an in-memory message queue, wherein the in-memory message queue is shared by the first and second processes (100, 200); and processing messages from the incoming message stream by each of the first and second processes (100, 200) in two phases, a first phase and a second phase, comprising executing one of the first phase and the second phase (MP, DP) at the first process and executing the other one of the first and second phases (MP, DP) at the second process, such that the first process and the second process alternately execute the first phase and the second phase and the first and second phases (MP, DP) performed by the first and second processes (100, 200) are not overlapping, wherein the first and second processes (100, 200) are coordinated and synchronized by using a first semaphore and a second semaphore for alternately processing the first phase and the second phase by the first process and the second process, respectively, wherein the first phase comprises: processing (S306 to S316) at least one message from the plurality of messages and storing at least one corresponding result in a local memory area (120, 220), wherein each of the first and second processes (100, 200) has a local memory (120, 220) used to store processing data resulting from executing the first phase; and storing at least one modification to the context data in the local memory area (120, 220) in accordance with the at least one corresponding result; processing (S306 to S316) at least one message from the plurality of messages and storing at least one corresponding result in a local memory area (120, 220), wherein each of the first and second processes (100, 200) has a local memory (120, 220) used to store processing data resulting from executing the first phase; and storing at least one modification to the context data in the local memory area (120, 220) in accordance with the at least one corresponding result; and wherein the second phase comprises: performing (S328 and S330) a transaction of the at least one result and the at least one modification of the context data to the global database; and committing the transaction. performing (S328 and S330) a transaction of the at least one result and the at least one modification of the context data to the global database; and committing the transaction.