Skip to main content

Time to hit F5 on some OS concepts

A lot stuffs happened during this break. I'll scratch em down here later cz it isn't time for it.

It's Sunday 2:30 am and I'm not gonna lie, I couldn't sleep in peace for the past 2 days as my mind has been haunted by an issue.
One of my hobby app is firing a lot of requests to the Google Cloud Datastore. Technically speaking, my app has been well optimized for least requests - and it is doing it right. It turns out the issue is normal: the more people uses the app the more hits on the Datastore and each hit costs.
Even though Google offers an economic awesome pricing scheme on Datastore, I've to account for higher hit ratio. I'm not rich, I've to fix this.

I'm thinking of some kind of a caching mechanism. I've found some npm modules out their, unfortunately they don't have the right balls. So decided to give a try to make a pluggable solution that works just like how the OS manages hdd-ram-cache stack on a computer. But, my app is not built to run on any computer, but on server. They are different. It's necessary to consider the consistency of data over multiple instance deployments and parallel processors, and how this is gonna behave over a load balancer.

So it's time to press F5 on my OS and Parallel processing classes and jump right into code.
I'll be publishing it once it is ready.

Peace ✌️️

Popular posts from this blog

How to pass variables to res.render() in Node.js

I was trying to figure out how to render a view inside a view, as I was stuck with this issue.

Horrible Effects of Misplaced Extensions ;)
I was using Node.js platform with ejs template engine.

My index.ejs file has an included header.ejs file.
Everything works well except that I can't pass values to the variable status in header.ejs.

Here is my abstract code...

index.ejs

header.ejs

app.js

The most funniest solution ever!
The solution is as easy as this.
Just remove .ejs extension from the include command.
I spent at least an entire night to figure it out.

Talky Messenger Documentation & Setup

(Github)
Just created a chat app that runs in Node and Socket. By the Grace of God, this attempt was worthy.

Talky is a messenger app built with Node, Express, Socket, Angular & Bootstrap.
It's like a server-client structure. (But obviously not like the one we done at OS lab using shared memory). It has a broadcasting structure. Talky does not keep a log on chat. i.e., It doesn't have a memory or database. When we close the browser window, chat history is lost. There I also added a basic console, protected by a password, to send real-time notifications to active clients.

The name 'Talky' was suggested by a friend of mine. (hey, thank you for that. The fact is that I am not really good at naming...😝)

What if sometimes your college blocks WhatsApp? Try Talky.

(There is also a website on internet in the name of 'Talky' which has no connection with this one.)




Download Talky Messenger To use Talky, all you need is 3 things:

Node serverSource code.Three commands.

4 tiny questions you fail easily.

Below are four (4) questions and a bonus question. You have to answer them instantly. You can't take your time, answer all of them immediately. OK? 


Let's find out just how clever you really are . 

Ready? 
GO!!! (Scroll down) 

Question 1 :
You are participating in a race. You overtook the second person. What position are you in? 
...... 
...... 











...... 
...... 
...... 
...... 
...... 
...... 
...... 
......  
......  
......  







......  
......  
......  
......  
...... 
...... 
...... 
...... 

-first?, lol absolutely wrong! -If you overtake the second person and you take his place, you are second! 


Try not to screw up in the next question. 
To answer the second question, don't take as much time as you took for the first question. 


Question 2 :
If you overtake the last person, then you are...? 
...... 
...... 
...... 






...... 
...... 
...... 





...... 
...... 











...... 
......  
......  
......  




......  
......  
......  








......  
...... 
...... 
...... 


...... 

Answer: If you…