What is PaaS?
PaaS means a Platform as a Service. It is a cloud application platform that is designed for application developers to whom it provides the tools for deploying, running, and managing applications over the entire lifecycle efficiently, from deployment, running, scaling, service delivery (database, message queue, etc.) up to stopping and removing. Cloud application platforms are primarily designed to run cloud applications but, at the same time, they already support traditional web and up to a certain level even legacy applications. PaaS, provided by Home at Cloud, is based on an open source Cloud Foundry solution.
What is PaaS good for?
The main activity the application/software developer deals with is code creation, testing and debugging. When the code creation is completed, the deployment and operation phases in the application lifecycle follow. However, deploying and running an application in a production environment requires a lot of knowledge and skills beyond the code creation and maintenance and also takes a considerable amount of time. The developer must provide the necessary infrastructure, perform the build, deployment, operation, scale and other management actions throughout the application life cycle.
The Platform as a Service provides the environment and tools that simplify and ease the deployment and operation of the application significantly and support a wide range of programming languages and frameworks (Java, Node.js, Go, Python, PHP, Ruby, .NET, …). The Cloud Foundry Platform as a Service provided by Home at Cloud allows you to deploy applications efficiently and quickly without the need to interact with infrastructure and other low-level artefacts. From a directory where the code of the finished application is located, the developer simply uses the cf push command and PaaS, or Cloud Foundry, will deploy and run an application that can be immediately tested/used. In addition, it provides other useful features such as application management throughout the lifecycle, scaling, service provisioning (database, message queue, etc.). Developers can, therefore, focus on code creation and minimize the time needed to deploy and run applications.
Basic PaaS Concepts
The PaaS solution we chose, Cloud Foundry, is based on containers within which the applications are deployed and run. A container is a basic unit of application organisation and at the same time isolation. In addition to the runtime, the application container also provides the necessary resources (CPU, RAM, disk). Cloud Foundry manages all of the container and application lifecycle orchestration, from container creation, application start, scaling, up to deletion so that the developer does not need to manage the infrastructure and can concentrate on more useful activities.
Basic application deployment workflow
In case we are logged in to the CF and find ourselves in the location where the application code we want to deploy is stored within the local machine, the basic application deployment workflow includes only executing the cf push command. After executing this command, the application files will be collected in the local environment and sent to the CF which we are logged in to. The platform then automatically detects a buildpack (Java, Ruby, Node.js, etc.) needed to perform an application image (droplet) build, creates such application image or droplet, and saves it along with the application metadata. Subsequently, the platform will create and run the container, unpack the application image within that container, and run the application. By default, the application is automatically assigned a route through which the application is available from the Internet. The result of the deployment process or the cf push command is reported back to the client.
Manifest.yml, environment variables
The manifest.yml file, which must be placed in the application code directory, is used to set application values. Within this file, we can configure the application name, memory, whether the application should be automatically assigned a route, etc. Any parameters are passed to the application using environment variables.
The route through which the users and/or systems communicate with the deployed application is by default not removed after an existing application is deleted. The reason is that if we wanted to redeploy the app (for example, after making certain changes) with an identical route, meanwhile, it could be assigned to another application and we could not use it. So if we want to delete the route along with the application, we must explicitly specify the appropriate parameter.
As noted above, PaaS solutions are primarily designed to run cloud-native or twelve-factor applications. One of the significant differences from traditional applications is that cloud applications are never directly connected to backend services (database, message queue, etc.). On the contrary, they communicate with them using the credentials which the application receives via through environment variables. Cloud application architecture is generally based on the microservices paradigm. Within each individual container, as a rule, only one atomic independent process is run, and scaling is provided by running other containers. One-off and/or repeated jobs are usually provided in the form of worker apps that are launched and executed within a stand-alone container. Due to this logic, the backend services do not run within the container but are provided “from the outside”.
Within the Cloud Foundry platform, the backend services are provided by service brokers. Basically these can be provided by the PaaS operator, the developer himself or via an external service provider. As a result, in Cloud Foundry, there is a marketplace of services which can be accessed. These include, for example, data storage/database services (PostgreSQL, MySQL, MariaDB, Redis, memcached, MongoDB), email (SMTP), monitoring (NewRelic, Cedexis Radar), message queue (RabbitMQ), full-text search engine (ElasticSearch), etc. For each service, you can view the available configurations (plans) and order an instance of a specific service configuration (each configuration detail describes whether it is free or not). After the service instance is created, it is possible to connect an instance of the service to a running application that can start using it.
If you have any questions about PaaS, you can contact us via email or phone. A detailed tutorial is also available on the blog to guide you through the application deployment process in PaaS. If you would like to try PaaS free of charge, please send us a message, and we will send you instructions for creating a PaaS trial.