Most cost effective way to deploy to Google Cloud Platform? - google-app-engine

I'm really new to deployment and I wanted to see if anybody had some experience cutting costs. By requirement, I need to use Google Cloud Platform and the frontend team is writing all of their code in React/React Native. I plan on creating a REST API with cloud SQL and Node.js. Any advice on whether these technologies are a good choice would also be appreciated.
I've been reading about App Engine and Compute Engine recently and I've been having trouble estimating the cost of deploying this project. Currently, the plan is to deploy my Node.js code to app engine and use cloud SQL functionality. Would it be a better idea to deploy all code to an ubuntu server in compute engine? I am very new to deploying web apps, any and all advice would be greatly appreciated!

The GCP Pricing Calculator is the best way to work out what a proposed solution will cost for you. As an example, here is a GAE+Cloud SQL HA pricing ($113/month), and here is a single GCE pricing ($30/month).
Bear in mind that this pricing does not include the "Always Free" basic usage.
As a word of caution, you should also think about reliability, scalability and portability as well as cost. For reliability, try and avoid "single VM" solutions as if the VM is broken or a zone unavailable, your application will be completely down. For scalability, single VM solutions are also problematic unless you plan to be able to shard your workload later. For portability, you must be careful when using Google-specific technology like App Engine or Datastore which can be hard to move away from. These are complex topics which I'm only touching on to give you an idea of the kinds of things you can think about when choosing a solution.

Related

Deploying a static React JS app to Google Cloud Platform (GCP)?

I have a ReactJS app that I have deployed to GCP at Google App Engine, via the command:
$ gcloud app deploy --version 1
And it is working fine. However the app does not use a database. It takes the data from API requests from external sources via Axios library.
I would like to know if it is more efficient in terms of costs and performance, to deploy the app to a storage bucket, as a static build? Would it be able to handle more requests with less cost? Or if does not make any difference?
Thank you in advance. Best
It's really hard to answer to so broad question, every solution can contain many details that will change costs.However Google gives tools to be able to analyze it depending of details of your solutions.
First thing is calculator which in helps you to estimate cost of particular technology used and if you know all technologies in your stack you can estimate total cost easily.
2nd thing is that you might don't know how much traffic, resources will be used by technology you will choose. This I can only imagine can be estimated by tests. Then you can use Cloud Monitoring to find how much resources your solutions will use.
I hope it will help!

How can I Google App Engine performance improved?

I currently has serviced my app in Korea.
But, my app is installed in us-central because GAE not supported install for Asia.
so, i suppose it is very slow because it is faraway from GAE.
If that's problem, how can I solve this problem?
please suggest to me... thank you.
I have been using Google Cloud Platform for 4 years now, Including the Google App Engine. The performance of your application backend system can only be slow if the developer did not optimise the program well. I would suggest that you try out using some of the following key aspect in solving your problem:
Try so much to use MemCache for requests that are common to users and do not require instant real time updates.
Look at the algorithms you are putting in place. This is very important for your execution through put. For example lets say you want to run a search though a billion records, u can use quick search algorithms like QuickSort3way.
Lastly look at the choice of database you are using. You could mix NoSQL with SQL if you were only using SQL. If you are into big data then use BigQuery. This way your application's performance can drastically increase and scale up enormously.

Alternative for Google AppEngine?

I recently had to realize a project on Google AppEngine. At the beginning I was sceptic. But there a some really nice approaches on Appengine:
No server setup. Everything works out of the box. Gzip, libraries, etc.
One-Click-Deployment. Fire up GAE Launcher on the Mac and click DEPLOY. Done.
Low costs
Easy in-production-logging
But there are some things I don't like if I'm thinking about professional projects
The blobstore. It's just... weird. And non-backupable
All the 1 MB restrictions
The feeling that your code will only run on AppEngine. (BigTable)
Do you know any similar alternatives to AppEngine? And I don't mean services like EC2.
You can have a look at AppScale
Its an open-source implementation of AppEngine which you can deploy on your own machines, with a host of databases to choose from.
I think Heroku is a great alternative.
It can run most of GAE existing apps, since it supports django, but also:
It supports Ruby (w or w/o Rails), Java (w or w/o Spring), Node.js, Clojure,...
It has a strong CLI support (git push for publishing, creation of apps, scaling, log, ps,...)
It supports MySql and PostgreSQL (and, so on, MongoDB, Amazon RDS, etc.)
It has a free tier for 750 hours a month (~1 machine always up) for every app.
It has a collection of addons for providing cloud services as a resources for the apps
It has an add-on program to develop your own add-ons.
Really, it is a good alternative.
If you want your application is not binded to GAE, the best approach is to use well-known langs and well-known persistence providers. Ruby+PostgreSQL, for instance, could be a combination very portable. Django as well, but w/o BigTable...
AppScale and TyphoonAE are both third-party implementations of the App Engine platform. TyphoonAE is targeted at small-to-medium scale, while AppScale is targeted at the large-scale end of things.
As far as backing up the blobstore goes, this is quite doable: just use the built in handler to serve blobs, and, in conjunction with remote_api, you can download your blobs just fine.
I almost hate to mention Microsoft in a Google-related question, but I'm completely vendor-agnostic. So, I'll offer Microsoft's Azure as a platform that offers many similarities to AppEngine but enough differences that it might fit as a good answer to your question.
Azure and AppEngine are similar in that they are both designed to allow you to build easily scalable applications. Azure gives you Microsoft's standard web toolkit options: C#, VB.NET, ASP.NET ASP.NET MVC, but also offers PHP. It has a NoSQL, document database like AppEngine but also gives you the option of choosing a more standard instance of SQL Server. Although I haven't used it myself, it looks like AppEngine for Business now offers SQL, too.
Azure gives you a ready means of having long-running background processes. AppEngine does not to the best of my knowledge.
From my perspective, AppEngine has the huge advantage of charging you for usage only when a request is actually being processed. An Azure instance causes you to get billed even for time that it is completely idle. That's entirely typical, but the fact that Google doesn't so it that way makes me choose AppEngine every time. My budget is too tight to allow me to spend money for idle CPU hours.
There's a port of django to non-relational databases that works with app engine or mongodb.
google for django non-rel
documentation is a bit sparse though

