PaaS for Java Developers (Part 2)
It isn't so much vendor lock-in, but migration costs that should worry you. See how Java devs should consider cloud deployments.
Join the DZone community and get the full member experience.Join For Free
in part 1 , i introduced paas and discussed how you can use pivotal web services and cloud foundry as a way to easily deploy applications without worrying about the underlying infrastructure. a common misconception with all of this is that using cloud foundry (and pivotal web services, or another implementation) results in vendor lock-in.
back to structurizr, which is a collection of tooling to visualize and document software architecture. the system context diagram looks like this (click to enlarge):
in summary, authenticated users create and upload software architecture models using the structurizr client libraries (java and .net), and then view the content of those models via the web. structurizr uses sendgrid to send e-mails, and all payment processing is performed by a combination of taxamo and braintree payments. some other services (e.g. cloudflare, pingdom, and papertrail) are also used, but not shown on the diagram.
from a ( c4 model ) containers perspective, structurizr is as follows (the external services have been omitted from the diagram because they are not relevant to this discussion):
both of the java web applications are based upon spring mvc and they are implemented following a number of the principles described in the twelve-factor methodology . in reality though, from a technical perspective, both applications are just typical java web applications that have been designed to run on the cloud. both applications are stateless and they don't write important information to the local file system.
vendor lock-in and migration cost
let's talk about vendor lock-in or, as sam newman says, "don't think lock-in, think migration cost" . all development for structurizr is done using intellij idea on a mac, with vagrant being used for running local copies of mysql and redis. nothing in the codebase is tied to, or even aware of, cloud foundry and i don't have cloud foundry running locally. the java applications are standard java ee .war files that are deployed to an apache tomcat instance running locally.
pushing the structurizr "web application" (using the "cf push" command) results in the web application being deployed on pivotal web services and available at a url of https://structurizr-web.cfapps.io . if i wanted to migrate that web application to another provider, here's what i would need to do.
- i would first need to find another paas that supports java 8 and apache tomcat 8.x, or build my own server to do this. the jvm additionally requires that the "java cryptography extension (jce) unlimited strength jurisdiction policy files" are installed, because the web application is making use of some of the stronger encryption algorithms when storing data.
- given that there are multiple instances of the web application running (pivotal web services transparently handles this behind a single url), i need to mirror this setup too.
- the dns for the structurizr.com domain is being managed by cloudflare, and some cname records need to be changed to reflect the new deployment location.
that's it. my deployment script will need to change, but no code changes are required. pivotal web services does provide some additional features on top of cloud foundry, such as their dashboards, which are handy for monitoring and management, but they are not an essential part of my applications. in summary, i don't really have any vendor lock-in and the migration cost is low. after all, my java web applications are just regular java web applications, with no dependencies on cloud foundry.
now, you might be thinking, "wait a minute, what about those data stores?" well, that's a different story. stay tuned for part 3, where i'll discuss my experiences with the additional marketplace services available at pivotal web services and why i don't recommend that you use them. as before, if you have comments or questions, you can find me at @simonbrown on twitter .
Published at DZone with permission of Simon Brown, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.