Key Technology
Core database
[!danger]
Many candidate trip themselves by trying to compare between NoSQL or SQL, i.e I need relational database because there are relationships or I use NoSQL because i need scale and performance are often flagged as inexprience
Instead focus more about what the database bring to you, focus on the feature you're familiar with i.e: I'm using postgres here because ACID allow me maintain data integrity
There are 2 types
- Relational database: Use for transaction data, default choice for product design interview
- The interview where we desgin a product (shop or something) not design the consistent hashing one
- NoSQL database: Use when these condition happen
- Flexible data models without fixed schema
- Application needs to scale horizontally across many servers to accomodate large amount of data or high load
- Your application dealing with large volumes of data, unstructured data, applications require real-time data processing and analytics
For NoSQL, the two flexible options are:
- DynamoDB: breadth of feature
- Cassandra: Good choice for write-heavy workload
[!NOTE]
The thing NoSQL can do does not mean SQL cannot do it. For example Postgres can do JSON columns with flexible schema, SQL can also scale horizontally
Blob storage
Normally for blob storage, our core database will store a pointer to the blob storage references. The blob storage has the following attribute
- Durability: uses Erasure Coding
- Scalability: AWS S3 can be considered as inidifinitely scale, you dont need to care about scalability here
- Security: built-in security like encryption at rest, access control features
- Upload & download directly at client: use presigned URL to do so
- Chunking: when upload large files, we can enable chunking which allow to resume upload