lots of applications have reports and dashboards. Often comes a point when these slow down:
- huge tables with millions of records
- complicated queries
- slow reports
materialized views offer a simple way to solve some of those problems.
🧵keep reading
1/ Lots of applications have some kind of report or dashboard feature. Often comes a point when these slow down.
The best solution to these problems is probably setting up a specialized database (like ClickHouse or Redis) that serves the reports and dashboard.
2/ In a lot of cases, having a dedicated reports DB is not a viable option.
Fortunately, there's an easier solution. We can add special tables to a MySQL (or Postgres, or SQLite) database that serves one specific report pretty fast.
🔥 Here are some of the most basic monitoring techniques you can start using immediately:
- Spatie laravel-health
- Error tracking
- Syntethic checks
It takes ~30 minutes to set up these.
🧵 Keep Reading
Health checks with laravel-health
The package can check:
- CPU load
- Disk space utilization
- Database connectivity
- Redis
- And even query speed
The example contains pre-built checks. For instance, it notifies you if the average CPU load is higher than 2.5 in the last 5 minutes or 2 in the previous 15 minutes.
It also notifies you if the used disk space is more than 70%
The single best package to handle Excel exports and imports:
- Exporting collections
- Storing files
- Exporting from a query
- Queue jobs
- And more
2/ laravel-health
This amazing Spatie package can monitor the health of your application and server. It sends you notifications if something's wrong. For example:
- CPU load
- Used disk space
- Database connections
- Redis
- and more
Redis is way more than just a cache system - it's a powerful distributed key-value in-memory database with rich features. Let me break down why Redis is awesome and what you can actually build with it.
Keep Reading🧵
2/12 Redis stores everything in memory, making it blazing fast compared to traditional databases like MySQL that need disk reads.
But don't worry - Redis still persists your data using AOL and RDB, so you won't lose anything if you restart.
3/12 Redis Lists are perfect for building queues, stacks, and temporary storage.
You can implement job queues, undo/redo functionality, recent activity feeds, and data buffers. Think Spotify's "Add to Queue" or Amazon's "Recently Viewed Items"