Google App Engine - When to use it, when not too?

It's still unclear to me when I should or should not use Google App Engine to deploy a commercial web application.
It appears Google has "business" level support.
http://code.google.com/appengine/
Can someone bullet list when I should use Google App Engine and when I shouldn't use it for a web application
The question is surprisingly simple to answer after I've had a stab at google engine with my project for a few weeks. You should use it when:
you can't be arsed to set up a server
you want instant for-free nearly infinite scalability
your traffic is spikey and rather unpredictable
you don't feel like taking care of your own server monitoring tools
you need pricing that fits your actual usage and isn't time-slot based
you are able to chunk long tasks into 30 second pieces
you have the skill/will/desire to work with noSQL and deal with the consequences thereof
you are able to work without direct filesystem access
So actually, you can use it pretty much for anything, especially websites. The only thing it very quickly becomes too pricey for is running large background processes. If you're doing some hardcore number crunching 24/7 you're better off using your own server somewhere because no cloud service can really live up to that.
But think of it this way, where else are you going to get an architecture that can swallow 10+ requests per second load for ten dollars a month?
Basically it boils down to this: If you want to focus on developing your code, not your server architecture. GAE is for you. (unlike amazon which behaves more like a fancy VPS)
I can't really tell you whether you should use App Engine without knowing anything about what you need your web app to do, but I will tell you what App Engine can and can't (or won't) do.
App Engine is fantastically good at scaling. It is, in fact, designed to scale web apps to ridiculous lengths first and foremost, with ease of use and number of features being secondary goals.
That's not to say that App Engine doesn't have features, or isn't easy to use, just that if there ever becomes a choice between adding a feature and staying scalable, the App Engine team will choose scalability.
For example, App Engine doesn't have some of the features of a relational database, because those features don't scale to the size of an app that App Engine is designed to support. App Engine doesn't support requests taking more than 30 seconds, because App Engine is designed to serve a web app, not process long-running requests.
In general, when App Engine doesn't support something, it's not because it's impossible -- nothing is impossible -- but rather because it would detract from the scalability of App Engine.
There are workarounds that can be (and have been) implemented to get around this, particularly with things like the task queue, and App Engine is constantly getting new features and new frameworks built on top of it.
App Engine for Business adds SLAs and different pricing, but is otherwise pretty much the same App Engine.

Web Scraping with Google App Engine

I am trying to scrape some website and republish the data as a RSS feed. How hard is this to setup with Google App Engine? Disadvantages and Advantages using GAE. Any recommendations and guidelines greatly appreciated!
Google AppEngine offers much more functionality (and complexity) than you will need if truly all you will want to do is republish some structured data as RSS.
Personally, I would use something like Yahoo pipes for a task like this.
That being said... if you want/need to get your feet wet with GAE, go for it!
Working with Google App Engine is pretty straight forward. I would recommend going through the Getting Started guide. It's short and simple and touches on essential GAE topics. There are more pros and cons than I will list here.
Pros:
In general, App Engine is designed for high traffic web applications that need to scale. Furthermore, it is designed from a programmer's perspective. Much of the scalability issues (database optimization, server administration, etc) are dealt with by Google. Having said that, I find it to be a nice platform. It is still being actively developed by Google engineers, and scheduling of tasks (a feature that has been long requested) is in the current road map.
Cons:
Perhaps the biggest downside right now is again the lack of official scheduling support and the quota limits currently set for free accounts. However you can't complain much if its free. Currently it only supports Python as a programming interface (although a new language [Java I predict] is coming soon). Furthermore, Python 2.6 (and 3.0 for that matter) are not yet supported. In addition, Django 1.0 is not officially supported in App Engine (although you can package Django 1.0 with your application).
Harder than it would be in most other technologies.
GAE can sort of do scheduled batch stuff like this now, but it's really not intended for that type of thing. Pick pretty much any other language and platform for this particular task, and you'll make your life a lot easier.
I think BeautifulSoup could run on GAE, so all your scraping needs are handled :D
Also, GAE has a geturl thingy. The only problem I think you might have is not having enough time to get the data (30 secs limitation).
I am working on a same project and I've decided that it's easier to prepare the data on another server and push them to GAE.
You might also want to look into Yahoo! Query Language (YQL)

Resources