L75
db security: role-based access control (rbac)
rbac stops permission micro-management.
flow: permissions (read) ➔ roles (admin) ➔ users.
why?
• scale: update 1 role to update all users in it.
• security: enforces least privilege.
#DBMS#SQL#Databases
L74
db scaling:
• vertical (scale up): add cpu/ram to 1 instance. simple, but hits hardware limits & creates a spof.
• horizontal (scale out): add servers via replication (master=writes, slave=reads) or sharding (split data across dbs).
#DBMS#SQL#Databases
L74
db scaling:
• vertical (scale up): add cpu/ram to 1 instance. simple, but hits hardware limits & creates a spof.
• horizontal (scale out): add servers via replication (master=writes, slave=reads) or sharding (split data across dbs).
#DBMS#SQL#Databases
L73
b-tree vs b+ tree:
• storage: b-tree stores data in all nodes. b+ only in leaves.
• links: b+ leaves form a linked list.
• queries: b+ optimized for range scans.
• fanout: b+ routing nodes hold only keys, minimizing i/o.
#DBMS#SQL#Databases
L73
b-tree vs b+ tree:
• storage: b-tree stores data in all nodes. b+ only in leaves.
• links: b+ leaves form a linked list.
• queries: b+ optimized for range scans.
• fanout: b+ routing nodes hold only keys, minimizing i/o.
#DBMS#SQL#Databases
L72 (2)
b-tree insertion: a bottom-up process guaranteeing strict balance.
1. traverse to correct leaf.
2. insert key in sorted order.
3. if keys > max (m-1), split the node in half.
4. promote median key to parent.
root splits increase tree height.
#DBMS#SQL#Databases
L72 (2)
b-tree insertion: a bottom-up process guaranteeing strict balance.
1. traverse to correct leaf.
2. insert key in sorted order.
3. if keys > max (m-1), split the node in half.
4. promote median key to parent.
root splits increase tree height.
#DBMS#SQL#Databases