CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@The_Small_k • 11 Oct, 2012 • 2 likes
hello friend's
Really it's nice to see that one of your friend comment on your post and automatically a red color notification will displayed on the header.
.
After concentrating on some point i found that may be they use database event like "trigger" to fire the query but how that event will affect automatically on the view part of our application.
may be they use ajax to refresh that portion of page but how that database event can be use to affect the view part.
.
Do anyone have idea how trigger is used to affect the view part automatically ?
@Manish Goyal • 14 Oct, 2012 Till last week, I was only thinking, all this implemented through ajax requests, but last week when i was implementing Push Notifications feature then i found it is not ajax at all, it is something like this

Server itself sends data to system which user is shown on his side

Correct me if i am wrong
@The_Small_k • 15 Oct, 2012 In facebook we are just sitting ideal in front of pc and notification will appear on header. Here we are not creating any event but we get a notification due to any other members event(commented on some post or sending friend request).
.
I think it's database event(may be trigger). When my friend or any member commented on my post database is updated and it work like an event that is used to show notification on the header part.
Am i right ?
.
But still i am not able to find how that database event will be used to affect the view part.
@Ankita Katdare • 15 Oct, 2012 I am not a good programmer, but I googled it up and found out that the Facebook engineering team has put up some content related to their work that explains how push notifications work. For example - You can get some clues here:
https://www.facebook.com/notes/facebook-engineering/live-commenting-behind-the-scenes/496077348919

Also, check an old conversation here - https://x10hosting.com/forums/script...24214-how-do-facebook-notifications-work.html
@The_Small_k • 29 Oct, 2012 Not able to understand how push based approach is used to get the notification automatically.
@shashidhar.gr • 27 Jun, 2014 we have two methods to get updated in the front end by the changes that happen in back end. 1)long pooling 2)comet programming.
Long pooling is where client(browser) send the request to server regularly in some time intervals.(Mostly here time will be in seconds.)so, for each new request using HTTP protocol handshaking has to done with the server, later the processing of our request and finally we get updated in the client side with new/updated data.
Comet programming is where the client will do handshaking with server when it request data for first time.after that,an persistent connection will be established between client ans server, where client and server can interact with each other without handshaking in further request-response cycle,very fastly . whenever any changes happened in server the client will be updated by sending notification using this persistent connection immedietly by server without waiting for client request.
For your question, how facebook notification will work internally?, facebook uses "Comet Programming".
below is the link to some article, please do got through it,
https://en.wikipedia.org/wiki/Comet_(programming).
@avii • 27 Jun, 2014 Search for Web Sockets or comets
4.6k views

Related Posts

@xeeshee · Sep 13, 2008

hi, I need you to plz give me final year project ideas related to Communication Systems, Networking, GSM, WiMAX, VoIP, 3G Technologies or Wireless Sensor Networks. Thanx in advance.
12.4k views

@Kaustubh Katdare · Jul 5, 2014

The proud owners of Moto G, Moto E and Moto X phones may now upgrade their phone's firmware to latest Android 4.4.4 Kit-Kat. Google's began offering the upgrade to all...
12.1k views

@Shyamsundar · Apr 29, 2013

Hi, allIam trying to learn MATLAB. please let me know its future scope. And what are the uses and applications. It is very interesting. I know few basics.
15k views

@Kaustubh Katdare · Dec 2, 2010

Let's say a phone has 8gb of internal memory and supports upto 32gb through microSD. Does that mean the phone will support total storage space of 8+32 = 40 GB?...
7.9k views

@md mudassir · Jan 23, 2013

can please explain what will happen when petrol is injected in Diesel engine this is my lab viva question what i got
8.2k views