the-journey-to-the-paas_2294x12031

PaaS Cloud – The Rise of The Developer Entrepreneur

In bad times such as recession, there is the inevitable fact that some people will be laid off by their employer. In these circumstances, when software developer are made redundant they usually set-up shop. The majority goes into providing software development services for small company or friends. They set-up websites to promote their services and few focuses on building their own product.

In London, services based company took a massive hit during the downturn and it is still felt now; well the UK and now in a double-dip recession. So what is my point here? It is much harder to sell services and even harder to export services than products. When providing services, your market has geographical constraint; just think what would take for your to sell your services to a potential client 100 miles from your local?
It used to be hard to build products in the past due to high cost of hardware; to build a java-based product you had to find a suitable host and then pay for a dedicated server or VPS. As you are already tightening your belt, it is likely that you do not want to spend £60 + VAT a month on services to host your product and all the headache of troubleshooting it in case of problem.
Enter the PaaS, Platform as a Service. For this posting I am going to look at PaaS from a Java perspective but it should be applicable to any other programming language.
The competition in the PaaS market is fierce there is no single winner yet. Amazon is the leader for IaaS but not much to be deployed on Beanstalk as yet. If you look around the market, you can see that major technology vendor are jumping on the bandwagon:
Some of those PaaS services are free such as OpenShift and CloudBees. OpenShift runs on JBossAS7 and if you are using Eclipse for it becomes a breeze to develop and deploy, but the only downside is that it’s still in beta stage.
Utilising the current ecosystem of PaaS, you can go from:
inception (idea) -> development -> product
for almost nothing. The prototyping is now free for example you can use Heroku to build Facebook apps  making all the Facebook API directly available to your app and hosted for free (until you out grow your free account of course). I will suggest that developers familiarises themselves with Lean Startup and Lean Software Development.
If you are a developer and out-of work, you have no excuse of no building your cloud apps. Even if you do not want to start a business and you can do it as a learning practice and use that to your advantage next time you are interviewing for a new role.
With PaaS Cloud, every developer is a potential entrepreneur and the barriers to entry are almost non-existent. If you are looking for a job, it is no longer acceptable just to have some sample code on GitHub but you should also have a sample project hosted on a free cloud provider to showcase.
  This is blog was written from Cloudstock 2012

vodafone-top-61

5 Things all Java developer should know when developing for the cloud

The last couple of years, “Cloud Computing” replaced Web 2.0 as the new buzzword. You can read, hear and see everywhere the cloud is coming. To most developer, this is still the same old sh*t. If you have experience in developing distributed system then you should be fine, you say. Well not entirely true, the IT department wants to deploy on cheap cloud and therefore some restrictions now applies. I will list 5 things that I think all developers should know when working with cloud Platform as a Service provider such as Amazon Beanstalk or Google App Engine. This list also applies to IaaS architecture. Some of the points might be obvious to the more experienced, nevertheless, they need to be mentioned.

  • Static objects

We all know the difference between instance variable (non-static) and class variable (static variable). We use static to tell the JVM that they should only be one instance of this variable (singleton). If the static variable is declared with the “final” keyword, this will not cause a problem in a distributed environment as the value will never change. The problem is when we expect the value of the variable to change. As in a cluster environment, GAE and Beanstalk run your application in multiple JVM. If a the value of your static variable has changed in JVM, it will not be propagated to the cluster therefore leading to inconsistencies. I recommend that you avoid static variable unless that set as “final” and their values are hard-coded so there is no way to change their values are runtime.

  • Caching Objects
This one is related to performance in order to avoid expensive operations such as running database queries and others. Sometimes we need to cache objects in memory and therefore we implement our own caching strategy through the use of simple HashMap or some other caching solutions available outthere. Caching has many benefits but implementing a caching strategy should be approached with care. This is because caching has the same problem as static objects. Your cache will be in the local JVM therefore not it will not be visible in the cluster. There are some solutions, for example, GAE uses Memcached and Beanstalk can make use of Amazon ElastiCache which is compliant with Memcached. When developing for a PaaS environment, make sure to not implement your own caching system but look for one that is supported by the vendor. I know this can lead to vendor lock-ins.
  • Server-side Session
Something we do take for granted in single environment is storing application session data on the server. Based on experiences, mainly using GAE, I encountered multiple issues with session management. Since then, Google has fixed alot of the issues with the way GAE handle sessions for Java application. To minimize writing session to a datastore, we store application state in memory. Most application are written without any vendor approach in mind; so we use JEE as-is. This approach would work in you deploy in any self hosted clustered environment but Google PaaS. Google implements their own session management which is off by default therefore you need to enable it in appengine-web.xml and make sure that all your objects implements the java.io.Serializable interface.

Note: Note, session data is always written synchronously to memcache. If a request tries to read the session data when memcache is not available (or the session data has been flushed), it will fail over to the datastore, which may not yet have the most recent session data. This means that asynchronous session persistence may cause your application to see stale session data. However, for most applications the latency benefit far outweighs the risk.

 

  • Event-driven Execution
This is more about running a process at a given time such as Scheduling task. Again, in a managed environment, it is straightforward to implement a timer or scheduler service. But this is a clustered environment which is not managed by yourself and their stack his different to yours. I personally use Quartz Scheduler when working in a single server environment. In a clustered environment such as Beanstalk or GAE, it is difficult to know which instance will be triggered and execute the task only once. The folks at Google have provided another solution with their own implementation of Cron for Java which can be used. At the time of writing, Amazon Beanstalk didn’t have a solution yet. Therefore, consider before-hand when designing your system, which approach to take in order to create scheduled tasks for your application.
  • JRE white list
