When to Choose NoSQL Databases: Understanding BASE Properties and the CAP Theorem