Azure service bus: Use functions vs service fabric vs web job? [closed] - azure

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am considering three ways to to build a service bus topic listener:
Azure functions: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus
Service fabric: https://iamrufio.com/2017/04/21/azure-service-bus-listener-with-azure-service-fabric/
Web job: https://code.msdn.microsoft.com/Processing-Service-Bus-84db27b4
I'm not sure which way to go. I'm leaning towards Azure functions since it has a direct out-of-the-box service bus integration. However since it's fairly new I'm not sure if it's a safe option.
Service fabric, from what I've read, offers most resiliency and support.
And a web job would be safest to pick since everything is easily configurable but I'm afraid I'll be reinventing the wheel as no out-of-the-box support is provided.
What direction would be best?

It's a very open ended question. You should look at the requirements that you have and other constraints such as budget. For example, running a production grade Service Fabric cluster would require at least 5 nodes. Versus running webjob that would require a hosting plan with some scale out (for HA). Versus running with Azure Functions using consumption plan, where you'd pay per execution only after free grant 1 million requests and 400,000 GB-s of resource consumption per month is used up.
I would suggest to start simple, with Azure Functions. Create your prototype and see if that's what you need. Are you running into issue or not. With Functions utilization of Azure Service Bus could be somewhat limited. For example, you can't dead-letter a message as you either have to return successfully to complete it or throw an exception to retry. You can't defer a message, rather instead would need to send another message. Nor can you use transactional option by using send-via feature of Azure Service Bus.
If you find yourself requiring those features, WebJob would be my next candidate. You will have to look how you'd utilize it. Most likely you'll need to create your own receiving pump and handle things Functions offered for free, but you'll have the flexibility required to create multiple connections, configure clients the way you need, etc.
And only after that, if you see that aside from Service Bus you have requirements like data partitioning, or HA, or DR, or deploying and scaling out multiple services, I'd be more serious about Service Fabric.
Each of these 3 technologies has its place and use cases.

Related

Why are there no consumption plans for API apps? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
Improve this question
If I deploy a bunch of Azure Functions in to a functions app and setup the functions app to use a consumption plan, then each calendar month the compute cost for the first 1 million calls is basically free.
How come I can't do this with a web API using something like MVC or OData?
The only difference I can see is the framework parts used, presumably there's some infrastructural reason for this?
Which leads to ...
I'm tempted to make all API implementations a set of Azure Functions to make the most of cloud costs but it feels like I'm making the infrastructure costs dictate my technical decisions a little too much here or that I'm missing something.
As a sort of secondary question if there's any MSFT peeps out there, would Microsoft consider making it so that all Azure app Services can be consumption planned?
The big difference between an App Service and a Function App is the fact that, for your App Service, there's an App Service Plan dedicated to run the App Service which reserves a set of resources like CPU and memory.
An App Service plan defines a set of compute resources for a web app to run. These compute resources are analogous to the server farm in conventional web hosting. One or more apps can be configured to run on the same computing resources (or in the same App Service plan).
When you create an App Service plan in a certain region (for example, West Europe), a set of compute resources is created for that plan in that region. Whatever apps you put into this App Service plan run on these compute resources as defined by your App Service plan.
Source: Azure App Service plan overview
For a Function App on a Consumption Plan, this is a specialized version of an App Service Plan. In that case you have a lot less to say about how that plan is configured or what resources it gets: that's all abstracted away for you as a user.
When you're using the Consumption plan, instances of the Azure Functions host are dynamically added and removed based on the number of incoming events. The Consumption plan is the fully serverless hosting option for Azure Functions.
Source: https://learn.microsoft.com/en-us/azure/azure-functions/consumption-plan
And while the Azure Functions Host is the application constantly handling requests by checking to see if your Function App is being called and requests need to be passed on to your code, in a more traditional application like an MVC app, it is your application that actually handles the request beginning to end.
EDIT
why can't I put an MVC controller up on the same contract terms in the cloud as I can with an azure function
Because the current implementation of an App Service is "analogous to the server farm in conventional web hosting", meaning it expects an entire web application. An Azure Function expects a piece of code that can handle the request (better: trigger). A controller is more than just that, and has some (a lot...?) of fluff around it to be able to work.
And, somewhat simplified: because it hasn't been made available by Azure. Presumably because it would make Azure Functions way too biased on how the (.NET, HTTP triggered) function should be implemented.
Abstraction: a Function is a piece of code that can handle a trigger. This trigger can be a lot of things, one of which is a HTTP request. From the Functions runtime's point of view, all triggers just need to be mapped to a handler. Currently, that handler could be considered framework agnostic, Azure Functions only prescribes it adheres to a certain signature.
By allowing developers to host an MVC Controller as the handler for an Azure Function, this would also mean it needs to have all the fluff around the controller either be in place (what, how, ... ?) or the controller be slimmed down to 'just' be a handler for a HTTP trigger... which would make it a regular Azure Function.

