The emergent generation of web frameworks for dynamic languages can improve developer productivity by an order of magnitude compared to traditional web application development technologies. Cloud hosting of applications built on standards-based platforms provides an affordable path from development to launch to large-scale production. Taken together, these advances mean that a lone developer familiar with a given business domain can outproduce a typical corporate product development team and deliver (over the public network) service levels rivaling those of most corporate data centers. This creates new business opportunities to serve niche markets with SaaS applications that are clearly superior to current solutions, if current solutions exist at all.
Grails is an almost ideal development platform for this sort of SaaS application:
- A single developer or small team needs to maintain a high degree of productivity to take advantage of market opportunities. IDE-focused platforms such as Visual Studio and script languages such as Perl and PHP offer high productivity in the initial phases of construction, but this wears away quickly as the highly-coupled, repetitive code these approaches tend to encourage becomes progressively more difficult to extend or maintain. Grails offers the combined productivity benefits of a dynamic language (Groovy), convention over configuration, and consistent integration of proven Java frameworks such as Spring and Hibernate. Grails helps the developer sustain these benefits over the entire application life-cycle by supporting design and coding practices such as loose-coupling, separation of concerns, and automated testing.
- An SaaS application targeted to a large population of small organizations needs to have robust security and a multi-tenant architecture. The latter is particularly troublesome, since a "one database per tenant" approach creates significant administrative overhead, while a handcrafted "multiple tenants per database" approach brings extra complexity to the design and implementation. The Grails community offers solutions to these issues through plugins. For example, the Multi-Tenant Plugin integrates with the Spring Security plugin to provide these capabilities in a way that is almost transparent to the developer.
- Applications of this sort are unlikely to attract the venture capital backing necessary to absorb the initial investment in production run-time infrastructure. Cloud hosting allows a start-up to incur infrastructure costs on a pay-as-you-go basis compatible with its revenue model. However, if the application becomes wildly successful, its architecture should support ready migration to a dedicated-host or even self-hosted model. Grails runs on the Java Enterprise platform, which is well-supported on both hosted cloud and commodity open-source infrastructure. Further, Grails plugins such as the Cloud Foundry Plugin provide seamless integration with the deployment infrastructure.
Dave,
ReplyDeleteThis is a great article on the power of Grails and Groovy. I suggest people check out the article Multi-Tenant Web App with Grails. The Cloud hosting creates a whole new opportunity for developers.
David,
ReplyDeleteYour article on multi tenancy using grails is superb. Do you plan to do an updated version of this anytime soon?(spring security for e.g. instead of acegi and looks like tenantId problem might have been patched in plugin)
Thanks
Bala
As a matter of a fact, I'm working on it now. I'm upgrading our application to Grails 1.3.4 and Spring Security. Along the way, I'll find out whether the Multi-Tenant Plugin 1.0.0 works with Spring Security (as opposed to Acegi). I'll probably also look at the RelationalScope plugin as an alternative.
ReplyDeleteI had to wait for all of the versions of the plugins to catch up with each other before it was worthwhile to try to upgrade the application. Unfortunately, I found that even with the current versions (Grails 1.3.5, Spring Security Core plugin 1.0.1, Multi-Tenant plugin 1.0.0 and Multi-Tenant Spring Security Integration plugin 0.1), the same tenantId problem manifests itself. I applied the same patch to the new plugin, but I'm not happy about it. This means that the same show-stopper bug has existed in the Multi-Tenant plugin for almost a year -- even through a significant update. No one can have tested this plugin in multiTenant mode with an application that has at least one domain class that does not carry the @MultiTenant annotation.
ReplyDeleteHi Dave,
ReplyDeleteI also cannot get the multitenant plugin to work in multitenant mode as you mention(Grails 1.3.5, Spring Security Core plugin 1.0.1, Multi-Tenant plugin 1.0.0 and Multi-Tenant Spring Security Integration plugin 0.1)
Did the patched version you built work. If so can you please share it(trbala at yahoo.com)
Thanks
Bala
Yes, the patched version works. It's the exact same fix that I documented in the section "Patch the Multi-Tenant Plugin" of the wiki article "Creating a Secure, Multi-Tenant Web App With Grails" referenced above, only applied to version 1.0.0 instead of 0.17. I'll update the wiki article -- probably next weekend.
ReplyDeleteFor what it's worth, the tenantId issue may be fixed in multi-tenant-core 1.0.1.SNAPSHOT (https://github.com/multi-tenant/grails-multi-tenant-core/issues#issue/1). For this to do any good, the multi-tenant-spring-security plugin will have to pull in the new version.
ReplyDeleteAlright then. The just-released multi-tenant-spring-security plugin 0.2.1 pulls in multi-tenant-core 1.0.1 as a dependency. The tenantId issue is fixed in this release and you can (finally) just install the plugins and have it work.
ReplyDeleteHi Dave,
ReplyDeleteI was wondering if you have an upgrade version of the application, I really interesting in create a multi tenant app to deploy to aws using the current plugins , need to show to my team that grails is a great framework.
This article was a product of work I did for a project. I haven't updated that project to the current version of Grails yet.
ReplyDelete