Developing and Delivering Applications with PaaS

One way organizations are looking to develop applications in the cloud and for the cloud is by using a PaaS approach. Developing in a PaaS environment differs from the way development organizations have designed software over the past few decades. In a traditional model, the development team may select a variety of different tools — operating systems, middleware, security products, and the like. If the team is very experienced, this is a fine choice. Many organizations have been very effective with this approach. However, typically, there are problems in managing complexity — especially in an era where more and more aspects of daily life are controlled by software.

We talk about some of these factors in the previous section, but the following list highlights a few factors that make it hard for development teams to synchronize their efforts, whether their work environment is on-premises or in the cloud:

check.png Teams are distributed across business units or different geographic regions of a company.

check.png Software code needs to work across multiple platforms and devices.

check.png The software development process requires individual components that all need to work together in a service-oriented way.

check.png Market dynamics lead to a faster software development lifecycle.

All of these factors lead up to one thing. The software quality and time to develop will suffer unless the team has a way to test for, locate, and fix errors early in the software development process.

In a PaaS model, the development organization uses a platform and its services to help develop and deploy applications to the cloud. The platform consists of a group of services that can help to streamline the process. We now explain these services in more detail.

Developing applications using PaaS

PaaS is a kind of cloud development platform. It provides hosted services used during development, such as middleware and operating systems. Over the past few years, as early adopter companies started to develop for the cloud, often developers cobbled together their own cloud development platform. In a PaaS however, these services are always available for a developer to use without having to install or maintain software.

Application development services are the core of PaaS support for the development process. They’re the anchor services that streamline the process of developing applications in the cloud. A PaaS platform

check.png Provides the developer with a complete environment to provision, develop, build, test, and stage applications

check.png Abstracts the details from the developer so that developers can focus on the task of coding and not on supporting the systems needed for development and testing

Integrated development environments (IDEs) are commonly used by developers on their desktop in traditional environments and can also be used with shared cloud services when using PaaS. There are some key advantages for a developer when the IDE is used with the cloud. You can still use your existing IDE on your desktop, but it becomes much easier and faster to share your code with other members of your team. You can push your code into a shared repository in the cloud so everyone has immediate access to the same code and tools. Also, you can test your code during development against the same systems your end users will access, using services provided by the PaaS. As a result, errors in the code are found earlier, and the resulting applications are delivered faster.

Throughout this section, we list some of the most important software development services that may be offered by your PaaS provider.

warning_bomb.eps It’s important to note that a PaaS development environment may require you to limit how you develop in order to be compatible with the underlying services. For example, suppose you want to update your application and choose to go with tools that aren’t part of the prescribed environment. You can still do this, but you lose some of the efficiency of working within a more controlled environment. If you break the mold and do the update outside the framework, you need to do it manually. This means that there is the risk of vendor lock-in with a PaaS. Some vendors are entering the market claiming that their software won’t lock you in. So, it’s important to ask a lot of questions.

Hosted software configuration management services