how does microservice architecture with sync communication scales? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Suppose I have two services book service and order service.
Book service gives information about books - name, id, publishing house, summary, author etc - basically finding books for the user based on some query, it may also use Machine learning. It has one endpoint /books/search which takes some query and gives out results.
Order service helps in creating an order using userid and book id. It also has one endpoint /order/create.
There is one relational database, which holds books, orders and users. It also has some read replicas to make querying faster for book service. I have a books.js file for book service, which I deployed on EC2 instance and order.js file which I deployed on another EC2 instance.
There is a api gateway which forwards the request to appropriate EC2 instance.
Suppose the traffic on books service increase drastically, how do I scale the book service programmatically? does AWS API Gateway help in that?
if from the start I deployed multiple instances of books service, lets say 3 instances, can they have the same address and port so that API gateway forward user request easily OR they need to have different address and port. Does API gateway has the capability to load balance the requests to book service EC2 instances or will I need to add a load balancer also?
I understand how scaling with async communication is done - basically you have a queue from SQS, there is EC2 instance that monitors the queue and spins up or down the EC2 instances based on size of the queue. There is some place to store the status of EC2 instances based on which the monitor instance scales down the instances. The created instances take messages from the SQS queue, do the processing, store the result somewhere, sends the notification like email to the user.
In this however the user doesnt get the response immediately. I want the user to get immediate response.
Kindly answer the question without using function service like lambda or docker service like ECS as I don't understand them fully.
Also, can anyone point to some good resources to learn about microservices with nodeJS and AWS. When I tried to find such resources, I found them to be very high level and not really talking in step by step manner.
Suppose the traffic on books service increase drastically, how do I scale the book service programmatically?
You don't need to scale the service programatically. The default way is to place the service instance into an autoscaling group and place an internal load balancer in front of the autoscaling group. Now the task would be to find the proper metrics to scale the service.
https://aws.amazon.com/about-aws/whats-new/2020/03/api-gateway-private-integrations-aws-elb-cloudmap-http-apis-release/
does AWS API Gateway help in that?
Actually it may, depends on.. The API GW could provide additional metrics you could use to scale the service, but I'm not sure how useful the metrics will be for your case
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-metrics.html

Which Azure services are PaaS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm trying to compare AWS and Azure for a custom web app that's essentially like any canned content management system. It requires web hosting, database, email, storage, security, some way to process ASP.NET but with high availability and load balanced.
The PaaS/IaaS distinction can sometimes be grey (in part because companies tend to use marketing jargon that portrays IaaS type services as maintenance free). From a small business perspective its quite clear though. If a service involves the SMB spend time maintaining rather than developing, its in the IaaS camp. Since I'm a single developer with limited time, a PaaS model for all services would be preferable. The ideal would be all services (web hosting, database, email, etc are offered as a zero maintenance scalable service rather than have to spin up and manage individual instances.
I find AWS can do everything but a drawback is that one still needs to manage instances (i.e. I would need to keep the software on instances updated, track instances, manage network, security, etc.) S3 doesn't process scripts. AWS Beanstalk and Optworks are still essentially mostly helper apps for starting up an IaaS type environment. (whereas say DynamoDB would count as a PaaS type service). Recently Microsoft has dropped prices on Azure which makes it an attractive alternative
In short, I am looking for a list of services offered by Azure which are actually no maintenance services that don't require I patch software or need to spin up instances to handle traffic spikes (e.g. web hosting, script processing, database, email, etc..)
web hosting, database, email, storage, security, some way to process ASP.NET but with high availability and load-balanced
All of the above are standard features which any matured cloud provider will have in the toolkit. In regards to MSFT Azure:
For web hosting - you have PaaS solutions such as App service plan
and App service environment. The upkeep of the platform (as the name suggests) is with Azure but note that any components that you deploy as part of the package belong to dev and test teams respectively
For database and storage - for a complete PaaS solution you have Azure SQL Server Database and Azure SQL Server Managed Instances, but as I said earlier you will anyways have to own any custom deployment (security policies, VNET injection and IAM's yourself)

Serverless architecture - Azure functions #edge [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We have below technical stack in our application
Angular 7
Asp.net core 2.2
Sql server
Images
To go for serverless architecture on Azure, we have map as follows
Angular 7 - Blob (as it is static)
Asp.net core 2.2 - Azure functions
SQL server - SQL as a service
Images - Blob
Now how to handle Azure functions#Edge ?
Do we have alike Lambda#Edge in AWS?
As far as I know there's no equivalent Azure service right now. In fact, back in October 2018, the comparison between Lambda#Edge and Azure IoT Edge was removed from the Services Comparison page.
The equivalent right now would be to use CloudFlare Workers combined with Azure Functions. Troy Hunt explains how he did just that to scale Have I Been Pwned in Serverless to the Max: Doing Big Things for Small Dollars with Cloudflare Workers and Azure Functions. The site has a lot of traffic and Troy Hunt pays for it out of his own pocket. Workers on the edge means that Have I Been Pwned doesn't have to hit Blob storage in most cases.
Right now this may be a very good choice. Cloudflare Workers are faster than Lambda#Edge at this point and CloudFlare offers very good caching, proxying and DDOS protection services. You'll have to consider startup time too. Javascript functions can start faster than Java or .NET Core functions, which means they can handle cold starts and request bursts better.
All of this will certainly change in the future. Functions on the edge is a lucrative market. Lambda#Edge will definitely get faster. Azure may add its own service or cooperate with CloudFlare.
Two questions:
1. Why not use any CDN on azure in order to server your static files? Blob storage is not for static content but usually for user related binaries.
2. Why not use the [Azure app service]1 to host your .net core api (if it is an api)?
You can find documentation on how to use the functions with .net core here

Will Azure Cloud Service in Suspended state with Stopped Web role incur cost? [duplicate]

This question already has answers here:
Does Azure Worker Roles get charged $$ when they are Sleeping?
(3 answers)
Closed 4 years ago.
When the Azure Cloud Service is suspended and the Web Role associated with it has status Stopped VM, will this Cloud Service incur VM costs?
If not, how can I stop the Cloud Service so it will not incur cost but can be easily started when needed?
UPDATE: I looked into the wrong thing previously. This link may help:
Does Azure Worker Roles get charged $$ when they are Sleeping?
Either way: The short answer is yes. Everything I searched for within SO or Google says that you will still be charged. The only recommendation was to delete.
Azure web site offers a free online chatting tool that allows you to talk to Microsoft directly to know for 100%. If you do that route, then please come back and let us know for future users.
Original (may be useful for future)
I had recently asked Azure the same question. They recommended that I should either stop the server when not in use or move it to a free tier. They also said if the data is still on the VM or Web App, I will still be charged for that.
Your VM says Stopped rather than Stopped (Deallocated) so it may still cost you.
This link may help: https://blogs.technet.microsoft.com/gbanin/2015/04/22/difference-between-the-states-of-azure-virtual-machines-stopped-and-stopped-deallocated/
Try moving it to the free tier.
In addtion to here: https://azure.microsoft.com/en-gb/pricing/details/app-service/linux/
It says:
Am I charged for apps while they are in stopped state? Yes. Rates
listed apply to apps in stopped state. Please delete apps that are not
in use, or update the tier to Free to avoid charges.

Resources