By James Harvey
Early-stage startup problems
- Finding customers
- Rapid feature development
- Iterating to find product-market fit
- Fixing bugs and bad product decisions
Scaling startup problems
- All that stuff from before
- Heaps of customers
- A bunch of really big customers
- Even bigger customers coming down the pipeline
- Your database servers go to 100% CPU randomly
- You start getting weird errors from the database
You will make mistakes in your database design
You will think you know how MySQL will behave at scale and you will be wrong
It is a good thing when you start hitting scaling issues in your app because it means people are actually using it!
Making maximum use of each MySQL node
Adding more MySQL nodes
Column | Bytes | Signed | Unsigned |
---|---|---|---|
TINYINT | 1 | -128 to 128 | 0 to 256 |
SMALLINT | 2 | -32,768 to 32,767 | 0 to 65,535 |
MEDIUMINT | 3 | -8,388,608 to 8,388,607 | 0 to 16,777,215 |
INT | 4 | -2,147,483,648 to 2,147,483,647 | 0 to 4,294,967,295 |
BIGINT | 8 | REALLY BIG | REALLY BIG |
TODO
TODO
TODO
TODO
Field | Meaning |
---|---|
type | Worst to best - ALL, index, range, ref, eq_ref, const, system |
possible keys | The keys that could be used |
key | The key that was used |
rows | Number of rows that had to scanned |
extra | More info |
Atomicity - A single logical unit of work
Consistency - DB moves from one consistent state to the next
Isolation - The results of a transaction are usually invisible to other transactions until the transaction is complete
Durability - Once committed, a transaction’s changes are permanent