Chapter 1 - Architecture Flashcards
Storage engine architecture
Server tasks and query processing is separated from data storage and retrieval
Architecture logical view
Connection, authentication, security
Query parsing, optimization, caching, procedures, triggers, views
Storage engine API
Threads per connection
One
Threads creation
Threads are cached, also thread pooling plugins are allowed
Authentication
Username, host, password or SSL
Query execution
Creating parse tree, then applying optimisations like rewriting query, determining table reading order, choosing indexes.
Query cache
Depends on hash comparison. Is called before pursuing the query
Locks
Read and write. Write blocks both reading and writing. Read are mutually non blocking. Write has higher priority, they can advance over read locks.
Lock performance
They have overhead. Storage engine have their own locking policies
Table lock
When writing whole table is locked. Used for alter table.
Row locks
Provides best concurrency and biggest overhead. Implemented on the level of storage engines.
ACID
Atomicity
Consistency
Isolation
Durability
Atomicity
Indivisible unit of work. All or nothing.
Consistency
Moving from one consistent state to another
Isolation
Invisible to other transactions