Architecture 3 4 Start
with
your
Application Optimize
the
database Check
your
infrastructure Add
caching
if
necessary 1 3 2 5 2016-‐04-‐13
|
Robin Müller
|@_RobM
What do
you need to check
in
your application? 5 • Algorithms • Is the algorithm efficient? • How often does my code access the database?
(SLOW!) • Am
I
using the right tools to get the job done? • Sessions
MySQL
vs.
Redis vs.
File • Search/Catalog using MySQL
vs.
Elastic • Queues
in
MySQL
table vs.
RabbitMQ 2016-‐04-‐13
|
Robin Müller
|@_RobM
Algorithm time
complexity 6 Analyze
your
algorithms Know
the
time
complexity Dev
systems
might
not
have
enough
data
to
notice
slow
algorithms
during
development 2016-‐04-‐13
|
Robin Müller
|@_RobM
Use loose coupling /
asynchronous flow 7 • Use a
message queue and consumers to handle
all
tasks which can be async • Examples • Send
emails • Sync data to other systems • Each task can be scaled individually 2016-‐04-‐13
|
Robin Müller
|@_RobM
Use the index,
Luke! 12 • Indexes • Are
the colums I
use for JOIN,
WHERE
and aggregations indexed? • Are
combined indexes performing better? 2016-‐04-‐13
|
Robin Müller
|@_RobM
Configure your database 13 • InnoDB Storage
Engine
needs configuration! • innodb_buffer_pool_size • innodb_file_per_table • innodb_buffer_pool_instances • innodb_flush_method • Use the MySQL
query cache • Also
think about how your application affects the query cache 2016-‐04-‐13
|
Robin Müller
|@_RobM
Optimize your servers 15 • Network • Bandwidth /
Performance • Packet
loss • Memory • Is there enough memory or does the system swap? • I/O • Is my application I/O
heavy? • Can
I
optimize that? • SSD
vs.
HDD 2016-‐04-‐13
|
Robin Müller
|@_RobM