What is idempotency ?
Idempotence is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application.
When 2 identical requests are sent almost at the same time, your service must handle them accordingly, for example, if a web app sends a duplicate request to book (due to various reasons) a movie ticket, the service must understand which request should be accepted and only process one...
If you haven’t read the first part, I highly recommend to check first.
Series
Building Authentication Service with TOTP (Time-Based OTP) Part 1. The Server
Building Authentication Service with TOTP (Time-Based OTP) Part 2. The Client
Optional Requirement
http server
GoalIn this part two of the series we are going to build a client using HTML and javascript (jQuery). The finished product will be 2 pages one for login and the other for registering.
In the register page, when the user succes...
Series
Building Authentication Service with TOTP (Time-Based OTP) Part 1. The Server
Building Authentication Service with TOTP (Time-Based OTP) Part 2. The Client
Pre-requisite
Java 17
Micronaut
Goal
In this two-part series, we are going to build a web application and a REST API service.
After finishing this series hopefully, we get a better understanding of what TOTP is and how to implement it.
We are going to build the REST API using Java with Micronaut framework and the Web App using the...
Pre-requisite
NodeJs
Why?When creating a Web API, there is a need to manage a client’s context so that when it’s required in a function, the function gets the correct context and processes the data.
To achieve that, we often pass parameters to each function.
1234567891011121314//illustrationfunction (req, res) { const user = req.user validateuser(user);}function validateUser(user) {}function getProducts(user) { updateUserLastVisit(user);}function update...
Pre-requisiteYou need to make sure that these are installed in your environment :
Rust
Cargo
Node Js
What is MQTT ?MQTT (Message Queuing Telemetry Transport) is another messaging protocol designed to be lightweight so it can be used in IOT devices.
The basic idea is pub-sub, devices connected to a message broker and they exchange data by subscribing (to receive) or publishing (to broadcast).
You can read a more detailed info on what is MQTT in this link.
We are now going to simulate a MQTT...