Angular πŸ‡ΊπŸ‡¦ - practical notes
1.63K subscribers
1.6K photos
1 file
532 links
Angular - practical notes

This group is for posting practical notes for Angular developers. Mostly all posts are for quick implementation https://t.me/angular_practical_notes (Commenting on posts only in ENG and UA langs here). Welcome!
Download Telegram
πŸ“„ Saga Pattern Guide in Microservices with Node.js

#nodejs #guide #pattern

The Saga pattern addresses this by breaking a transaction into smaller, local transactions handled by different services.


There are 2 approaches to implementing the Saga pattern: Choreography-Based Saga and Orchestration-Based Saga.

β€” Orchestration-Based Saga: A single orchestrator (arranger) manages all the transactions and directs services to execute local transactions.
β€” Choreography-Based Saga: All the services that are part of the distributed transaction publish a new event after completing their local transaction.


Choreography-Based Saga approach and a real-world hotel room reservation scenario with 3 microservices: Booking Service, Payment Service, and Notification Service.

β€” Booking Service: Starts the process by reserving a room. This is the first local transaction. Once successful, it sends a message to the Payment Service to process the payment.
β€” Payment Service: Receives the message and processes the payment. If the payment is successful, it commits its local transaction and informs the Booking Service and Notification Service.
β€” Notification Service: On receiving confirmation of successful payment, it sends a booking confirmation email to the user.
β€” Handling Failures: If the Payment Service encounters an issue (e.g., payment decline), it returns a failure message to the Booking Service. The Booking Service then executes a compensating transaction to cancel the room reservation, ensuring the system returns to its original consistent state.


Prerequisites

β€” Node.js project with necessary dependencies (express, amqplib, nodemailer, mongoose, dotenv) installed.
β€” RabbitMQ server running locally or remotely.
β€” Email server or service for the Notification Service (e.g., Nodemailer with SMTP or an email API service).


βœ… Article link
πŸ‘2
❀️🈯️ Angular & NodeJs: Integrating Google Login

#angular #nodejs #google #auth #guide

βœ… Article link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM