Advice on cloud related architecture choices for a production mobile app calling external API [closed] - amazon-web-services

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 7 days ago.
This post was edited and submitted for review 5 days ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
Question:
Can the below architecture be used in production?
Mobile app serviced by Firebase(FireStore + CloudStorage) and Cloud Functions for http calls to the external API) +
AchivementsApi deployed on Appengine standard conencted with CloudSQL.
Context:
I wrote two apps that have to be used as digital support for offline gaming events.
Expected usage pattern:
The traffic starts increasing at the beginning of the week when users have to do some online tasks, then a big spike will happen in the weekend when the offline gathering is taking place. We expect to have thousands of users. In the most optimistic case, let say we will reach 8000 users.
Flutter Mobile App
a. Authentication/Profile – for this I choose Firebase as is free and scalable (also this option provides monitoring, alarms, push notifications, etc.)
b. Event related data that in most cases will not change (event timetable, exhibitors, infos... nothing intensive here) – Using the Firebase backend with Cloud Firestore db looks like the obvious choice.
c. Images can be stored on Cloud Storage or even packaged with the app
d. Integration with Achievements Api – this implies sending REST requests to the below java service, using api key for auth. A scalable and safe(storing the api key) option for this seems to be Cloud Functions. Of course, if I opt for the dedicated back end deployed on Cloud Engine or App Engine or somewhere else that service can handle the Rest calls also
Springboot Achievements Api
Service with some complex queries but no process is extremely intensive or time consuming. This must be a stand alone service available for future integrations. Due to the choice made above of using Firestore, I was thinking that this can be deployed on stantard AppEngine environment with Cloud SQL connection.

Related

