Realtime Data Update with NodeJS and WebSockets

YAAAAYYYYY thank you sooooooo much!!! :grin: :grin:

1 Like

:bomb: :bomb: :bomb: :bomb: :bomb: :bomb: :bomb: :bomb: :bomb: :bomb: :mechanical_arm: :mechanical_arm: :mechanical_arm: :mechanical_arm: :muscle: :muscle: :muscle: :muscle: :muscle: :dancer: :dancer: :dancer: :dancer: :dancer: :dancer:

thanks @patrick , @Teodor , @George

2 Likes

OMG!!! AWESOMEEEE!!! Thanks Guys!

8 posts were split to a new topic: Sockets features available in PHP

Resource wise, how does this feature compared to using action scheduler to update data every few seconds or milliseconds. Asking since this isn’t available in php.

1 Like

Great new feature guys :+1:

There is a huge difference between scheduler and websockets realtime update.

Action Scheduler has to poll for new changes each minute for example, so it runs query very often from each client browser, so many queries get fired very often, and they fetch the same data again and again even if not changed.

While the websockets don’t have to do any polling because they just gets a refresh event when data really changes - and notify directly the connected clients via their open channel. So this is very fast and efficient. Also very lightweight!

4 Likes

It seems like Wappler is going in the direction of Node.JS which is great.

However, those of us building apps in PHP before Node.JS was available are stuck in the past. We (at least I) can’t easily switch to Node.JS where all the new fancy features are coming out.

Are there any plans on creating some a conversion tool? It would be great if there was, however I would understand if it’s too much effort for something that will have a fixed shelf life.

If it’s the latter and there is no Wappler way to convert from PHP to Node.JS has anyone converted PHP to Node.JS? Is it even feasible?

Hello @nepatriot

The problem with PHP is not we don’t like it or we are ignoring it or we don’t want to develop it. It’s not a thing of the past and it’s perfectly fine to use it.

It’s actually that:

A one-click-magic tool which translates php to node.js could be possible for some simpler actions probably, but for more complex server actions, routing etc. it would be more difficult.
Also some features are only possible to be added in Node.js and exist only for it, because of the reasons I quoted above.

1 Like

Unfortunately, it’s the availability of Node.js hosting and relatively cheaply that is severely lagging.

The best tried & true hosting companies that I have settled on provide the latest PHP & mysql version on linux based servers. But NODE.JS hosting is comparatively rare across the universe.

Especially where they’ve made it easy to deploy, manage and scale your Node.js apps, integrating with Git and Heroku.

And that really is a problem right now for apps that a client wants to install on their own hosted domains after development.

For instance, one of the best Shared hosting providers I’ve settled on after 20 years of trying everybody on 2 continents, is Siteground.

I use the most expensive shared hosting plan that even allows using different geo-based servers.
However – " Shared hosting plans do not support Node.js." So I have many mysql databases & tables at Siteground that I want to query because they hold forms data, but to implement a mobile version using Node.js that I can configure in my dashboard is out unless I want to pay for a big leap in price just to get NODE.JS

@Teodor is it working on mobile projects?

Yes if they connect to a NodeJS powered server connect from a web site.

1 Like

@Teodor this is very exciting and demonstrates that Wappler is really shining.

A question from a newbie: What is the difference between this feature and webhooks?

Thx

Webhooks are usually ‘messages’ sent from other services to your server endpoints. For example, sending an email through a web provider, their servers may send a read receipt to your server. Your server can then process it and mark the corresponding message as read.

Websockets open a connection between the user and the data on your server to it is updated in near real-time. For example, new messages on a chat can be sent from one user to your server and then seen straight away by the recipient (without having to set up a timed polling to check for new messages)

3 Likes

Any docker hosting will not do the trick? 5$ a t vultr for example?

A post was split to a new topic: dmx.Socket is missing

Is there any wappler property using websocket, where server side SA refreshes a query API that is in another project?
I have 2 projects with Customer Portal and Admin Portal, whenever a customer do any transaction in Customer Portal, it should be automatically refreshes the live transaction in Admin Portal using same DB.

not the best solution… but you could always use scheduler to refresh the data… if you don’t need Realtime data… if the project are on two different portals.

Did you already try it?

You could use your query from the customer portal in the admin portal.

Just paste the full URL from your SA in the Server Connect Properties on the App Connect side .

I have to admit that I didn’t try to do this on the server side. It should work the same way.

URL in server action is not allowed, still i tried this by creating a new api using url the fetching values from customer portal, but fails. Any one in wappler community have any solutions please help.