Tuesday, September 11, 2018


SQL and NoSQL are two important choices for application data storage needs. There is a lot of confusion about which one to choose and what is a good fit. There are buzzwords on both sides which make the choices more confusing. How to choose one over there?

SQL vs NoSQL databases can be compared on the following aspects:

  • Schema: SQL has strict schema but NoSQL is schemaless
  • Relational: SQL DB has relations among tables but in NoSQL no such enforced relationship exists.
  • Transactional: SQL DB support ACID integrity. NoSQL does not have any such notion
  • Scaling: It's difficult to scale SQL DB horizontally thought there are techniques like sharding. NoSQL DB can be scaled horizontally.
One of the fundamental thing that will be driving your choice would be the kind of application you want to build. The SQL system is primarily a data model driven model and NoSQL is primarily a query-driven model. However, with NoSQL one has to be very careful as it's quite possible that with changed requirements the NoSQL model can quickly become unwieldy.

Saturday, September 1, 2018

Meetup - Pune Develope community - IoT and AI

Spoke about IoT and AI with a focus on the technical architecture and various elements of it. IoT and AI are bound to change the world in multiple ways. IoT is a perfect setup to generate a lot of data about various things and AI is data hungry to build better insights.

Slides at https://www.slideshare.net/LalitMohanChandraBha/iot-and-ai-112716904
Meetup Link: https://www.meetup.com/Pune-Developers-Community/events/252807697/

Thanks to a wonderful and engaging audience.

Wednesday, August 22, 2018

AWS IoT - Registering CA certificate

Use openSSL to generate the root key
      Generate the key:
          2048 - Encryption strength. AWS needs minimum 2048

               openssl genrsa -out rootCA.key 2048
      Generate the pem file
            Put the appropriate days for the certificate to be valid

             openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 10000 -out rootCA.pem
             This will ask a set of questions. Answer them appropriately. An example is
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields, there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:MH
Locality Name (eg, city) []:Pune
Organization Name (eg, company) [Internet Widgits Pty Ltd]: My company
Organizational Unit Name (eg, section) []: mycompany
Common Name (e.g. server FQDN or YOUR name) []:admin.mycompany
Email Address []:admin.mycompany@whatever
Now go to AWS IoT Service
Navigate to Secure -> CA
Click on Register on the right-hand side. This will open a page. Click on Register CA and follow the instructions. Make sure that in Step 3 in details for FQDN you have to put the key as mentioned in Step 2.
At Step 5 and 6 upload the required files.
Check "Activate CA certificate"
Check "Enable auto-registration of device certificates"

Monday, August 20, 2018

DynamoDB best practices for scalability

DynamoDB can be taken as a glorified hash map. It's essentially a key-value pair. This brings an important difference in terms of how to design an RDBMS schema and a DynamoDB schema. DynamoDB schema has to be approached via a query mindset. How you are going to query to the system should be basically driving the structure of your schema.

Think about queries and not about the data model and design around queries.

Sunday, March 18, 2018

Forking and maintaining a git repository

There are many public repositories which at times we want to fork and continue our path. However, at the same time, we want to keep pulling the changes from the original repository also. In this post, we will look into how to fork a repository and how to pull the changes in future.


Let's say we want to fork a repository 

Application versioning with Git and Gradle

Please follow Rest API Server to see the big picture and GitHub repo details.

Application versioning in Git is tricky compared to subversion. Subversion commits are in the increasing order of number so it's easy to put them as part of the application version. Being numbers they are easy to comprehend. However, Git commit id's are hash which would frighten any faint-hearted. A typical git commit id may look like

Sunday, March 4, 2018

Apache Tika Tutorial

Apache Tika is a powerful library to detect and extract text and metadata from thousands of file formats. This is very useful when you are more interested in the content of the file and building your logic on top of it.

Let's see a simple code in terms of how to use Tika