Click here to Skip to main content
15,888,208 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd29-Apr-20 19:26
Super Lloyd29-Apr-20 19:26 
GeneralRe: Another Azure (and Microservice) question Pin
Dan Neely29-Apr-20 19:29
Dan Neely29-Apr-20 19:29 
GeneralRe: Another Azure (and Microservice) question Pin
Jörgen Andersson29-Apr-20 20:34
professionalJörgen Andersson29-Apr-20 20:34 
GeneralRe: Another Azure (and Microservice) question Pin
RickZeeland29-Apr-20 19:36
mveRickZeeland29-Apr-20 19:36 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd29-Apr-20 19:52
Super Lloyd29-Apr-20 19:52 
GeneralRe: Another Azure (and Microservice) question Pin
RickZeeland29-Apr-20 20:50
mveRickZeeland29-Apr-20 20:50 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd29-Apr-20 21:30
Super Lloyd29-Apr-20 21:30 
GeneralRe: Another Azure (and Microservice) question PinPopular
Sander Rossel29-Apr-20 23:02
professionalSander Rossel29-Apr-20 23:02 
Bit long answer, but here it goes.
Alright, imagine the following scenario.
You have a website for buying concert tickets and looking up information on artists and concerts.
It's all just one big monolith in the back-end.

Now The Rolling Stones are doing a concert near you and ticket purchasing starts at 12 PM.
At 12 PM you log into the website only to find it's not working or working really slow.
Needless to say, you didn't get a ticket because they were sold out after five seconds.
Let's say ordering a ticket costs three seconds to process and the system can process five at the same time, but at that point any other requests will have to wait.
That means you can process 100 tickets a minute, but you get thousands and the system becomes unresponsive for minutes at a time.

There are, as I see it, two ways to solve this problem.
Either offload to another service or scale up your service and optionally use a load balancer.
Or both.

The first option is offloading the order handling to a separate (micro)service.
Just put every order in a queue and have your microservice read the queue and process the order.
The main application can now simply put something on a queue and inform the user that their order is being processed and they will receive an email soon.
This process takes milliseconds instead of three seconds and users won't get an unresponsive website.
You can put up multiple instances of your microservice to process faster.
Cloud services such as Azure Functions or AWS Lambda can scale out-of-the-box if its CPU goes to 80% or something and there are still a lot of items on the queue.
You can have up to 200 instances I think, so you should be able to process everything relatively fast.
One the queue is empty, Azure will scale down back to 0 (in case of Azure Functions, you'll also stop paying at 0 instances).
Unfortunately, some users will get an email that their order was cancelled because there are no more tickets left, but at least they got their chance and everyone can continue using the website.

Now, let's say even with this solution in place users experience long loading times.
You should probably scale your website as well.
This is a load you see coming, so you can scale up your server for the day, say double CPU, to process faster.
You pay for the extra CPU, but only for a day.
The day after you can scale back down to your regular CPU.
Another form of scaling is by telling Azure to just spin up another instance.
If you're using App Services this process is automatic and you get a free load balancer.
This process can be automated or be manual (this is different than the order processing).
Say you need to scale up to three instances temporarily and then back to one, no problem.

Because you're using microservices you can scale the website and the ordering system independently.
That's good because the order processing needs to scale a lot more, but the process is also a lot smaller.
If it was one application you had to scale the whole thing to maybe 20 instances just to process orders.
An added bonus, say your order processing service goes down, for whatever reason.
People can still access the website and even place orders, because that application didn't go down.
The orders won't be processed and maybe people need to wait hours before their order confirmation, but at least they won't get a 500.

Now, try scaling up like that with your on-premises network.
You need to install load balancers and somehow add multiple servers on the fly.
It's possible, but it probably means you've got a lot of idle servers sitting around.
In the cloud these servers aren't idle, they just go to the next customer who needs to scale up.
You can't do that on-premises.

A long answer, but hopefully you got a gist of what Azure can do what you can't do on-premises Smile | :)
There are other options too and different solutions per options, but that would make this already long post into a book Poke tongue | ;-P

GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd30-Apr-20 0:55
Super Lloyd30-Apr-20 0:55 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd30-Apr-20 1:09
Super Lloyd30-Apr-20 1:09 
GeneralRe: Another Azure (and Microservice) question Pin
Sander Rossel30-Apr-20 2:00
professionalSander Rossel30-Apr-20 2:00 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd30-Apr-20 2:43
Super Lloyd30-Apr-20 2:43 
GeneralRe: Another Azure (and Microservice) question Pin
Sander Rossel30-Apr-20 2:54
professionalSander Rossel30-Apr-20 2:54 
GeneralRe: Another Azure (and Microservice) question Pin
Super Lloyd30-Apr-20 3:00
Super Lloyd30-Apr-20 3:00 
GeneralRe: Another Azure (and Microservice) question Pin
ZurdoDev30-Apr-20 1:16
professionalZurdoDev30-Apr-20 1:16 
GeneralRe: Another Azure (and Microservice) question Pin
Andreas Mertens30-Apr-20 3:38
professionalAndreas Mertens30-Apr-20 3:38 
GeneralRe: Another Azure (and Microservice) question Pin
Sander Rossel30-Apr-20 4:14
professionalSander Rossel30-Apr-20 4:14 
GeneralRe: Another Azure (and Microservice) question Pin
Andreas Mertens30-Apr-20 6:07
professionalAndreas Mertens30-Apr-20 6:07 
Generalsend private email codeprject member Pin
pkfox29-Apr-20 9:32
professionalpkfox29-Apr-20 9:32 
GeneralRe: send private email codeprject member Pin
OriginalGriff29-Apr-20 9:48
mveOriginalGriff29-Apr-20 9:48 
GeneralRe: send private email codeprject member Pin
pkfox29-Apr-20 10:07
professionalpkfox29-Apr-20 10:07 
GeneralRe: send private email codeprject member Pin
Nelek29-Apr-20 9:49
protectorNelek29-Apr-20 9:49 
GeneralRe: send private email codeprject member Pin
pkfox29-Apr-20 10:08
professionalpkfox29-Apr-20 10:08 
NewsAt the risk of approaching 'political' Pin
Kent Sharkey29-Apr-20 9:09
staffKent Sharkey29-Apr-20 9:09 
GeneralRe: At the risk of approaching 'political' Pin
Ron Anders29-Apr-20 9:37
Ron Anders29-Apr-20 9:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.