Can MongoDB instances in Google App Engine flexible be stateful? - php

Now that I have managed to deploy one of my services (an API written in PHP) to GAE flexible using a custom Dockerfile,
I would like to deploy another service that would be a Mongodb database, so that my PHP API can store data in Mongodb.
Because I would like to build all of my microservices within GAE flexible, I was thinking of using the same process, which is deploying another custom Dockerfile for building my Mongodb instances.
Now I was wondering if that is the correct approach? I am concerned about the statefullness of my Mongodb instances in that case. Will the data be lost when the instances are restarted or when I deploy another version, is there another more recommended approach for what I am trying to do?
PS: I would like not to have to use Google Datastore, mainly since I'm using the Symfony PHP framework with a lot of useful bundles to interact with Mongo.

I wouldn't recommend deploying MongoDB on GAE, you could easily loose your data, and I don't think GAE features were made for hosting databases. I think it'd give more headaches than solutions.
If you want to use docker images, I'd suggest using Google Container Engine. You just need to remember that you must use a persistent disk in order to not loose data. For development and even small production apps it should fulfill all your needs.
But from my experience, it's much better and efficient to deploy your MongoDB server on Google Compute Engine instances. You can use Cloud Launcher to deploy (cloud launcher will launch your MongoDB almost ready to use, you'd just need to add the users/authentication)

Related

Using Heroku over AWS for salesforce intergration

My website done in PHP is currently deployed in AWS server.
Client wants to move it to Heroku for integrating the database with Salesforce.
Is it really necessary?
Salesforce have their API by which I can sync data from my project's MySQL database to Salesforce database.
Will moving the project to Heroku provide any extra advantages that AWS doesn't have ?
thanks in advance for your answers
Actually, no special advantages in approach which your client provide. In both cases you will need to implement logic for integration and interaction with SF part, and I don't see any benefits in migration to Heroku, but I see additional work for migration your current infrastructure.
Although Heroku provides some features for integration with SF out of the box, it seems to me, it will be cheaper and easier to add SF integration to your current project. But it's depends on many factors (for example, how is fit the Heroku platform for your solution at all), so possible best way is to implement PoC for both cases (if it's possible) and compare it.

SAPUI5 For the UI and LARAVEL for backoffice

I have to begin a new project and that's 2 years ago that I'm working on SAPUI5, But for severals reasons I have to use the Laravel 5.1 Framework to handle the database logic and controller to get and put data from and to the database.
I appreciate the power of SAPUI5 and I would like to use it for the front-end of my app.
My question is : It is possible to handle a server application with those two technologies?
My second question is : Which hosting I have to choose, because that my client want a kind of desktop app, and for this I thought to use node webkit package. And for that i have to launch a node server. In my goDaddy shared hosting i don't have this possibility.
Thank you for your help!
You can definitely combine Laravel as back-end technology with SAPUI5/OpenUI5 as front-end technology. As Laravel provides the front-end with restful services, you're probably best-off leveraging the JSONModel in your UI5 application.
Laravel is a PHP framework, so you'll need to look for a PHP host. If a host is capable of running PHP, it is also able to serve the static UI5 content.
If you want to package your app as a desktop application, NW.js will work, but Electron will do the job too. A very nice comparison between the two frameworks can be found here: http://tangiblejs.com/posts/nw-js-electron-compared.
Please do note that both frameworks turn your application into a desktop application and will run on the desktop. You won't need to find a server that runs node.js. You do need a server that runs PHP for your back-end Laravel logic.

cakephp on google cloud

I found this question which is pretty old: Is it possible to deploy cakephp applications on google app engine?
Some people stated, that it's most likely at least complicated - someone in the comments stated, that google supports php now(2013). Regarding to the google documentation: https://cloud.google.com/appengine/docs/php/ it's still beta.
So my question is: did someone ever successfully deploy a cakephp application on google app engine? Is it now(2015) possible to deploy a app there without too much problems?
"officialy" the CakePHP is not supported. You may find several steb-by-step howto's where is the deployment explained:
http://dev-mcconnell.blogspot.sk/
http://aymanrb.blogspot.sk/2013/05/cakephp-deployment-on-google-app-engine.html
However, when our customer requested to have CakePHP within his AppEngine, we decided to deploy Google Compute Engine linux VPS with some limited resources (you do not need that much resources if you do not expect huge amount of visitors), and we installed Apache, PHP and MySQL onto this VPS and we run CakePHP application from there.
So generally, the use case above is not an AppEngine deploy, but a deploy within Google Cloud services.

