Lots of freelancers hate having to call up people on the phone and asking if they’ve got any work for them. If only there was a...
The Angular NL Conference Highlights (Part 3)Stijn Vanpoucke
Time for the final part of our blog series with a detailed overview of the AngularNL Conference highlights!
In this final part we will give you an overview with the most memorable highlights of Maurice De Beijer’s talk: “Event-Sourcing your AngularJS application”
Event-Sourcing your AngularJS application
Maurice De Beijer explained us the difference between using traditional Rest operations, CQRS and Event Sourcing. He explained us when we should and when we should not use one of them.
Using the $resource operations to fetch data from a traditional REST resource is perfectly fine for basic CRUD applications as explained by Maurice. In more complex business applications you might be missing some information because you only retrieve and update the data but you never know why it has been updated.
A step closer on having that information can be achieved by using CQRS (Command Query Responsibility Segregator). In a CQRS system functional interpretable commands are being send to the backend and translated to database operations in contradicition of using CRUD operations direclty. For example openBankAccountCommand, payInvoiceCommand, … .
With CQRS we now know why we do those database operations but we’re still not storing those operations, which can still pose a problem. Imagine that a bank only keeps track of your total balance, but you cannot see how it has been summed together, would you like that? In reality your total bank account balance is the sum of all the separated transactions you did, the bank doesn’t just add and subtract from the total balance but they store all the transactions and they are combined together to calculate the total balance.
By applying Event Sourcing all those separated operations are also stored seperatly in the database, and that single database record as we knew it before is now a calculated by combining all those operations.
To implement Even Sourcing we need a command database who stores all those separate commands and then we need a projection service that does the batch operation to accumulate the data into a query database which contains the summed information.
When we take this back into our bank account example this means there’s a database with all the bank transaction which is used by the client application for write operations and there’s a different database where the calculated total balance gets stored for the read operations.
The disadvantage is that their might be a slight delay between the moment in time where the user does an action and when he sees the result. This can be resolved by either using push notifications to highlight when the operation has been finished or to fake the operation already on the front-end before the back-end has projected the commands into the query database.
Win a waterproof Bluetooth speaker
We are giving away 2 waterproof Bluetooth speakers!
Our competition will start on Friday 6/03/2015 and will end on 16/03/2015.
How can I win?
1. Send us an email (email@example.com) with the answer to the question below
2. Share this blogpost on Twitter or Facebook by using the social share buttons below: here
“What was the subject of Pawel Kozlowski’s talk at the Angular NL Conference 2015?”
You can find the answers to these questions in our previous blogs in our Angular NL Conference Highlights: Link
Blog written by Stijn Vanpoucke
Liferay Expert at ACA IT-Solutions
The competition is open for people who have answered correctly on our question in this blog by email. This competition is open for all legal residents of all countries and is void where prohibited by law. Employees of ACA IT-Solutions, their respective affiliates, subsidiaries and their immediate family members and/or those living in the same household of each are not eligible to participate in this competition. The competition is subject to all apllicable federal, state and local laws and regulations. Void were prohibited.
The competition start and end-date is mentioned in the related post. The winner will be chosen at random (at random.org) from the entrants after the competition closes on the end-date. The odds of winning depend on the number of eligible entries received. Winner will be contacted via email within 24 hours after the end of the contest and will be announced on this blog / in the newsletter. A winner must respond to ACA IT-Solutions’ email within ten (10) days to claim the prize mentioned in the related post.
You may only enter once and you must fill in the information requested. You may not enter more times than indicated by using multiple identities or multiple email addresses. If you use fraudulent methods or otherwise attempt to circumvent the rules your submission may be removed from eligibility at the sole discretion of ACA IT-Solutions. ACA IT-Solutions has the right, in its sole discretion, to maintain the integrity of the sweepstakes, to void votes for any reason, including, but not limited to; multiple entries from the same user from different IP addresses; multiple entries from the same computer in excess of that allowed by sweepstakes rules; or the use of bots, macros or scripts or other technical means for entering.
By entering the contest you agree to receive email newsletters periodically from ACA IT-Solutions. You can opt-out of receiving this communication at any time by clicking the unsubscribe link in the newsletter. By entering you agree to release and hold harmless ACA IT-Solutions and its subsidiaries, affiliates, advertising and promotion agencies, partners, representatives, agents, successors, assigns, employees, officers and directors from any liability, illness, injury, death, loss, litigation, claim or damage that may occur, directly or indirectly, whether caused by negligence or not, from such entrant’s participation in the contest and/or his/her acceptance, possession, use, or misuse of any prize or any portion thereof, technical failures of any kind, including but not limited to the malfunctioning of any computer, cable, network, hardware or software; the unavailability or inaccessibility of any transmissions or telephone or Internet service; unauthorized human intervention in any part of the entry process or the Promotion; electronic or human error which may occur in the administration of the Promotion or the processing of entries.