The optional chaining operator (?.
) permits reading the value of a property located deep within a chain of connected objects without having to expressly validate that each reference in the chain is valid.
Note: The ?.
operator functions similarly to the .
chaining operator, except that instead of causing an error if a reference is nullish (null
or undefined
), the expression short-circuits with a return value of undefined
. When used with function calls, it returns undefined
if the given function does not exist.
This results in shorter and simpler expressions when accessing chained properties when the possibility exists that a reference may be missing. It can also be helpful while exploring the content of an object when there’s no known guarantee as to which properties are required.
Problem domain: Analytics
You define jobs in AWS Glue to accomplish the work that’s required to extract, transform, and load (ETL) data from a data source to a data target. You typically perform the following actions:
Problem domain:
Asynchronous Communication in Microservice World
What does it offer?
Event ingestion from many sources(AWS services or Third party)
Event delivery (Targets can be AWS service or Third party)
Event security
Event access Authorization
Event consumption Error handling
Benefits:
Connect data from SaaS apps
EventBridge ingests data from supported SaaS applications and routes it to AWS service targets through native integration in the AWS management console.
Write less code
EventBridge makes it easy to connect applications together because you can ingest, filter and deliver events without writing custom code.
Easily build event-driven architectures
With EventBridge, your event targets don’t…
a) How to represent time in an universal format?
Answer: As a number
Explanation:
Epoch time — The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970.
Ex: 1606982441
In Nodejs,
let dateNow = Date.now();
console.log(dateNow) //1606984719575
So dateNow is a number and is in Unix Epoch.
b) How to convert time in number to specific date and time according to timezone?
let date = new Date(dateNow)
let temp = date.toLocaleDateString(undefined, {timeZone:’Asia/Kolkata’});
console.log(temp) // 3/12/2020
In Windows, the output will be 3/12/2020 i.e dd-mm-yyyy In Linux…
The core idea in the messaging model in RabbitMQ is that the producer never sends any messages directly to a queue. Actually, quite often the producer doesn’t even know if a message will be delivered to any queue at all.
Instead, the producer can only send messages to an exchange. An exchange is a very simple thing. On one side it receives messages from producers and the other side it pushes them to queues.
…
Very good blog to read about the life cycle of messages in SQS
Important points:
It is an open OASIS and ISO standard lightweight, publish-subscribe network protocol that transports messages between devices.
Historically, the “MQ” in “MQTT” came from the IBM MQ.
Just like HTTP has a client and server, the MQTT protocol defines two types of network entities: a message broker and a number of clients. An MQTT broker is a server that receives all messages from the clients and then routes the messages to the appropriate destination clients. …
I have been trying to follow the below medium link to create PDF from html and I came to know some problems and solutions.
Problems:
Code snippet:
const templateFile = fs.readFileSync(resumeTemplatePath, ‘utf8’);
const…
A bookmark of useful links
One important note: A pipe can have both ends.One end to read and other end to write. Remember that read speed and write speed has to be taken care while you program, otherwise if write is slower than read, your memory might get crashed as it has to wait for write to complete.
Understand the concept of Back pressure
https://medium.com/@jayphelps/backpressure-explained-the-flow-of-data-through-software-2350b3e77ce7
Max size of a buffer in Nodejs: https://stackoverflow.com/questions/8974375/whats-the-maximum-size-of-a-node-js-buffer#:~:text=Maximum%20length%20of%20a%20typed,2Gb%20%2D%201byte%20on%2064%2Dbit
Using Nodemon in docker
https://medium.com/better-programming/docker-in-development-with-nodemon-d500366e74df
What mistakes I did?
I deployed mongo DB on an EC2 instance using docker and kept following configurations.
Few days back, when I tried to see my collection, it was empty and there was one collection created by hacker stating to pay for the data.
Luckily it was just a test data, nothing serious. But it taught me a lesson that even if we are just spinning up a simple test MongoDB, we must setup authentication.
Hacking is real and they can target anyone.
Stay alert and think about securing your DB.
Suffering from Knowledge Quest