Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

66%
+2 −0
Q&A Will my implementation of a Spring Boot app work after being deployed on the Internet?

Now of course this will directly work only within my network. But if I upload this project to Heroku or something similar, would it still work as intended? I'll assume that you actually have the ...

posted 3y ago by Moshi‭

Answer
#1: Initial revision by user avatar Moshi‭ · 2020-10-12T17:42:53Z (over 3 years ago)
> Now of course this will directly work only within my network. But if I upload this project to Heroku or something similar, would it still work as intended?

I'll assume that you actually have the project working on your network. The only advice I can really give you here is, "Try it and see if it works." And if it doesn't work, debug.

> Almost all examples online use WebSocket. I'm unable to understand why because everyone connecting to the my app online will be served by the same controller and append data to the same text file. Or am I completely wrong?

The reason most examples use WebSocket is because WebSockets are bi-directional. i.e, the server can push data to the client without being asked for it. Obviously, this is ideal for real-time chat applications, where you want the server to send you chat updates as fast as possible.

In your case though, you are using the "repeatedly polling the server for data" method. While theoretically, this would work, it would only update the chat log as fast as the client requests data. Further, depending on how frequently you poll the server, this can be resource intensive on the server because the data is being repeatedly requested even when there are no changes. However, it does have the advantage of not having to maintain an active connection, so if you don't need real-time updates then this is a perfectly viable method.