I have created a GitHub repository to help you learn system design weeks ago. And it received 4000+ stars on GitHub.
It gives you:
- System design interview tips
- System design fundamentals
- System Design Resource
repo - https://t.co/3Cr8WQHBVy
A: These sleeping pills are amazing. I've never been so relaxed in my life.
B: Take care, don't take them too much.
A: Oh I don't take them. I give them to my wife.
Top 5 common ways to improve API performance.
Result Pagination:
This method is used to optimize large result sets by streaming them back to the client, enhancing service responsiveness and user experience.
Asynchronous Logging:
This approach involves sending logs to a lock-free buffer and returning immediately, rather than dealing with the disk on every call. Logs are periodically flushed to the disk, significantly reducing I/O overhead.
Data Caching:
Frequently accessed data can be stored in a cache to speed up retrieval. Clients check the cache before querying the database, with data storage solutions like Redis offering faster access due to in-memory storage.
Payload Compression:
To reduce data transmission time, requests and responses can be compressed (e.g., using gzip), making the upload and download processes quicker.
Connection Pooling:
This technique involves using a pool of open connections to manage database interaction, which reduces the overhead associated with opening and closing connections each time data needs to be loaded. The pool manages the lifecycle of connections for efficient resource use.
Over to you: What other ways do you use to improve API performance?
--
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
Stack Overflow's Impressive Monolithic Architecture
Stack Overflow bucks the microservices trend, handling 1.3 billion monthly pageviews across its 200 sites using a remarkably efficient monolithic architecture with minimal infrastructure.
Web Servers:
- Uses only 9 on-prem IIS web servers
- Each server has 64GB RAM and runs highly optimized .NET code
- Handles 450 peak requests/second per server with just 12% CPU usage
- Code minimizes memory allocations to limit garbage collection
SQL Servers:
- Organized into 2 failover clusters of 2 servers each
- First cluster: 1.5TB RAM per server
- Second cluster: 768GB RAM per server
- About a third of the Q&A dataset resides in memory
- Each cluster handles over 10,000 peak queries/second at ~15% CPU
Redis:
- A single 256GB main server with a replica
- Handles 60000 peak ops/sec at 2% CPU
What lessons can be learned from how elegantly Stack Overflow scales up a monolithic application?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/kNfv0DVDdf
Apparently, if you throw a frog into a pot of boiling water it will jump out immediately, but if you put it in room-temperature water and gradually bring it to a boil, it will stay in the pot until it dies. Whether or not that's true of frogs, I see something similar happen to managers all the time. People have a strong tendency to slowly get used to unacceptable things that would shock them if they saw them with fresh eyes. #principleoftheday