Developers use software configuration management services to keep track of the different versions and modules of code that are created during the software development process. The code is stored in an online repository. GitHub (https://github.com ) is an example of a popular hosted service used for this purpose.

These software configuration management services help a developer manage the sandbox environment used to create and test code. The developer stores software code (sometimes also known as a forge) in the sandbox. This environment needs to include the right operating system and tools, such as source code editors, debuggers, compilers, performance profilers, and source code management systems (to know when and how a piece of software has changed).

Build services

The PaaS should be able to support a variety of application build processes that allow developers to combine services into a deployable application. There are several steps in the build process, including writing code, compiling code into an executable file, invoking code, and running and then testing the code. When creating an application, developers generally produce multiple modules of code with dependencies. The build services in the PaaS should help developers keep track of the individual modules of code. An example of a tool for this is Maven (http://maven.apache.org ). Maven is used by many Java developers to build and assemble their applications as well as to manage dependencies on other third-party software modules.

Web application server

The PaaS environment can help developers quickly test the applications they’re building by allowing developers to deploy using the production runtime system. This type of testing is important because a developer typically creates a web application using his own local environment, and because of the difficulty of getting access to more than a single machine, the developer’s environment may be very different from the production environment. To tighten testing cycles, the developer might use an in-process web application server that works perfectly on a local environment, but then behaves differently in production. The PasS makes it easy to access and isolate production systems, so that developers can stop wasting time mocking up simulations and avoid the risk of discovering runtime errors in production or at late stages of delivery.

Frameworks

Developers typically use a development framework to help them create quality software that performs well under varying conditions. Although frameworks are used in traditional software environments, these frameworks can be more consistently shared across large distributed teams when used in a PaaS environment. Some of the key benefits of using frameworks in a PaaS environment include

check.png The ability to quickly establish a consistent structure for an application

check.png Ready access to secure and tested foundational software modules for coding

check.png Easy access to runtime services for testing to make sure that the application will run properly in production

Spring (www.springsource.org ) is one of the most commonly used application development frameworks for Enterprise Java.

Database services

One of the most important tests for a new application is how it will work with real end-user data. This type of testing often presents a challenge for developers because the application may be intended to work with data stored in a very large and complex database. Developers often install a lightweight database in their development environment in order to test the code with data, but then aren’t able to test against a true production database during the development phase.

One of the major advantages of developing in a PaaS environment is that the developer can have immediate access to a database with the same characteristics of the eventual production database. For example, if the application will need to call a MySQL database in production, the developer can leverage PaaS database services to test the code with hosted MySQL database already provided by the PaaS.

Testing tools

Testing services can be built into the PaaS platform or provided by its ecosystem of services. These services can include user-interface testing or load testing. Access to these tools is beneficial to companies of all sizes; however, the impact on small to mid-size companies can be huge. Smaller companies may not have the resources to purchase and maintain the state of the art tools designed to improve the quality of the development process. These smaller teams can use PaaS to have access to the same best practice environment that many of the larger competitors have built in-house at a very high price. For example, Jenkins is the most widely used continuous integration server; it initiates build jobs as developers’ check-in code.

Performance analysis tools

There are limits to how many different kinds of tests can be applied to the code in a developer’s local environment. Performance analysis, including production profiling and load testing, is hard for a developer to do on her own. For example, it’s difficult for a developer to replicate the wide range of machines and networks that may be found in end-user environments. Examples of cloud-based tools designed for this purpose include these two:

check.png SOASTA: (www.soasta.com ) Leverages cluster of cloud machines to simulate user load on your application based on a number of criteria (number and type of clients, geographical location, load pattern, and so on)

check.png New Relic: (www.newrelic.com ) Designed to provide insight to end-user behavior, monitor server behavior, and identify bottlenecks

From development to test to production coordination services

The PaaS provider can provide services that enable updates of cloud applications without interrupting services. For example, in your data center, you most likely roll out the new version of the software to one segment of users at a time. With PaaS, you can make sure that the flow between development, testing, and deployment is more seamless. PaaS can help you to guarantee no loss of uptime.

Although these concerns cross more into deployment, they also affect development. For example, a Java web application might make use of a session store to ensure state is maintained in the event of failure and across updates. The PaaS provider can help by providing a built-in session store capability and by automatically coordinating the update rollout process. So, the developer can make use of the session store directly, and also test to make sure it always works properly during the development lifecycle. As the application is updated, the developer can also ensure that application-level changes work across versions using the same session store.

Deploying applications using PaaS

PaaS automates many aspects of the deployment lifecycle that are typically managed by IT development staff in traditional environments. Some of the deployment functions built into PaaS platforms are

check.png Allocation of resources

check.png Staging and testing applications

check.png Installing, configuring, and securing load balancers and application servers

check.png Installing, configuring, and securing databases

check.png Monitoring and notification services

The standardization of PaaS deployment lifecycle services means that the services are both easier to deploy and easier to maintain in a consistent manner. In a PaaS environment, all the key deployment functions are abstracted from the developer. As a result, PaaS makes the process of updating applications once they’ve been deployed faster and more efficient.

remember.eps You may be wondering what will happen if you try to change those predetermined patterns. As we stated in the previous section, there is a tradeoff you need to make to leverage many of the benefits of PaaS, and that tradeoff is that you may be locked into the PaaS platform tools. It’s a decision you need to make.

Staging and testing applications in PaaS

The PaaS environment allows for greater flexibility in the way that deployment teams create staging areas for their applications — staging areas are environments used to test changes to a private version of an application before the new or revised application goes live. Setting up the staging area appropriately can take a lot of time and manual effort on the part of the IT team. The staging area needs to completely replicate the databases, web servers, connections, and other dynamic components of the application environment, or you run the risk of allowing errors into your live system. All of this can be quickly and easily handled with PaaS, which allows developers to focus more on meeting customer requirements and less on IT infrastructure issues.

As a user of PaaS deployment services, you expect the following in your staging environment:

check.png Full mirror of your live environment for the switch

check.png Rollback to environment previous to change if errors are found

check.png Partitioning of existing cloud resources for phased deployment and testing within predefined limits

Load balancing and secure connection services

Your PaaS provider needs to ensure that the load balancing service will adequately support your end users regardless of how they access your application (desktop, mobile). You want assurance that your end users will always be routed over a secure channel to a live endpoint.

Data management services

Users of PaaS services need to trust that their provider will maintain all service level agreements related to scalability and isolation of their data. You need to be confident that all requests for more disk space or additional instances as well as any updates to your database will affect only your data.

In Chapter 7, we provide an overview of some vendors that are providing PaaS services. These include heavyweights like Amazon Web Services, Google Apps, and Microsoft Windows Azure. Other providers include Appistry, CloudBees, and OpenShift.

Monitoring and notification services

All aspects of the PaaS environment that may affect end-user performance need to be monitored. It’s critical that security issues are given the utmost attention by your PaaS environment.

remember.eps Your runtime environment needs as much security and protection as your development environment to support customer and suppliers.

To monitor security and prevent intrusion or denial of service attacks, your PaaS provider will need to scan networks, operating systems, and applications. In addition, you will need to have sufficient insight into the monitoring capabilities to satisfy audit requirements.

Questions for your PaaS provider

A well-designed PaaS environment has enough flexibility and modularity to be useful in many different scenarios and to handle a wide range of development objectives. In addition, the PaaS environment must be able to support developers with a wide range of services that encompass the entire software development lifecycle. You can use the following list of questions to ensure that your PaaS provider offers the right set of flexible services so you can make the most of your PaaS development and deployment environment.

check.png Can you choose from a menu of à la carte services so you can select the services that are right for you?

check.png Can you start slowly with just a few services and then add on later if needed?

check.png Are your choices constrained in any way based on the specifications of your PaaS provider?

check.png Will the PaaS provider host the specific services you want to use, so you can use them in the PaaS environment and don’t have to host them yourself?

check.png Are sophisticated build and testing services made available in such a way as to encourage early identification of software coding errors?

check.png How will the provider ensure that your web application can scale? How will the provider guarantee that your web application can take on an unanticipated increased load and still perform?

check.png What is the provider’s solution for autoscaling and high availability?

check.png If one of your machines goes down, how will the provider ensure that end-user experience stays the same?

check.png What is the provider’s plan for disaster recovery? Does it support running in multiple regions so that your application will automatically be supported in an alternative region if your base region is struck by a disaster?

check.png Is the provider’s development framework easily accessible and easy to update during runtime? The PaaS needs to make it possible to make the updates. If you update the frameworks in your PaaS, will all your dependent frameworks be updated automatically?

remember.eps The same set of PaaS services will not be right for everyone. You should demand flexibility and a variety of options from your PaaS vendor.

Internet-scale development using PaaS

When you start with platforms like PaaS that abstracts you from the underlying infrastructure, in some ways you go on faith that they can support you. The key questions are how much of the infrastructure do you need to manage, and can your PaaS provider achieve this scale? Some Internet developers may start in a PaaS, but then outgrow it when they begin developing a really big application. In this case, developers may need to manage their own software in an IaaS, using some services offered by the IaaS provider and customizing their own services. A different mindset may be required for this kind of developer who may be using Hadoop or NoSQL technologies (which we talk about in Chapter 11).

remember.eps At Internet scale, application workloads may be running across thousands of nodes across the world. You will need an intimate understanding of how your application runs against infrastructure.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.137.67