Generated by ChatGPT Hint: Draw ascii picture to show the timeline of relational model, document model and network model, includes all the up and downs of their usage ____________ _________________ _____________ | Network |------>| Document Model |------>| Relational | | Model | /|\ | (1960s) | /|\ | Model | |(Dominant 60s)| | | (Dominant 60s-80s) | | |(Dominant) | |____________| | |___________________| | |___________| | | |_______ ________| | | |________| | |(Ups and downs) | _____________________ ____________ _____________________ | Object-Oriented | | Key-Value | | Document Store | | Databases | | Databases | | Databases | |(1980s-Present day) | |(Late 2000s) | | (2007-Present day) | |_____________________| |_____________| |_____________________|
Add firt_name column
if (user && user.name && !user.first_name) { // Documents written before Dec 8, 2013 don't have first_name user.first_name = user.name.split(" ")[0]; }
Generated by ChatGPT Hint: try to use ascii picture to describe how hibernate implement relation object mapping in java, take one to many relationship as an example. make parent and child relationship more apparent. Draw objects and tables in the same table +-------------------------------+ +----------------+ | Parent Object | | Parent Table | +-------------------------------+ +----------------+ | ID: 1 | | ID: 1 | | field1: "Parent field1 value"| ┌───►| field1: "..." | | . | | +----------------+ | . | | | childObjects: [Child Object] | | +----------------+ +-------------------------------+ | | Child Table | | One-to-Many | +----------------+ | | | ID: 1 | | | | ParentID: 1 | +-------------------------------+ | | field1: "..." | | Child Object | └───►+----------------+ +-------------------------------+ | ID: 1 | | ParentID: 1 | | field1: "Child field1 value" | | . | | . | +-------------------------------+
Add firt_name column
ALTER TABLE users ADD COLUMN first_name text; UPDATE users SET first_name = split_part(name, ' ', 1); -- PostgreSQL UPDATE users SET first_name = substring_index(name, ' ', 1); -- MySQL
Take Mysql Read/Write Replication Structure into account (each node is deployed with master-slave replication for HA).
Generated by ChatGPT +-------------------+ | Application | +-------------------+ | +-------+-------+ |MySQL Load Balancer| +-------+-------+ | +-------------------+-------------------+ | Read/Write MySQL Nodes | +-------------------+-------------------+ | +----------------------------------------+ | Read-Only MySQL Nodes | +----------------------------------------+ | +-----+-----+-----+-----+-----+-----+-----+-----+ |MySQL|MySQL|MySQL|MySQL|MySQL|MySQL|MySQL|MySQL| |Node |Node |Node |Node |Node |Node |Node |Node | |Read-|Read-|Read-|Read-|Read-|Read-|Read-|Read-| |Only |Only |Only |Only |Only |Only |Only |Only | +-----+-----+-----+-----+-----+-----+-----+-----+
SET sql_log_bin = 0; -- run the query here that you want to exclude from binary logging SET sql_log_bin = 1;