I believe this related to GAE J only. Google App Engine for Java doesn’t allow the use for all available API in Java, especially if they do require access to the file system. The fact that there is a such a restriction impose by the Google has led us to look elsewhere for some of our projects. The cost of re-developing our application to please them is much higher than deploying them elsewhere. Also, another downside of GAE J is doesn’t fully support JEE servlet specification. You cannot implement custom security for your application through your web.xml therefore pushing you to use Google own security mechanism. I would recommedn using GAE J when developing a greenfield project which can be built with these restrictions here  and here in mind. If you want to be locked-in using GAE J for your application, then I recommend it as a cost efficient way to testing your application otherwise, look somewhere else.
I hope this was helpful and if there’s mistake, feel free to get back to me and I make any corrections. Also, I am sure that I am missing some other points, add them to the comments sections.P.S. here is a nice comparison from IBM

Cheers and Happy Coding.

Cloud computing vs Open Source – Most CIO cannot tell the difference

Few weeks ago, I posted a discussion here in a CIO forum on LinkedIn and frankly some of the comments are very interesting to say the least. Now I decided to bring some technical guys to the discussion table. My argument was and still is as follow
“I have been reading many threads about Cloud computing and I came to conclude that most CIO (maybe because of their business background) do not know the difference or real benefits of Cloud computing or Open Source software.

Hi, I am not expecting everyone to agree with me but here is my argument. Most CIOs are interested in Cloud computing because of cost. COST!!? That’s very interesting because to my humble opinion, this only applies to IaaS (Infrastructure as a Service). If you do not want to spend money on hardware and be left with redundant system then IaaS is a good approach but that’s about it. I work with Cloud computing (specifically SaaS) and this next one might hurt my business but it has to be said; SaaS is not cost saving when you comparing it Open Source alternatives that you can host on your IaaS system…. Read more here

I am not sure that they understood the argument. I was not expecting anybody too agree with me and I wanted CIOs in the group to share their insight not sound like a copy of a Gartner report. Before making any conclusion, keep in mind that I am talking here about Software as a Service (SaaS), as defined here. In network architecture design, the external network  is represented by the “cloud” symbol therefore I would have to agree Wikipedia’s definition of cloud.  It is a software served over an external network regardless of a private network (private cloud) or public network (public cloud). YES – the internet was built on cloud technology. If you use any software over the internet; be it email, search, video or social network, the system is hosted by an external party which you do not have control over. The name cloud is just a marketing gimmick because hosted applications have been around for more than 20 years since Compuserve and Internet Relay Chat (IRC & BBS). So you see, “cloud” is definitely not new. Therefore software delivered over the internet such as Google apps and Salesforce can be also deployed using Open Source alternative. Cloud promises the following: scalability, peace of mind as it maintained by the providers and lower cost. CIO, I will tell you that your software, that it is deployed in the cloud or not will not be able to scale beyond the hardware and network capacity. I have another question for CIOs:
Do CIOs care or know where all their applications are running? 
That question is usually left to the technical team to decide within the budgets of the project and any other company politics. The biggest failures of IT projects is due to the fact that the CIO (or “the business” as it is usually referred as) do not know what they are trying to achieve (lack or misunderstandings of requirements) therefore it goes past the delivery and budget. 
So where does Open Source fits in, one might ask? Open Source software allows a business to take best of breed software and customised them to their own needs for free (as in free beer). If you do not want to support the Open Source software you can get support services but the software is hosted on your own system including your private cloud (Infrastructure as a Service). Let’s put it in to context; if a company requires a CRM system – they can download vTiger, customise it and either support it themselves or buy support. The same goes for an ERP system like Apache Ofbiz and MySQL for database. I am in favour of SaaS offering, after all I run a SaaS-based company. Nevertheless, CIOs do not confuse SaaS as being cheap, if you want something that has a low cost of ownership, then I suggest you go for an Open Source alternative if it exists. So why do I say that most CIO cannot tell the difference; SaaS is not cheap and does not have a lower cost of ownership when comparing it to Open Source alternatives. And by the way, you do not need to have an army of developers to build and customise your Open Source software. Do you really want the SaaS provider on a shared system to have access to your LDAP system? What happens when you want to integrate or port your existing data to your new fancy cloud based system? CIOs should not try to lie to me. I attended many meetings and conferences to know that most of them just want to please the board. What are the differences between cloud and virtualisation? What happens to your existing hardware once you moved your applications to cloud, have you thought of using them for virtualisation? So please do not make uneducated comments as “I don’t know a single CIO who can’t tell the difference between Cloud Computing & Open Source – maybe I move in different circles.” I am not talking about dictionary or Gartner definitions.  
CIOs, after reading this and before replying you should go and sit down with your technical team and ask them the difference, only after that you can provide a good educated comment. If you want to be on the “cloud” train then you are free to do so but if SaaS is not part of cloud offerings, please feel free to enlighten me as I am always willing to learn something new.
Who should make the decisions to go cloud or not? You are the CIOs, you tell me. Is it the developer, the architect, the project manager or the almighty CIOs from his ivory tower? There is no trickery here, every fool can define a word – just do this; think of a word then Google using the following “what is ‘the word’” then voila your definition. If you need someone to school you up then drop me an email. Based on the comments on LinkedIn, all I can say is WOW. Leave the technical aspect to the technical guys and you can focus on playing golf.