I got graduated from the Cloud Developer nano-degree program ~ 2 weeks ago, and I decided to share my experience in quick Q&A, so if you have any other questions in your mind after reading this post, please don’t hesitate to comment.
What’s Udacity Nano-degree? 💡 💡
It’s an online certificate that you earn it after you enroll in one of the nano degree programs provided by Udacity.
How long will it take to graduate from the program? 🎓🎓🎓
Usually, most of the programs take ~ 4-6 months, but it depends on the program you enroll in, as each one…
There are many ways to implement finding nearest locations by given latitude and longitude .
Some of the implementations can be achieved through a backend logic,
and the other ways can be done by utilizing some features(Spatial Indexes) provided by DBMSs’(Mysql, SQL, MongoDB,….etc).
In this post I will explain by example how we can do it with MongoDB.
What are Latitude and Longitude? , You can find more from here https://www.latlong.net/
Let’s create a collection in MongoDb and we call it
To Achieve the query of finding nearest locations by given latitude and longitude, we do the following…
— A query language for your API .
— It is a methodology that directly competes with REST (Representational state transfer) APIs, much like REST competed with SOAP at first .
— It’s not tied to a specific technology, but you can implement it in any language.
-GraphQL is a data query language using two types of requests — queries (read operations retrieving data from the server) and mutations (write operations modifying data on the server).
- You can serve all the client requests with one endpoint.
GraphQL was developed internally by Facebook in 2012 before being publicly released in…
It’s a feature added in MongoDB starting from the version 3.6, that give you an ability to keep you up to date with your data changes .
So in case of any changes(write messages: Insert, Update, Delete) that happen against a specific collection, it triggers a `change event` with the data that has been changed.
Change streams will engage developers to effectively use the control of MongoDB’s real-time usefulness to respond to pertinent information changes promptly.
1- MongoDb version 3.6 or any version after it.
2- Create MongoDb Replica Set [How to create replica set using docker ? > https://www.sohamkamani.com/blog/2016/06/30/docker-mongo-replica-set/]
Actually, it started to happen when the HTML document has been switched to designMode .
The entire document becomes editable, then the document object exposed new method called `execCommand`.
Most of the commands affect the document’s selection (bold, italics, etc.) .
Ahead to do some coding 🚀 … in the following example, we have a `div` which is editable, and we will execute some commands like `Bold`, `italic`, `delete` , and `adding an image` to that `div` via document’s commands :
Note: Run the Pen…
How the requests are being handled inside Node.js server ?
First of all we need to know the main components inside any Node.js server :
1- Event Queue: It’s a queue that contains all the requests which are coming from the clients.
for example: When the node.js server gets 1,2,3,4,…n number of requests, all of them will be pushed to that queue , before being picked up by the event loop .
2- Event Loop: It’s a Component inside node.js server that allows node.js to perform non-blocking I/O operations, so event loop is picking up the requests from the Event…
Actually, I will jump quickly, into an example so I can explain the Redux concept step by step in a better way .
Let’s assume that we have a React JS application , and this application has 3 Components , each component has its own states :
A- Component 1 has state object of ( X1, Y1 ).
B- Component 2 has state object of( X2 , Y2 ).
C- Component 3 has state object of ( X3 , Y3 ).
What are the websocket’s headers that have to be configured ?
First of all we have to know the two types of HTTP headers :
1- End to end headers : Which must be transmitted to the ultimate recipient of a request or response.
2- Hop by Hop headers : Is getting transferred between intermediate points, so those headers are not stored by caches or forwarded by proxies .
So as a Note:
Web Sockets rely on hop by hop headers especially( `Connection` and `Upgrade`) , and as we just knew…
1- Read Lock or a shared lock:
The locked data is reserved for read by the current session. Other sessions can read the locked data. But they can not write (update) the locked data.
2- Write Lock or an exclusive lock:
The locked data is reserved for write by the current session. Other sessions can not read and write the locked data.
Levels of locking:
1- Table lock : All the rows will be locked when the table is locked. 2- Row lock : Some rows will be locked in the table , but other rows will not be locked…