Monday, June 06, 2011

Running your own one person company

Recently there was a post on PuneTech on mom's re-entering the IT work force after a break. Two of the biggest concerns mentioned were :
  • Coping with vast advances (changes) in the IT landscape
  • Balancing work and family responsibilities
Since I have been running a one person company for a good amount of time, I suggested that as an option. In this post I will discuss various aspects of running a one person company.

  • You have full control of your time. You can choose to spend as much or as little time as you would like. There is also a good chance that you will be able to decide when you want to spend that time.
  • You get to work on something that you enjoy doing. Tremendous work satisfaction.
  • You have the option of working from home.
  • It can take a little while for the work to get set, so you may not be able to see revenues for some time.
  • It takes a huge amount of discipline to work without a boss, and without deadlines.
  • You will not get the benefits (insurance, etc) that a company would give you.
  • Your finances may or may not show a constant graph.
  • You may have a hard time getting home loans, since most banks (especially in India) feel that employed people are more stable (whatever that means :-) )
  • People may think you are not doing real work (most people have a very skewed notion of what real work means)
  • You will have to deal with distractions, if you are working from home.
Even though the disadvantages outnumber the advantages, qualitatively I think the advantages are vast. I may be a bit biased, but I really think that a 9 - 5 job in a large organization, totally sucks the soul out of a person.

I will restrict this advise to India, whose laws I am accustomed with. You do not need to register any legal entity to run a one person business. You can run it on your own name, you can raise invoices on your own name, and you can file your taxes on your personal PAN number.

Some people may create a sole proprietorship, but that is purely to have a business name and to be able to invoice clients on a business name, rather than your personal name. Besides this, having a sole proprietorship has the advantage of being able to easily separate personal and business accounts. The latter can be achieved simply by keeping a separate savings account for work related transactions.

Some people may also choose to create an LLP. Besides the points mentioned for sole proprietorship,an LLP will shield your personal finances against business losses, lawsuits, etc.

I will not get into the legalities of creating a sole proprietorship, or LLP. My suggestion is to start work on your personal name, and create a legal entity later, if required. You should consult your CA for details of creating a business entity.

Types of work
There are many types of work that can be done as a one person business. I will focus on IT related fields in this post.

Many people make a living by doing freelance projects. You can either get projects directly from clients, or you can work on one of many freelancing websites. These websites publish projects that people want completed. If you feel that you can do the project, then you can bid for it. If you get the project, you will have to complete it in the stipulated time, and with the required features. The payment usually comes once the client is satisfied with the work. Most of these websites allow the client as well as the developer to rate each other. These ratings go a long way in determining whether a client will give you projects. Typically a freelancing website have work related to coding, documentation, website design, etc. Some such websites are: Elance,, FreelanceSwitch, ODesk, and (Disclosure: I will get a small commission if you register on some of these websites, following the provided link)

Regardless, of whether you get projects from a freelancing website, or on you own, you should always have your own website, and a blog. I cannot stress how important it is for a freelancer to have a blog. Your blog is the place where potential clients and friends get a glimpse of the real you. It is also your showcase for projects completed, and an online portfolio.

Contract programming:
If you have been in the software industry for a long while, then you probably already have a lot of contacts who would like to give you some contract programming work. This can also be lucrative and fun. In contract programming you typically make a commitment (such as 20 hours per week), and charge on an hourly rate.

If have passion for sharing your knowledge with others, then teaching is a wonderful way to do satisfying work and earn a livelihood. There are various avenues for teaching. You can teach in a local college, you can teach at companies, or you can teach on the Internet. You can also do all of these if you desire.

Some places you can create courses and teach on the web are,, and You can also create your own website for teaching using Moodle, or a similar open source software. I have created my own website for teaching computer science, but I am not yet making any significant revenue from it, so beware before you take it as a role model :-) However, you can check out this website of a database expert who maintains a learning community on his website.

