Question: Say we were modeling Users and Friends, and Friends have a type. 

We could model it in Oracle like:

```
User: id, name, sex, age
Friendship: user_id, friend_id, type

```

So in HBase, we could do:

(this first model is from [here](http://www.slideshare.net/hmisty/20090713-hbase-schema-design-case-studies), which is recommended by the HBase FAQ)

```
Table: Users
RowKey = <user_id>
Column Family = Info; Columns = "Name", "Sex", "Age"
Column Family = Friend; Columns = "Friend:<user_id>"=type

```

(where "Friend:"=type could be one more more user\_ids)

or

```
Table: Users
RowKey = <user_id>
Column Family = Info; Columns = "Name", "Sex", "Age", "Friends"

```

(where "Friends" is a JSON string in the form [{user\_id:, type:}, ...]

However, if a friend did not have a type, the second model could simply be `[user_id:<user_id>, ...]`. What would the first model do if friends didn't have a type?

What are the pros and benefits of either approach?

Answer: 
In Linux (and Unix), every process is created by an existing process. You may be able to create a process using `fork` and then, kill the parent process. This way, the child will be an *orphan* but still, it gets *adopted* by `init`. If you want to create a process that is not inherited by another, I am afraid that may not be possible.
You do a fork (man 2 fork) followed by an execl (man 2 execl)

For creates a new process of the same image as the calling process (so a perfect twin), where execl replaces one of the twins with a new image.

If you search google for "fork execl" you will find many text book examples -- including [how to use correctly fork() and exec()](https://stackoverflow.com/questions/8371363/how-to-use-correctly-fork-and-exec)

The most common fork-execl you will still have the new process associated to the terminal -- to create a perfect background process you need to create what is called a daemon process -- the template for that can be fornd in this answer here [Creating a daemon in Linux](https://stackoverflow.com/questions/17954432/creating-a-daemon-in-linux)