Building a Webapp Store

So I have been silent for some time. Mainly due to deep diving into new territories since I left Oracle. Now I think it is time to put my new skills to some work and test them out. To that end, I thought that I need to build a webapp project for myself. Just to assert what I am learning and to learn even more from hands on practice.

My Debian Wheezy Web Hosting Image for the odroid u2

Search for a Schema

So now that we have a backend, we need to store something in our backend. For that we need to have a schema for our domain. What is our domain ? Excellent question, not sure yet. But a customer and perhaps products he orders seem to be a good enough choice to begin with. I am currently working for a telecommunication company, so am seeing a lot of customers and orders. Thereby this should be no surprise. But aside this point, pretty much every webapp has customers and orders in some form. So we should have some good learning opputunity here.

The Database Backend

The first thing that any webapp needs is a persistance storage. Generally speaking Oracle databases are generally a very safe choice. But for small and medium based businesses this can result in prohibitive costs. Mysql/MariaDB is a popular choice here and is running most of the web. But at this point I am deciding against the popular choice and going for Postgre. The main thinking and reason being that Postgre is considered very close to an Oracle DB. Hence later if I wish moving my schema over to an Oracle DB is generally considered do-able.

Memory Profiling for Novices ( Heap OutOfMemory OOME error )

So sometimes out of memory errors crop up in you application. But to troubleshoot these should not be that complicated. Let me show you with Oracle's Visual VM, how you can quickly get down to the root cause of your out of memory errors. All you need Oracle's Java JDK installed on your system and the VisualVM tool that comes with it. At the time of writing the version I used was with JDK 8 (1.8.0_144). On a Mac OSX system all you need to do is type "jvisualvm" on your terminal and it will just popup. If you have your paths properly setup under windows and linux, it should also just work.

Lambda Recipe for attribute validation of Collection of POJOs

So here is a recipe you can use to validate a POJO attribute for some value. In my case I will show you how to check if attributes were set to null. But you can expand on the example as an exercise for yourself.

So here is the template method for a single object and a collection of objects:

Gradle System Commands Cheatsheet

So I was reading this book "Gradle in Action" and thought I'd jolt down the more interesting technical niceties here. For your theory part I would recommend reading the book. The source code though is available freely for the book on github.

My Git Cheat Sheet

Following is my cheat sheet that I extracted while reading the git tutorial So I just listed the commands minus all the text there. If you have read the book than below will a quick reminder of the various commands there. Not all commands are listed but the more interesting only.

Endless select menu in bash script


There are many sources on the web for creating menus in bash scripts. After prodding through the many examples, I am documenting the approach that I felt was generic enough for all my intents and pusposes. Just as a reference even to me, in case I need to do it again.

Getting rid of bothersome kernel "Booted secondary processor" and "shutdown" notice messages from kern.log

My Odroid servers "kern.log" is basically swamped with these messages "Booted secondary processor" and "shutdown" that occur at every minute. Tried tweaking the "/etc/sysctl.conf" specifically the kernel.printk line to say "kernel.printk = 3 3 1 3". 3 is supposed to be error level but still these notice messages seemed to get printed some how.

Finally this is what got rid of them by drastic measures.


Subscribe to Ahsan's Corner RSS