3 ms·
After doing Java Spring I realized that the Java monolith was very leaky and inflexible. That is why you have strong trend of micro services. In 99.9% of cases
by fetbaffe 6y ago
After doing Java Spring I realized that the Java monolith was very leaky and inflexible. That is why you have strong trend of micro services.
In 99.9% of cases in web development you want the PHP model of doing things. The 0.1% case is the asynchronous background job, that can be solved, maybe not as elegant as in other languages, but why optimize the edge case?
- jjeaff 6y agoMy backend is written in php and I simply have a separate container running a copy of the same php codebase that has a long running process pulling from a pubsub queue in a loop. So anything that needs to be processed asynchronously, like say, sending out a few dozen emails or notifications, I just publish the task to the queue and that other container handles them. This could be simplified even further if you use a pubsub service that can post data to a url as it comes in. Thus allowing the single php container to asynchronously process the tasks all in their own individual threads. This didn't work for me as Google cloud's pubsub seems to absolutely flood it's target with requests seemingly ignoring 503 or any other error code and not backing off until it has dos'ed your server.