Some lessons from book Sapiens

Hi folks,

In this post I share a few insights gained from reading the famous book Sapiens by Dr. Yuval Noah Harari. Sapiens is a very popular book which serves as a brief history of human kind.

It talks about how the species Homo Sapiens started out as insignificant animals minding their own business in a corner of Africa.

Then it goes through the process through which they eventually became the masters of planet earth.

Some major events that happened include the cognitive revolution, the agricultural revolution, the industrial revolution, and the scientific revolution.

A key reason humans have become so powerful compared to other living organisms is that we are able to cooperate flexibly and in large numbers. Other creatures like ants can cooperate in large numbers, but they can’t cooperate flexibly. Chimpanzees can cooperate flexibly but not in large numbers. So far, humans are the only specie we know that can cooperate both flexibly and in very large numbers.

Language is a very important tool which allows us to cooperate easily. The development of language is what cognitive revolution is about. We can use language to represent objects in the physical world, but also ideas which we call myths.

Myths are stories which are believed by many people and thus allows them to cooperate together. Without shared myths, we can’t cooperate as flexibly and extensively as we do. Some of the most important myths include money, religion/ideology and politics (kingdoms, nations, political parties, etc)

Agricultural revolution refers to how humans realized they could stay in one place, plant crops and harvest enough to feed themselves and others rather than moving around from place to place. This led to a population explosion and formation of larger human settlements.

Industrial revolution refers to how people realized they could convert energy more effectively from one form to another. Previously humans were the main form of energy conversion. We got energy from plants, and we and our animals converted that energy into motion, carrying things around, etc. With advent of internal combustion engine we were able to convert energy from burning fuel to movement. This changed the way humans operate forever.

Scientific revolution is where we started to pay more attention to objective observations and studying our world in a systematic way with the aim of learning new things that would give us powers to solve problems more effectively. It has given humans unprecedented power, leading to longer life span through improvement in medicine. New materials like plastics, rubber etc for creating myriad products that make life easier. Embracing science has led to some people no longer having as much regard for traditional beliefs as they used to, e.g. religion.

Science and capitalism, the most successful economic system, go hand-in-hand. Science and imperialism also go hand-in-hand.

Imperialism is very complex and has brought a lot of good to mankind and a lot of evil too. Importantly, it has helped unified human societies, forming a global village.

Nowadays, we discover new things all the time as we study science and scientists are fascinated with biotechnology, altering genetic composition of organisms. Cybernetics seems to be a popular trends. This means learning how to fuse machines and humans together, for the betterment of the human. Tools in this area include prosthetic limbs, hearing aid, etc. Creating inorganic lifeforms also appears to be area some scientists are pursuing. The implications of these ventures could be quite drastic and we need to pay close attention to the ethics of these activities as they could alter the human race in ways we can’t imagine.

In the last few decades the world economy has grown very rapidly compared to other times. This is because banks have been creating money faster than ever before for use by governments, businesses, etc. Why? Because we have become more optimistic about the future. We believe it is possible for the economy to grow. That is, one person can become richer without another person necessarily becoming poorer. We believe that scientific and technological progress will create more effective ways to solve problems in future. Entrepreneurs believe they would be able to use these to create better goods and services, making a profit from which they can pay off the loans they take today, with interest.

Humans have intented lots of amazing tools that have gone to change the way we live for the better. Just within the last 2 centuries we invented the light bulb, refrigirators for home use, the internet, smart phones, television, antibiotics and a vast number of other things. Have these made humans happier people? There isn’t much evidence it has for a few reasons. First, happiness is subjective. How happy you are depends on how your expectations match reality. If you expect 6/10 in a test and find out you got 9/10, you would generally be quite happy and vice versa. Second, biologically, it seems we are created to be temporarily happy. Craving for more things is what drives us to find food to eat, find mates for reproduction, etc. A person who is too happy would likely not be interested in pursuing these things and would thus not last long. Third, it appears that how happy or sad a person can be is impacted by their biological make-up. Some people are just generally happy people, content with whatever they have and whatever situation they find themselves. Some others would still be dissatisfied even if you give them the whole world.

In summary, humans are the most powerful creatures in the world. Scientists believe chance mutations in genes over time gave us the ability to create language and other tools that allow us cooperate more flexibly and in larger numbers than any other creature we know. Our dominion over our environment has helped us thrive but poses great danger to our environment and to other living organisms around us. As a result we need to pay more attention to sustainability as we go about our activities. Happiness can be found by developing more mastery over how we think. Material things can’t give lasting happiness. Rather, choosing to be content with what we have, preparing for all eventualities and setting reasonable expectations are more likely to give happiness. In short you need to Know Thyself.

That’s it for now.

A few thoughts on Oracle viewed from a MySQL background

Hi folks,

In this post I talk about a few things you may find interesting about Oracle if you are a software developer with MySQL background getting started with Oracle.

I’ve known about Oracle for a long time. Long ago I remember seeing jobs for Oracle DBAs that required Oracle certification.

It seemed like an interesting software to know how to use but there wasn’t a strong push to learn it.

While developing applications professionally, MySQL was generally the database of choice. Later I ran into Postgres in the course of professional work, but not Oracle.

Eventually I got a back-end developer role in a large enterprise and then I met Oracle properly for the first time.

Here are some thoughts on Oracle, looking at it from the perspective of someone with MySQL background.

You’re likely to run into Oracle in large enterprise where lots of data are handled. Not so much in small to medium-scale enterprises. This is because Oracle has lots of powerful features that are targeted towards large enterprises.

For the most part you can write queries using the same old SQL on both MySQL and Oracle databases. SELECTs, JOINS, subqueries work in the same manner. In Oracle, subqueries are called inline views.

Tools: With mysql you use tools like phpMyAdmin and MySQL Workbench. With Oracle the popular clients I’ve come across are Oracle SQL developer and Toad.

When querying data with Oracle via SELECT statement, you can use multiple servers by using the ‘parallel’ keyword e.g. SELECT /*+ parallel */ FOO FROM SOMEDB.SOMETABLE. MySQL doesn’t have that concept.

The way you apply limits and offsets are different. In MYSQL, you can use something like


But in Oracle, you write


In Oracle, when you want to compare values that could possibly be null, you use the NVL function


JOIN table2 on
NVL(table1.some_col, ‘IsNul’) = NVL(table2.some_col, ‘IsNul’)

In terms of connecting to MySQL from your programming environment, if you use Python, then Oracle provides a very good library called cx_Oracle. It provides similar abstractions like you would get with MySQL connector. So you have your cursor which you can use to run queries, etc.

If you use a Mac and need to work with Oracle locally, you would need to use a virtual machine via tools like VirtualBox. With MySQL, you can install it directly on a Mac.

Furthermore, the COMMIT statement is very important in Oracle. You have to commit transactions to persist changes to the database, e.g. creating a table, deleting rows, etc. Usually in MySQL, you just delete rows and that’s it, the change persists.

So, in general, if you’re comfortable with other databases like MySQL or Postgres, you should feel at home with Oracle. Oracle has some peculiarities, but you should be just fine.

That’s it for now. Till next time, happy software development.