#LeanDevelopment for #LeanStartups
Keyword is ‘Continuous’. (This explains it better, http://goo.gl/q6Pnk)
- You change backlog continuously
- You build continuously (every commit)
- You deploy continuous. (even 5-6 times a day)
- If you are in same boat as me, I have choosen ‘Spring Framework’. Spring Framework is not a framework, it has become underlying nerve of almost all project. It’s all IOC.
- I recently dump technologies like ORM (Hibernate/JPA) in favor of old school JDBC (See my other post on Why?)
- I am sticking to JSPs and old school JSP includes. Why? Because my team should be able to introduce any jsp with minimal time and minimal impact. Any developer with little experience of java, can work around JSPs.
- At last but least, standardize html technologies including CSS and JavaScript libraries.
- MySQL DB (or you can go with PostgresSQL )
- Spring Framework (JDBC, MVC, rich set of Annotations for transaction, cache, webservices )
- JSPs for displaying content. No templating framework. Plain JSP includes.
- HTML 4.01 Strict transitional standardized UI
- JQuery 1.4.2+ (including JQuery UI and plugins as needed). Google it, you will find thousands
- Yahoo YUI CSS grids, to stanardized your grids once for all. (including reset css)
Why not PHP?
Traditionally
Generally, if we are bunch of developers, we think, of getting one build server and install some open source tools like ‘Hudson’. Also make maintain source control repositories using subversion ourselves.
- Provision a development integration server.
- Provision DB servers for different stages of a project
- Provision a Unix box, for source control.
- And then find people, to install those and manage those.
Welcome to world of PaaS and Saas
If you have experience enough, we know, getting into maintaining tools ourselves, we will be putting hours, which we could have been writing code. Hence, I am in favor of, why not use online services? For example, altassian group provides execellent suite of all tools in one single subscription package. Link http://www.atlassian.com/hosted/studio/ . Personally, I am big fan of JIRA and used Confluence. So I don’t want to waste my time, learning new tool or spend time, how to install/maintain it. There are lot of other paid subscription services available like http://beanstalkapp.com/ and many others. Point is, I will rather buy subscription for these services and use it. (If I need my car serviced, I will drive to auto shop, rather than setting up a new one in my garage 🙂 )
Excellent examples of PaaS & Saas
- Xeround, They are new kid on block, providing DB hosting as a service (SaaS model). I have experimented with their services. At least for startup or low volume work, they can be right fit. You can always do cost-benefit-DBA_salary-Ping_time analysis.
- Atlassian Studio: Provide hosted services for Subversion/ JIRA / Bamboo, confluence wiki and even agile tools like Greenhopper. Frankly speaking, I am ok with spending $125/mo with them, if I am seriously spending my time for startup. Think of productivity.
- Amazon EC2, If you need to provision a server for any reason (or live production hosting) This is one very good option. I am using their micro instance for running my dedicated MySQL server. I even hosted wordpress blog there. (A week back, I moved to blogger.com) (To save some more bucks, I am using ‘Spot Instances’. )
For those, who don’t know, AppFuse is excellent open source project, which allows you to download & use it’s pre-built projects. It provides different projects with different technology stack with web interface. Yes, it is good starting point, when you want to see certain API in action and modify, experiment with it. But from my point of view, it’s more like proof of concept. It can be good starting point for you, if you starting from scratch, as long as it matches you pre-determined technical stack. For my own project, it doesn’t. I was spending more time, working around it, hence I decided to write some ‘generic’ web framework from scratch. Also adding different goodies like separate admin, user interface, cache support using annotations etc. Hopefully, I will release it, it’s first alpha release as open source soon.
End Note:
In this post, I tried to look at technologies side of #LeanStartups. This is something, which can be black hole for many startups if not controlled to begin with. Programming languages like PHP can be easy step for day 1, but when things get serious, we need serious enterprise friendly language and tools supporting it. And Lean development model (as described above, using Java), can serve both purposes of starting easily and able to sustain long term.
Spring 3.1 with Cache and ORM technologies
To be fair, Cache using annotation is not new. It’s been available as part of open source projects like http://code.google.com/p/ehcache-spring-annotations/. But now cache annotations, being part of core spring framework, it is going to be used more seriously and developed pro-actively.
Another major impact is, I am revisiting actual benefits of using ORM API for data access. As we all know, we have pretty much two ways to access database, either plain JDBC or ORM API like Hibernate. I am big fan of Hibernate, due to obvious reasons. And one of main reason is, adding cache capabilities by enabling 2nd level cache. But in design sense, cache is more like cross-cutting requirement for a running system. Like any other cross-cutting concerns like Transactions, it makes more sense to use ‘annotations’ way.
Why back to JDBC now?
That’s one decision, I recently made. I switched back to JDBC based DAO implementations instead of Hibernate backed DAOs.
- We all have experience of writing SQLs. And using Spring JDBC templates, it’s very easy to implement methods.
- When we actually implementing DAOs, most of operations are not CRUD type. It’s mostly join of multiple tables. Although HQL/JPQL can achieve can anything but it’s another learning curve.
- Personally, I don’t want to add another layer API in whole technical stack. Hibernate (or any other ORM layer) is great and might have obvious benefits but it always have learning curve and yes, we spend time in debugging HQL or JPQL.
- Major factor was ‘cache’ feature in Hibernate. Now Spring Framework provides cache annotations. It gives me more flexibility on what to cache and what not to. (even eviction policies are supported)
- Plus spring cache annotation can be applied anywhere. Not just DAO, even remote webservices, or any method which is resource intensive.
- There seems to be incomplete code, how to generate key. (It’s using just method name to generate key? )
- Spring team is working on adding more providers (apart from ehcache). Support for providers like JBoss treecache will be nice. Specially in multi-cluster environment.
Fast Forward To MVC 'ONE'
- Pretty interface, which users to love to use it. (Example mint.com)
- Interactive & Intuitive interface.
- Functional interface. It does what it promises and always does that.
- Low or almost NIL learning curve for any new developer.
- Able to extend interface + functionality by 3rd party developers. (That strives any web product)
- Quick turn around of code to market
- Able to remove or disable code or by choice of end user. (user is deployer)
That’s this post is all about. I know, many of you, thinking, c’mon man, Nineties called, they want their MVC one back. But lets entertain this idea for a while. For example, I want to write simple webapp ‘java press’ blogging engine, able to deploy it with in couple of weeks and my available heap size is 64MB (pretty common for VPS plans). If I go by spring mvc route, it will take me a couple of weeks, just enough to setup my environment, DBs, etc etc. I will have re-hash my knowledge of spring, and spring mvc controllers etc etc. But if I just pick JSPs model, i am ready to convert static HTMLs with-in a day.
- For deployments for small companies or concept deliveries or Y combinator kinda projects, time to deliver is small.
- You don’t have to muck around which framework to use. You think of doing something, and you doing it.
- Think of 3rd party developers pool, you get access to. If you document well, even PHP developer can pick JSP skills in few days and write JSPs for your webapp. (Imagine hiring PHP developer for spring MVC work. I don’t have time & budget for training).
- With new JEE specs coming out, you are always safe to upgrade your app and take advantages of new features without rewriting anything. (That’s what spring says, we give you another layer of abstraction. But you have upgrade code for spring 3.x now, isn’t it?)
- For scalability, it’s cheaper than before, clustering solutions based upon clouds. So my one deployment supports 50 concurrent sessions, I will just throw couple extra virtual tomcat instances, with in same cloud instance. or couple other different ways.
- I am less worried about performance, because recent benchmarks for tomcat 6 using JDK 6, is impressive.
- Using data source pooling, getting connections from JSP isn’t resource intensive. (As part of SDK, some classes with static methods can provided, to provide some encapsulation on common used API calls)
- web.xml supports basic security model. And again, as part of SDK, some common servlet filters can be provided for cross cutting concerns like security, logging, transactions.
- DB Caching can be ignored for now, assuming DB server and tomcat instance are co-located or installed in same instance. Caching adds lots of code maintenance, research & testing. Benefits of using caching diminishes in small db and small users.
- Well known advantage of JSP, do code change and see changes immediately on web browser. Hence time to see results, while doing development is almost nil. We all have taken coffee breaks in our past projects while waiting for server to bounce.
Recent Comments