Microservices - Event-Driven Architecture
Consider this simplified event processing code snippet in a microservice:
eventQueue = []
function processEvent(event) {
if (event.type === 'update') {
database.update(event.data)
}
}
// Events arrive asynchronously
processEvent({type: 'update', data: {id: 1, value: 'A'}})
processEvent({type: 'update', data: {id: 1, value: 'B'}})
// What is the likely final value in the database for id 1?