Ionic 3 Fetch Data Chat / Detect change in db

I have a chat app made in ionic but I do not know how to always fetch data from server without refreshing so it that could be a problem when more devices are using it ?
I’m using a Timeout to call the function and get data every sec.
It would be better if i could just detect a change in db.

 getMensajes() : void
       this.http2.get('').subscribe((data2 : any) =>
         this.mensajes = data2;
      (error : any) =>
      setTimeout(() => {
    }, 1000);

Solved by using