Are you looking to build a Micro-SaaS (or a regular SaaS) business but don’t know what language to build it in? Unlike what some developers believe there is not
One Language to Rule Them All, so you can’t make a wrong choice. You can however, make your life much easier if you know the tradeoffs of each language. Consider the following tradeoffs when evaluating a language:
- Speed of development - the faster you can make things work, the faster you can release!
- Ease of development - How hard will it be to make changes in 3 months? How about 3 years?
- Popularity of the language - The more popular the language, the easier it will be to hire additional developers down the road.
- Performance - What are the tradeoffs in performance? Is the language fast, but a memory hog? Is it easy to build but incredibly slow?
- Your knowledge - If you don’t know the language, why are you even looking to start a software business around it?
There are many other areas you could consider when evaluating a language, but these will give you a good baseline and allow you to throw some languages out. Without further ado, here is my list of top contenders for building a SaaS business in 2017.
Java is still the reigning champion when it comes to popularity for building new projects. It is used extensively in the corporate world, and still taught in most universities in the United States.
- Speed - faster than modern interpreted languages
- Portability - Runs on a very wide number of platforms
- Maturity - Has been around for a long time and has a strong user base
- Libraries - Because of the large community, there is also a large number of libraries to pick from which speeds up development time
- Memory - The tradeoff to getting good performance is using more memory. This means more money as your service scales
- Speed and Ease of Development - Java is verbose, which means more lines of code to solve most problems. This means it takes longer to learn the entire language and slows down development time slightly. However, it is pretty easy to go back 6 months later and read the code.
Python is the second most common language I see students learning in universities. It is much easier to write than Java, but at the cost of performance. However, python does have the ability to interface with native code, so performance critical pieces can be written at the system level. The other frustrating thing about Python is the major rift in the community around the 2.x and 3.x versions of the language. If you aren’t sure what I am talking about, do some googling!
- Speed and Ease of Development - Python is a dynamic interpreted language which means it is very easy to write code for. It is also very easy to maintain.
- Maturity - Python has been around the block a few times so it has reached a high level of maturity and a large user base. As long as you start your python journey on version 3 of the language, you won’t hit a lot of speed bumps with learning the language.
- Portability - Python runs in an interpreter so it can be run on most platforms. Installing the interpreter is not as easy as it is with Java though, so writing client apps becomes a bit more challenging.
- Libraries - The length of time Python has been around and the size of the community mean there are a lot of supporting libraries to pick from. The only major issue with this is the porting of libraries from version 2.x to 3.x of python, which a lot of maintainers have been resistant to.
- Speed - Python is an interpreted language so it lacks in the performance realm. If you need something to be fast though, you can just write a native module in C/C++ and hook into it from your python code.
- Libraries - This is also listed as a con because of the resistance to the major rewrite of the language that took place in version 3.x. A lot of libraries have not been ported yet, and are showing no signs of being ported in the near future.
In my opinion, this is the only language on the list I would be hesitant to build a Microservice in. PHP is a server side scripting language built around HTML templates. It has been around since 1994, so is one of the oldest web languages still in use today. It is still popular, coming number 3 in number of searches for tutorials according to google trends. It is also the language driving the most popular blogging platform on the web, Wordpress. It is not a bad language to know, but if you are just now learning a language to develop Microservices, I strongly suggest one of the other languages on the list.
- Maturity - At 23 years old, this language has a long history and a large community to back it up.
- Libraries - The age means that almost any library you can think of has already been written for it.
- Ease of development - If you already know how to build static websites, adding PHP scripting should be an easy thing to pick up. There are a few speed bumps when it comes to learning about databases and some of the archaic syntax, but they are just small hiccups in learning the language. It really is easy to learn and develop in!
- Speed - It is easy to code yourself into a performance nightmare with PHP. You need to spend significant time learning optimization techniques to make the language performant for larger projects and Microservices.
- Portability - PHP was designed to run on a web server, and that is all it supports. It can run on multiple server platforms (i.e. windows, linux, etc), but it can’t run outside of the web server environment.
- Security - PHP tends to have more security issues than any of the other languages on this list. Each language has special caveats to be aware of when coding in them, but PHP takes the cake for insecurity.
Ruby and its web framework Rails have lost a lot of favor in recent years. They used to be the goto framework for cutting edge web applications. Now, they are forgotten a lot of the time in favor of the new hotness, but I think it is still important to consider Ruby when building a new Microservice.
- Ease of Development - Rails makes standing up a new web application a complete breeze. I can prototype an entire new service in a couple of hours with relative little coding on my part all because of the power of Rails scaffolding. If you are looking to build a quick proof-of-concept or MVP service, Ruby on Rails should be your goto choice.
- Maturity - Ruby has been around a while and there is still a very strong community actively using it today.
- Libraries - There are a lot of Ruby Gems available for nearly every task you can imagine.
- Performance - Ruby may be easy and fast to develop on, but it has a serious shortfall when it comes to system performance. There are ways to make it perform as fast as other languages do out of the box, but this is definitely something to consider if you are writing a performance critical service.
- Portability - Like PHP, Rails is a web framework meant to run on a web server. You can use the Ruby language stand alone via an interpreter just like Python, but it is much harder to build a web service that way.
There are a few other languages I would like to mention in a little less detail that you might consider using to build a new Microservice with. Go is googles in house language that is gaining a lot of traction lately for building network heavy applications. Scala is a JVM hosted language that is used by a lot of big name tech companies for writing their Microservices. Clojure is another JVM hosted language that allows you to write Functional Lisp based Microservices and my current favorite language.
Keep in mind, there is no wrong language for developing Microservices. However, some languages are better suited to your services needs, and after all, a language is simply a tool for getting a specific job done. Try to pick the best tool for the job and you will make your life so much easier in the end!