Connect appengine with cakephp

I'm thinking in create a webapplication with cakephp but consuming python's appengine webservice. But, to install cakephp etc, I need to configure the database. Appengine uses another kind of datastorage, with is different from mysql, etc.
I was thinking in store the data in appengine, and using the python webservices, and with the cakephp application comunicating with the webservice, for insert and retrieve data.
Is there any good resource for this, or is it unpossible.
Obs: also opened for a possibility for developing the webapplicaiton completely in python running in appengine. If anyone has a good resource.
Thanks.
I think that you should try different solution: http://aws.amazon.com/simpledb/
It appears that CakePHP is a MVC framework that's very similar to django, which is included in app engine for python. I'm not sure why you would want to store your data in google app engine, unless you're dealing with an extremely large amount of data, in which case you're likely comfortable enough working in python to just make the app work entirely on GAE.
See the official docs for more info:
http://code.google.com/appengine/docs/python/overview.html
http://code.google.com/appengine/articles/django.html
What you can do is run your CakePHP app on a standard LAMP web host and access the GAE Data Store through a REST or RPC web service. This isn't such a bad idea if you already have a CakePHP front-end that deals with RPCs in the backend, but if your Cake app stores all it's Models in MySQL it could take considerable effort to adapt it.CakePHP Models abstract their storage method using the DataSource class. You might be able to find a DataSource class that uses REST or RPC. However, if you don't have a very considerable investment in CakePHP Controllers and Templates I would suggest simply building your app entirely in GAE
You can not run PHP on GAE. If you run PHP somewhere, it is a bad architecture to go over the internet for your data. It will be slooooow and a nightmare to develop in.
You should store your data where you run your php, unless you must have a distributed, globally scaling architecture, which afaiu not the case.
There's a detailed tutorial on getting CakePHP up using the PHP runtime that Google recently announced. http://aymanrb.blogspot.com/2013/05/cakephp-deployment-on-google-app-engine.html

Amazon Web Services with PHP - planing learning curve

As many PHP programmers, I am a kind of CMS guy, but also training my "framework" muscles too.
From what I observe, there is more demand for Amazon Web Services in job descriptions.
Hence, they are worth learning.
But any learning should be well-targeted, with purpose, so I am asking questions below.
My question is which kind of applications (by architecture and by domain) are the best targets for these services? Can you imagine some typical usage of Amazon web services that will most frequently be (is) requested by employers.
Does using Amazon Web services mean that not only I can fully migrate to this platform, but that partial solution is OK too - e.g. writing regular PHP apps on regular hosting that invoke Amazon Web Services (storage, cloud, queues)?
I suppose that the core target of Amazon Web Services and cloud frameworks in general are enterprise applications, but regular web applications that want to be scalable and flexible can benefit from these architectures too.
Amazon Web Services aren't a development platform by them selves. You still need to employ a technology like PHP or Java to build an application. The main difference from regular server based applications are the persistence layer and the deployment strategy.
Relational databases don't fit well in cloud applications. However, if you want to take it one step at a time, you can still launch an Amazon EC2 image (virtual machine), install Apache and PHP on it and mount an EBS volume with MySQL on it. This way you will have a development server like the ones you are familiar with. These are the first things you need to learn (start an EC2 image, create your own images, mount EBS volumes). I would say that the learning curve for them is not that steep.
However, if you really want to get benefit from cloud systems, you need to adapt yourself in a different philosophy. You need to consider alternatives to relational databases, like SimpleDB. You also need to learn clustering techniques. Most importantly you must design your application so that it is easy to add or remove machines from it.

Categories