Uncategorized
9.8k words
IntroThis is part 2 of the “Realtime Data with Mariadb” Series, if you haven’t got the chance to read part 1 I highly recommend to read it first. WebsocketNow that we’ve successfully listened to database changes, we want to streamline it with WebSocket. In this example I am using Micronaut’s websocket feature, you are obviously free to choose any framework or even implement it yourself. As usual all the code in this article will be available here Project SetupLet’s start by creating a microna...
Uncategorized
5k words
GoalWe are going to learn and build a service that serves real-time data with MariaDB as the underlying database. Why?User expectations are increasing, and real-time data has become mandatory for a great web application. In this article, we are going to see possible options to build real-time data that serves data with MariaDB as our database. There are a lot of software that offers this kind of real-time feature, one of them is debezium another is supabase, but we are going to create it our ...
Uncategorized
2.3k words
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...
Uncategorized
2.1k words
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...
Uncategorized
5.2k words
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...
Uncategorized
2.9k words
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...
Uncategorized
2.8k words
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...