You can also create and sell screencasts like the people at Peepcode, and Destroy all software.

I think there is a lot to be said about teaching, and it probably warrants a separate blog post.

Creating mobile applications:
Many people make a living by creating mobile applications, for Android, iPhone, etc. The amounts vary, but it is very much do-able. Several people give helpful tips and also post there monthly incomes on their blogs. You might find them useful. This is one example website of an independent developer who posts monthly incomes and also gives helpful tips.

Creating stock photos, and designs:
If you are the arty type, you can create stock photos, images, or icons, and put them up for sale on stock photo websites. There are many such websites, and some people are able to make a good continuous stream of income from them. iStockPhoto is one such website. You can also create designs for clients on sites like

Selling websites:
If you enjoy making and selling websites, you can make and auction your websites on

Niche websites:
If you are really passionate about something, and also have a lot of knowledge in that field, then you can share your knowledge on a niche website, and earn revenues from advertisements, affiliate sales, subscriptions, etc. See this blog post on information about building niche websites.

If you have something to sell, you can also set up shop using a hosted e-commerce solution. However, keep in mind that managing logistics, shipping, handling, and customer care may be more than what one person can handle.

I hope you found this post useful. This is a brief list of things that can be done as a one person entity, and some pointers on how to go about doing it. I think plenty more can be said on this topic.

I will try and write further blog posts talking about each of these points in greater detail.

Wednesday, April 27, 2011

My HSQLDB schema inspection story

This is a simple story of my need to inspect the schema of an HSQLDB database for a participar FOREIGN KEY, and the interesting things I had to do to actually inspect it.

I am using an HSQLDB 1.8 database in one of my web applications. The application has been developed using the Play framework, which by default uses JPA and Hibernate.

A few days back, I wanted to inspect the schema which Hibernate had created for one of my model objects. I started the HSQLDB database on my local machine, and then started the database manager with the following command

java -cp ./hsqldb- org.hsqldb.util.DatabaseManagerSwing

When I tried the view the schema of my table, it showed me the columns and column types on that table, but it did not show me columns were FOREIGN KEYs.
Image and video hosting by TinyPic

Image 1: Table schema as shown by HSQLDB's database manager

I decided to search on StackOverflow and find out how I could view the full schema of the table in question. I got a few hints, and they all pointed to the system tables, so I decided to turn on the "show system tables" option from HSQLDB's view menu.

The first table that caught my eye was information_schema.system_tables, so I fired the query:

select * from information_schema.system_tables;

This gave me all the system as well as application tables, but did not give me the detail I was looking for, which was the FOREIGN KEY contstraints on the 'USERREGISTRATIONDATE' table.

The next table that caught my eye was information_schema.system_table_constraints, so I fired the following query:

select * from information_schema.system_table_constraints where table_name = 'USERREGISTRATIONDATE';

This helped a bit further. It told me that the USERREGISTRATIONDATE table had a FOREIGN KEY and the constraint name was 'FK98DCB61247140EFE'.
Image and video hosting by TinyPic

Nice, but it still did not tell me which column the constraint refered to.

The next table I came across was information_schema.system_crossreference. This seemed to have a column called 'FK_NAME'. Good, I fired the query:

select * from information_schema.system_crossreference where FK_NAME='FK98DCB61247140EFE';

Here is what this table showed me...

Image and video hosting by TinyPic


Awesome, this time it showed me the name of the the FOREIGN KEY 'FK98DCB61247140EFE' references the 'ID' column of table 'USER'

I finally had my answer, but before ending this post, let me mention just one more thing. I realized that I did not need the information_schema.system_table_constraints table at all. I only needed the information_schema.crossreference table with the following query:

from information_schema.system_crossreference

Image and video hosting by TinyPic
Image 4: Finally the query that clearly showed me the FOREIGN KEY

Now all this should not have been so time consuimng. The GUI tool should have given me this information right away.