The Fastest Way to Deploy Clojure Applications to the Cloud
Clojure is a rather recently developed language, a dialect of Lisp targeted for the JVM. It came on the scene back in 2007 and has gained a loyal following due to the numerous advantages that it offers developers, especially how it simplifies multi-threaded programming.
Clojure on the Jelastic Cloud
Clojure is a functional, general-purpose, compiled language. It is complied directly to JVM bytecode, but remains completely dynamic. Every feature supported by Clojure is supported at runtime. It also provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection. With Jelastic, you can take advantage of all the benefits of coding with Clojure without the limitations placed on you with other platforms like AWS Elastic Beanstalk (Elastic Beanstalk), Google App Engine (GAE), Microsoft Windows Azure (Azure) or Heroku.
Advantages of Coding in Clojure
- Suited for highly-concurrent applications
- All the benefits of functional programming without all the negatives associated with the imperative approach
- Allows dynamic, compact code with late binding, macros and multi-methods
- Can code functions to sequence abstraction instead of to specific data structures
- Supports Lazy sequences
- And probably most importantly, it runs on the JVM: highly portable and fast garbage collection
Business/Cost Benefits of Using Clojure and Jelastic
The growing complexity of languages and the needs of customers threatens to overwhelm today’s programmer. Clojure was made/designed to help alleviate the load placed placed on the developer, because it is all too easy to get caught up focusing on details and handling specific issues related to new technology and forgetting the big picture, i.e. missing the forest for the trees.
Cost/Business Benefits of Using Clojure
Clojure provides many benefits to the developer, especially those that are working on highly-concurrent applications. Though it may be a rather specific target group, there is a huge amount of work that is being done with Clojure because of how well it is suited for this kind of programming.
- Clojure was built to be simple
- “Code is Data”
- Easy to write and test functions
- Data is immutable
- States are explicit
- Built on JVM
- Most widely used development platform today: portability and interoperability
- Clojure provides fast, wrappers free access to Java code
- Built for multi-threaded applications: simplifies multi-threaded programming
- Jelastic is the fastest and most efficient way to deploy Clojure applications
- Unlike GAE (used by many developers to deploy their Clojure apps), Jelastic actually supports multi-threaded applications: if you are doing multi-threaded programming, you need your platform to support it – Jelastic does
- No restrictions: any multi-threaded application or library is supported
- Scale your application up and down, automatically
- You need more processing power? You got it. Automatically
- Want to reduce cost and save some money? You got it. Automatically
- Ability to backup, replicate or simply copy your application across a global network of hosting service providers easily
- No lock-in: want to host your application in Europe or US? Or do you need to have your application hosted in the US, Japan and Russia at the same time? Done
- No need for a system administrator: save your money – with Jelastic there is no need for a sys admin
- No learning curve: unlike Amazon, Google or Microsoft, with Jelastic you don’t have to spend valuable time (and money) learning how the platform works, reading up on the limitations that are placed on your app, learning about their custom app servers and databases or recoding your app to make it work - with Jelastic you can be running in minutes instead of hours
Deploying Your Clojure App to the Cloud
Create the environment
1. Go to jelastic.com and sign up if you haven’t done it yet or log in with your Jelastic credentials by clicking the Sign In link on the page.
2. Ask Jelastic to create a new environment.
3. In the Environment topology dialog which opens, pick Tomcat 6 as your application server and Maven as your building tool, type your environment name, for example, clojureapp and click Create.
In just a minute the environment with both Tomcat and Maven will be created.
Build and deploy the project
1. Click on Add project button for Maven.
2. In the dialog, navigate to the Git tab (or SVN). Specify your project name, Path to your project, Branch, Login and Password of your repository, name of your Environment, Context in which you will deploy your project, and click Add. We’ll use a simple Clojure application as an example. You can find this project here.
Now your project is successfully added.
3. Click on the Build and deploy button for your project.
This process will take a few minutes. Your project will appear in the context that you have specified and in the Deployment Manager.
That’s all you have to do! Now you can open your Clojure application in a web browser and enjoy.
- Shall we use Clojure – my presentation (andrewhjon.es)
- Clojure Forum (Google Group)
- Clojure Programming (WikiBooks.org)
- Why does Google App Engine only support a single-thread of execution? (stackoverflow.com)
- How fast are JVM-based languages growing among developers? (jelastic.com)
- Multiple Domains in Jelastic (jelastic.com)