What is the average cost of hosting a django app? [closed]

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 last year.
Improve this question
Due to current RBI guidelines on recurring payments for standing instructions I am unable to use Heroku which is great for small apps. Therefore I have to choose other platoforms. I have narrowed down my choice to two platforms aws and digital ocean.
overview of my django website :
The website which I made for my client is not that big. In this website a user registers, chooses some plan and then book an intructor to teach him/ her driving. A user after loging in has to accept an agreement and also has an udate plan page. Thats it on the user side. Now I use celery which uses redis, to send emails such as otp, registration successful, change password, contracts and updated contracts (the contracts' email are send both to the client and the user as per the clients demand). As you can see I have to use celery and redis because there is a lot email work that has to be done by the website. And the database i am using is Postgresql.
Now comming to traffic, we cannot predict what will be the number of visitors on the site, but we accept maximum of 10 registrations per month.
Therefore I want to know what will be the monthly cost of running this django website on aws and digital ocean. Not an accurate cost but atleast an average assumption will be helpful.
Note the redis server is neccessary otherwise it will really slow down the website. And the database is Postgresql.
Thank you.
So AWS is a vast ocean and it has lot of options to solve any problem. With that being said you can host your application starting from 0$ to 100s of $s. If your account is new then you can host your application on Free Tier and don't have to pay anything.
If your looking for cost efficient solution then AWS Lightsail is another option. Lightsail offers fixed monthly cost resources and is good way to start with AWS.
EC2 instances is also an option but I would suggest to host it on Fargate (less maintenance). And use AWS Elasticache for your Redis requirements. Using managed services will cost you more but it's reliable and highly scalable solution compared to self hosted solutions.
Depending on which services you go with, calculate your cost via this calculator https://calculator.aws/

What is the real difference between a cloud platform and a normal website? [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
I am always faced with the term "cloud platform" and don't understand how a cloud platform differs from "a normal website" as a cloud platform still is a content delivered by the internet to the client computer typically through the web browser!
Microsoft 365, Slack are some examples of a cloud platform, but still i can use slack like any other website, so why i can't simply tell it is " a website"
1 - Can i call a cloud platform also a "website"?
2 - How a cloud platform differ from a normal website?
The simple version...
Stuff runs on computers. The computers can be located in various places.
Your computer might be a laptop, or something that sits on/under your desk. We conventionally call that the local computer because it's close to you.
Small companies put servers in a locked room with some good air conditioning. This is called on-premises because it is on the same premises as the business.
Larger companies prefer to put their computers in a data center because they are better for security, fire safety, access to backup power, and generally have better networking connections. The data center might be owned by the company, or it might be co-located (co-lo) meaning that somebody else (eg Equinix) runs the data center and the company leases space, power and network from them.
In the case of cloud computing, the company does not actually own the computer equipment. Rather, it is either rented (eg a hosting provider charges a monthly fee for a web server) or pay-as-you-go (eg Amazon EC2 instances are charged per-second).
Also, some 'cloud' services simply provide a service rather than a computer, such as Salesforce (online software) or Amazon S3 data storage. Microsoft 365 and Google's G-Suite fall into this category.
The term 'website' is not specific. For example, I could run a web server on my home computer and make it accessible to the Internet -- I could call it a 'website'. Or, I could upload a few static pages to Amazon S3 and create a website, or run a WordPress server and call it a website. The term simply means that it is something that responds to requests from a web browser. However, there is a lot more that typically happens 'behind the scenes' on a website. For example, StackOverflow is accessible as a website, but it also has a database, search engine, email system, etc to support the StackOverflow service. See: https://stackexchange.com/performance

High response time on Azure Web App [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
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.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
I have developed a RESTful api that I deployed on Azure Web App. While performing the load test using JMeter, I see that the response time is huge i.e ~18secs. This response time appalls me because the endpoint I have exposed only receives a ~1-2KB of text data and enqueues it to azure service bus queue.
I have researched and found the following:
Azure Web App and Queue needs to be in the same region. Yes they are
Size of the VM matters. Mine is S3 Large
Software Design needs to be good/optimized. Controller only enqueues, no other operations
For load testing, I have provisioned a VM instance in the same region as the Azure Web App to minimize the latency. The enqueue statement takes time in the order of milliseconds, so I wonder what is taking the extra seconds while the serivce is in load?
EDIT: My code creates a single instance of QueueClient which I reuse for all requests. The code is just the following two lines inside an ApiController
ServiceBusManager.GetQueueWriter().Enqueue(data); //data is no more than ~1KB
return Request.CreateResponse(HttpStatusCode.OK, "Data enqueued");
There can be several possible reasons:
Your Azure VM simply gets overloaded (i.e lacks CPU or RAM) so make sure it has enough headroom to operate. You can monitor VM resources consumption using Azure Diagnostics Extension or JMeter PerfMon Plugin
Your JMeter machine is overloaded. Default JMeter configuration is good for tests development and/or debugging, when it comes to load testing make sure you're following JMeter Best Practices.
The problem could be in your application code, re-run your test with profiler tool telemetry (i.e. using YourKit .NET Profiler) - this will allow you to detect the heaviest methods, largest objects, slowest DB queries, etc.
Infrastructure configuration might not be suitable for high loads. Check your application server, database and other middleware settings and make sure there are enough threads to serve virtual users generated by JMeter, otherwise requests will be queuing up.

Static website with microservices? [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
Being the cheap-o that I am, I had an idea the other day of running a web app for less than a nickel per month with AWS:
Serve a static site (html/css/javascript) via S3
Client-side code and forms post to Lambda golang microservices via API Gateway
Use DynamoDB (25 read/s, 25 write/s, 25GB, 1GB/mo in, 1GB/mo out) as database
Would this scheme work with say, cookie and sesssion-based authentication, as the page is being served by one domain name (S3), but the javascript is talking to another domain name (API Gateway)?
What other issues am I likely to run into?
Mike Roberts wrote a very thorough article on serverless architecture and its trade-offs: http://martinfowler.com/articles/serverless.html
Also discovered a framework designed for precisely this which runs on AWS: https://serverless.com/
However, it appears at this time, persistent connections (e.g. websockets) are not supported, which is a deal-breaker for me. I suspect AWS will eventually let API Gateway service the websocket and send its messages to Lambda, but as of today this does not appear to be possible.
I run multiple web apps exactly with your proposed design, and I extracted gofaas, an educational Go and Lambda app, to share the techniques.
Setting a cookie for the static site client is possible with CloudFront and a Lambda#Edge auth function.
Allowing the static site to talk to the API is possible with an API Gateway CORS configuration.
Finally this relies on JSON Web Tokens (JWT) to securely represent an authorization claim between your user, your static site and your API.
Here are some guides for setting all this up:
Static Website Security with Lambda#Edge and Google OAuth 2
API Security with Lambda, API Gateway, CORS and JWT
One of the things to keep in mind with 'serverless' architectures is:
"What happens if 'this thing' really takes off?"
Most people don't consider how high requests rates for Lambda or DynamoDB can get when your site becomes super popular, or is under a DDOS attack.
Like your request rates, your total charges will also see a significant spike during these events. So for "small projects" where low cost really is important I usually advise sticking some some small VMs to handle processing. While high request rates or a DDOS may overwhelm and take down your service, you likely won't be hit with an outrageous bill.
While serverless is very convenient for getting setup, it can very easily bite back much harder than expected.
Note: If you do find yourself in a situation where your bill is higher than expected, reach out to your cloud provider. Some of them maybe willing to help you with a one time credit for some portion of the charges depending on the circumstances.
But be prepared to explain what happened in detail. I also advise having service logs (not just for your applications), but also for any cloud services which you are using.

Dont understan what exactly I can do with cloud computing such as AWS [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 3 years ago.
Improve this question
I have read a couple articles and I know the basic concept of cloud computing..But I still don't know what exactly I can do with this service.
As a mobile application developer, I have developed a couple of iPhone applications. I have a Bluehost account and I have MySQL database in there. I have a couple PHP scripts on my server and on device side, it sends http request to the server to get the data from database in XML format. That is basically how I designed and implemented my applications..
Now what can I do with a cloud computing? If I use a cloud computing service such as AWS then how it is going to change the structure of my application?
Thanks in advance...
Cloud computing doesn't necessarily have to change the structure of your app. The main benefit of cloud computing in a lot of cases is scaling.
Right now if your iPhone apps become really popular and overload your current host, what do you do?
Using the cloud, you could spin up new instances (servers) on demand almost instantly. Another benefit is you only pay for what you need. Of course, depending on the situation, it might require changes to your structure to take advantage of scaling features.
edit: Specific to AWS, they have a service called Elastic Load Balancing. Take a look: http://aws.amazon.com/elasticloadbalancing/