Get a Free System Design PDF with 158 pages by subscribing to our weekly newsletter: https://bytebytego.ck.page/subscribe
Animation tools: Adobe Illustrator and After Effects.
Checkout our bestselling System Design Interview books:
Volume 1: https://amzn.to/3Ou7gkd
Volume 2: https://amzn.to/3HqGozy
The digital version of System Design Interview books: https://bit.ly/3mlDSk9
ABOUT US:
Covering topics and trends in large-scale system design, from the authors of the best-selling System Design Interview series.
@bananesalee7086قبل 9 أشهرfor some reasons, listening to you is calming 17
@
@narasimhareddy8323قبل 9 أشهرOne quick question. Who does the video animation work for you? Kudos to the designer whoever he/she is. 24
@
@gregoirehebertقبل 9 أشهرAround the N+1 problem, I think it's worth mensionning that using HTTP Cache on the comments would reduce the amount of processing. No need to claim id="hidden2" class="buttons"> them all at once. The pagination approach is still valid ! A simple IRI toward the collection of comments is also valid. But you still need to request them at some point, even if this is to the cache reverse proxy. To avoid waiting your frontend to parse the payload then query the comments, the use of 103 EarlyHint can eliminate that waiting time. Using HTTP/2 as it is using binary frames, multiplexing and solves HOL blocking. Using HTTP/3 as it speed up establishing the connecion API. Formats like protobuff also reduces the size of the payload. To circumvent pipelining problems using HTTP/1.1, sometimes batch HTTP request can be a solution (prefer standard specification) But please stay stateless as much as possible. Of course the infamous domain sharding ....وسعت11
@
@asadbekfayzullaevقبل 9 أشهرThank you! I love watching ByteByteGo system design videos! 5
@
@kns6132قبل 9 أشهرSuperbly explained and very valid tips ❤ 12
@
@guhkunpatata3150قبل 8 أشهرthe animation + explanation is GREAT! thanks for sharing!
@
@harshdevsingh6506قبل 8 أشهر1. Tunning database tables like purging old data which is not needed can minimize the performance of select queries on tables. 2.Putting the index id="hidden3" class="buttons"> on the column of the table also helps the same. 3.Adding load balance also helps to improve the performance. 4.payload compression also can be helpful to fetch large size data like image/videos. ....وسعت5
@
@Ajdin87قبل 9 أشهرI think it is worth mentioning that if you decide to use caching, Redis, and you are using, for example AWS, it will be additional cost. Caching is done id="hidden4" class="buttons"> in memory, and oh boy do they love to make you pay for everything. Great video btw. ....وسعت19
@anthonysallsقبل 9 أشهرAn architecture I work with involves a secondary copy mirror, and I once “crashed” the mirror by supplying too many writes to primary that were handled effortlessly at source but the synchronous writes to the secondary DB backed up as a result of its lower tier hardware and all applications that ran on the secondary (non time critical systems like operational reporting that can usually wait the .8 seconds to run while secondary catches up to the point the job originated from primary) stalled for hours and refused all new jobs and queued all writes in that period. Switching to asynchronous log writing dramatically improved the performance and the secondary system could handle the load fed from primary again, but there was half a day of 40,000 users who were not happy that their reports when from taking half a minute to run to half a day. Additionally HA and data loss was risked as the secondary system was the same-data center backup of primary (there was another primary off site with similar hardware that kept pace but would have taken longer to fail over to). The lesson is, if production is reliant on secondary systems it communicates with, and you’re going to be running production hot for hours, you must have secondary systems attached to your test suite! We’d 4 dozen attached but missed the mirror that was instrumental for reporting ....وسعت4
@
@makhaerقبل 9 أشهر@ByteByteGo could you tell which tool you use to draw these animated diagrams ? 2
@
@nmmm2000قبل 9 أشهر2 cents from me too: - Use HTTP keep alive or HTTP2 - if you do separate HTTP call for each API call, speed will be slow. if you do HTTP keep alive, id="hidden7" class="buttons"> speedup is considerable - this technique often used in SMS industry. - Optimize SQL queries :) - Optimize SQL queries :) :) - Optimize SQL queries :) :) :) - Database replication ....وسعت36
@
@MichaelKubler-kublermdkقبل 9 أشهرSomething we recently did was use Amazon SQS to push after save and after update tasks to a background processing server. This allows things like id="hidden8" class="buttons"> thumbnail generation or OCR processing of files, complex Multi-document (updating one entry will cause fields on multiple other entries to be updated in different ways) and things like updating the Lucene search system, or generating notifications or user activities event stream, all can be done on the backend server moments later instead of during the API call. Of course we are using PHP not something like NodeJS where processing after an API response is much easier. ....وسعت3
@
@thanhnx-vnitقبل 9 أشهر@ByteByteGo Video is great. Thank you so much! Btw, could you tell me the software to create presentation slides like in the video? 2
@
@leomyskyقبل 9 أشهرWonderful Thank you for the video
@
@ravipvkiranpvقبل 9 أشهرAdd Streaming to the list.. Great video..
@
@jacob_90sقبل 7 أشهرOne issue to look out for with pagination when using TOP/MAX and OFFSET are changes that occur between page request and how they affect the order of the id="hidden9" class="buttons"> data. I've worked with several API's where a record on page 1 would be changed after I had already accessed that page, and it changes the order of all the results, so when I would grab the next page, the results would be shifted over and I would miss some of them. ....وسعت6
@
@arfinexe539قبل 9 أشهرGreat video, but that car transition caught me off guard 3
@
@khari_baatقبل 9 أشهرWhich efficient JSON serializer are we talking about? Can you please suggest some? 1
@
@pauljohnsonbringbackdislik1469قبل 7 أشهرSince browsers limit active parallel downloads, there are some cases when batching requests may shave 2-5s from the overall page load (e.g. on pages that id="hidden10" class="buttons"> tend to load multiple data to compose a report or a summary). I wish @ByteByteGo could make a follow-up video with "Top 7 ways to optimize performance suggested by community" :) ....وسعت
@
@leetcode7857قبل 9 أشهرOther techniques: 1. Tuning the database connection pool size based on the application behaviour. (Large number doesn't always mean more performance) id="hidden11" class="buttons"> 2. Optimizing the SQL query. (Ensuring your most frequent queries end up using index scan instead of full table scan) 3. Not hopping between multiple microservices for a single user request. (While a single user request can hit multiple services but those services should not in turn hit another set of services and so on). 4. Authorization data should be always cached. 5. As much as possible, do the most computation on the database layer. There's a huge difference between doing the computation at application layer vs doing it at database layer. ....وسعت260
@nagsworldقبل 8 أشهرyour video's looks greate, mainly presntation along with content. What tool you are using for animations?
@
@orisueXtriumvirقبل 7 أشهرWhat techniques can we use for an endpoint that handles file download requests where the data content can change for each request?
@
@TariqSajidقبل 9 أشهرHidden thing about pagnation is be very careful of the total count query that might be taking too much time if you do on every pagination request and you have large dataset 6
@
@LNSFLIVEقبل 5 أشهرwhat you using to make your visualizations? animations are great
@
@danregep4646قبل 9 أشهرwhat about avoiding memcopy and serialization by using an optimized data-serialization format? (TRIFT PBufers etc)
@
@SalvadorFariaقبل 9 أشهرOther optimization techniques: Partial Responses and Field Masks - Request specific data fields, reduces processing load, and improves efficiency in API interactions. 13
@
@efnobregaقبل 2 أشهرHiThere! Please, let me know what tool do you use to create the videos graphics / animations. Ths!
@
@CarlosGonzalez-rg6htقبل 9 أشهرI think data partitioningnin line to the querying to be performed could be a usefull method to improve performance.
@
@hemantpanchal8087قبل 9 أشهرCan someone please help me in below scenario. Eg. My program has more than 1.5 lakh employees records in database and this data won't get id="hidden14" class="buttons"> change so frequently. So is it good idea to publish json of individual employee on azure blob/s3 and than from Api we can read from Here and display in front-end. I would like to know whether it will impact read performance for 1.5 lakh json on azure blob. ....وسعت
@
@Ashirgaziyevقبل 4 أشهرHey guys, I know this might be a silly question; however, what would be the great learning material for a newbie backend developer? I am considering id="hidden15" class="buttons"> to switch from mobile development to backend development asap. Thanks a lot! ....وسعت
@
@iSerjioLقبل 4 أشهرI would point out the 3rd technique "Avoid N+1 Problem" into a separate section - Database Query Optimisation, including proper indexes, query id="hidden16" class="buttons"> optimisation, usage of memory-optimised tables, cluster configuration (DB setup, e.g. using SSD, temp db size, transaction isolation level) etc. ....وسعت
@
@JIANGNIANHANGقبل 8 أشهرI have 2 doubt/question: 5. JSON Serialization which json library should been used? Does json libraries has really large difference id="hidden17" class="buttons"> in performance? 7. Asynchronous logging Dose logging method can improve API performance? ....وسعت1
@
@infomaniac50قبل 9 أشهرWhen doing compression on API responses, make sure you're not exposing yourself to a CRIME attack. CVE-2012-4929 65
@
@Mo-bs7ctقبل 9 أشهرYou may need indexing to speed up queries 3
@
@BhaveshAgarwalقبل 8 أشهرByteByteGo - please share the tools and softwares you use to create these wonderful videos. It will be extremely helpful to learn them and use it for work and share knowledge in general. Thanks in advance!
@
@Achrafsoukقبل 9 أشهرCDNs like CloudFront also can help with connection pooling. 2
@
@vighnesh153قبل 9 أشهرYou could also consider replacing JSON with protobufs. They are super optimized for data transfer between systems. 24
@
@TomDoesTechقبل 9 أشهرAnyone know how he makes these animations? 1
@
@diegofelipe91قبل 6 أشهرIn MongoDB it's not good to use skip and limit approach to pagination, specially when you're paginating over a huge number of documents, it's more suitable to have a find and limit approach instead.
@
@andrewwhitehouse1878قبل 9 أشهرThis is gold. Your whole channel is gold and the production values are amazing ❤ 1
@
@user-xe9on9yr7cقبل 8 أشهرWhat about binary optimization and grpc?
@
@user-ns2fz1tl9sقبل 9 أشهرPagination could be very difficult and confusion on some databases. For example Postgres have to read all previous pages, to read 101 page. So on really big datasets just limit\offset leads only to problems.
@
@sarakhushi23قبل 6 أشهر1- Caching , Store result comoutation so that can be used later in Redis.. 2- Connection Pool- 3- Avoid N+1 Query problem 4- Pagination id="hidden21" class="buttons"> 5- Lightweight JSON Serialization.. 6- Compression.. 7- Asynchronous logging.. ....وسعت
@
@aravind.aقبل 9 أشهرHi Team, can you please explain serialization in detail? Does it mean - instead of sending the json / xml it is better to send as string ?
@
@andrasczinegeقبل 9 أشهرThanks for the awesome video. I use Azure Functions that often read and write from/to a database, and I am just wondering what if I create a connection id="hidden22" class="buttons"> pool in sqlalchemy and bind it to an engine on the startup of a python azure function. Every time a function is called, azure function starts a new threard to handle the request, and those theads could use that connection pool, which is said to be threadsafe. This way I could reuse connections even though I am running serverless python azure functions. Is it not possible? @ByteByteGo ....وسعت
@
@rajatmathurقبل 9 أشهرCan you share some fast JSON serialization libraries for Java?
@
@_sk_videosقبل 8 أشهرAny suggestions on how to improve an API that returns a large amount of data, 10-200MB?
@
@olhoTronقبل 2 أشهرIts worth stressing: ALWAYS measure, before, during and after an optimization, and check if the performance really improved and the results remained the id="hidden23" class="buttons"> same. Gut feelings don't work when optimizing software Also think of the system as a whole, sometimes what shows up at the top on the profiler is the symptom and not the cause of the problem ....وسعت1
@
@myrondaiقبل 7 أشهرUse uncrowded resources for crowded resources: computing for memory/bandwidth (compression), memory for computing (Cache); reuse objects; id="hidden24" class="buttons"> />Avoid unnecessary calculations; Question: Why do people want to do pagination? "User interface has limited place to display data, so we only fetch what we needed. " is one explanation. Anything else? ....وسعت
@
@ColossalMcBuzzقبل 6 أشهرTip #8: Ensure you're using the right data structures and/or algorithms for the endpoints.
@
@114dev8قبل 8 أشهرHey guys, I was wondering if anyone can propose some good database architectures that can help to improve.
@
@TheOnlyEpsilonAlphaقبل 4 أشهرOther Techniques: 1. Key Pool for Oauth Operations: - When you want to reduce the waste of individual overhead, that comes from the whole id="hidden25" class="buttons"> process of ongoing re-rolling API Keys, make a dedicated component for that to have a pool available of valid API Keys or Tokens, so the components which need to work with the API don't have to go through the whole API Key managing process and just do their stuff. - By letting a dedicated component manage those pool for you, keep an eye that are always enough valid entries available. Based on the need the component can request a bigger amount of keys - The Life-cycle of that keys and be easily managed by storing them in a redis database with EXPIRE set, so it will get deleted when it's expired also in the according API. ....وسعت
@
@Rscnry99قبل 9 أشهر@bytebytego what app do you use for your animations?
@
@phoenicianathletix2866قبل 9 أشهرCan Payload Compression be used while using Web sockets? 1
@
@robl39قبل 9 أشهرFun fact: doing pagination killed performance at the database level for my product. We were using offset fetch in sql server and we quickly going out that id="hidden26" class="buttons"> once a given table reaches a certain size it slows way down. To solve this we introduced a “bookmark” methodology that doesn’t need to perform a table scan ....وسعت1
@
@zakrawقبل 9 أشهرSurprised you didn't mention Eager vs Lazy Loading, Database indexing, Breaking excessive SQL queries with multi-level subqueries into smaller ones. 3
@
@santosh_bhatقبل 3 أشهرSomeone please tell me how to make such animations?
@
@jwbonnettقبل 9 أشهرJSON is the old defacto, Protobuff is the new one.
@
@LCTeslaقبل 7 أشهر kinda kills the idea for me. that's when logs are most important
@
@globalcitizen123-hl3dvقبل 9 أشهرwait I had no idea you wrote the system design books hahaha damn, I'm stupid. I'm a technical program manager that works with Platform/Infra teams id="hidden28" class="buttons"> (but don't really have a background in either lol) so I used these books as reference. very useful. ....وسعت
@jon9103قبل 3 أشهرPaging is often poorly implemented in practice because the ordering of items does not stay consistent between page loads leading to some items being missed and others duplicated and a jarring UX.
@
@rollinOnCodeقبل 9 أشهرthe n+1 query can be huge and tends to happen when you got scope creep.
@
@Nephtys1قبل 9 أشهرThis is missing the number 0 of optimization: deleting your api / get rid of it entirely. Nothing is faster or cheaper than no code. Contrary to id="hidden30" class="buttons"> popular belief, this is most of the times the first and best optimization. Last year I optimized a specific 'Microservice' away by moving its 'logic' (nearly nothing really useful) to the client. Decreased latency of the whole feature by 80%, and decreased total LOC. Always try to localize operations or data if your goal is speed and efficiency. ....وسعت
@
@amanccaقبل 9 أشهرImage compression is one of my favorite one. My API can reduce image from 5MB to 10kb 3
@
@VadimFilinقبل 9 أشهرdo not use offset! use cursor pattern instead 4
Related videos for Top 7 Ways to 10x Your API Performance:
2. Connection Pool
3. Avoid N+1 Query pattern
4. Pagination
5. JSON Serialization
6. Compression
7. Asynchronous logging ....وسعت 74
Who does the video animation work for you? Kudos to the designer whoever he/she is. 24
But you still need to request them at some point, even if this is to the cache reverse proxy.
To avoid waiting your frontend to parse the payload then query the comments, the use of 103 EarlyHint can eliminate that waiting time.
Using HTTP/2 as it is using binary frames, multiplexing and solves HOL blocking.
Using HTTP/3 as it speed up establishing the connecion API.
Formats like protobuff also reduces the size of the payload.
To circumvent pipelining problems using HTTP/1.1, sometimes batch HTTP request can be a solution (prefer standard specification) But please stay stateless as much as possible.
Of course the infamous domain sharding ....وسعت 11
2.Putting the index id="hidden3" class="buttons"> on the column of the table also helps the same.
3.Adding load balance also helps to improve the performance.
4.payload compression also can be helpful to fetch large size data like image/videos. ....وسعت 5
Great video btw. ....وسعت 19
1. Caching
2. Connection pool
3. Avoidn5" class="buttons"> N+1 Query Problem
4. Pagination
5. JSON Serializers
6. Payload Compression
7. Asynchronous logging ....وسعت 46
Switching to asynchronous log writing dramatically improved the performance and the secondary system could handle the load fed from primary again, but there was half a day of 40,000 users who were not happy that their reports when from taking half a minute to run to half a day. Additionally HA and data loss was risked as the secondary system was the same-data center backup of primary (there was another primary off site with similar hardware that kept pace but would have taken longer to fail over to).
The lesson is, if production is reliant on secondary systems it communicates with, and you’re going to be running production hot for hours, you must have secondary systems attached to your test suite! We’d 4 dozen attached but missed the mirror that was instrumental for reporting ....وسعت 4
- Use HTTP keep alive or HTTP2 - if you do separate HTTP call for each API call, speed will be slow. if you do HTTP keep alive, id="hidden7" class="buttons"> speedup is considerable - this technique often used in SMS industry.
- Optimize SQL queries :)
- Optimize SQL queries :) :)
- Optimize SQL queries :) :) :)
- Database replication ....وسعت 36
This allows things like id="hidden8" class="buttons"> thumbnail generation or OCR processing of files, complex Multi-document (updating one entry will cause fields on multiple other entries to be updated in different ways) and things like updating the Lucene search system, or generating notifications or user activities event stream, all can be done on the backend server moments later instead of during the API call.
Of course we are using PHP not something like NodeJS where processing after an API response is much easier. ....وسعت 3
Video is great. Thank you so much!
Btw, could you tell me the software to create presentation slides like in the video? 2
Thank you for the video
I wish @ByteByteGo could make a follow-up video with "Top 7 ways to optimize performance suggested by community" :) ....وسعت
1. Tuning the database connection pool size based on the application behaviour. (Large number doesn't always mean more performance) id="hidden11" class="buttons">
2. Optimizing the SQL query. (Ensuring your most frequent queries end up using index scan instead of full table scan)
3. Not hopping between multiple microservices for a single user request. (While a single user request can hit multiple services but those services should not in turn hit another set of services and so on).
4. Authorization data should be always cached.
5. As much as possible, do the most computation on the database layer. There's a huge difference between doing the computation at application layer vs doing it at database layer. ....وسعت 260
REST -> GraphQL 2
Eg. My program has more than 1.5 lakh employees records in database and this data won't get id="hidden14" class="buttons"> change so frequently.
So is it good idea to publish json of individual employee on azure blob/s3 and than from Api we can read from Here and display in front-end.
I would like to know whether it will impact read performance for 1.5 lakh json on azure blob. ....وسعت
I am considering id="hidden15" class="buttons"> to switch from mobile development to backend development asap. Thanks a lot! ....وسعت
5. JSON Serialization
which json library should been used?
Does json libraries has really large difference id="hidden17" class="buttons"> in performance?
7. Asynchronous logging
Dose logging method can improve API performance? ....وسعت 1
2- Connection Pool-
3- Avoid N+1 Query problem
4- Pagination id="hidden21" class="buttons">
5- Lightweight JSON Serialization..
6- Compression..
7- Asynchronous logging.. ....وسعت
Does it mean - instead of sending the json / xml it is better to send as string ?
Also think of the system as a whole, sometimes what shows up at the top on the profiler is the symptom and not the cause of the problem ....وسعت 1
reuse objects;
id="hidden24" class="buttons"> />Avoid unnecessary calculations;
Question: Why do people want to do pagination? "User interface has limited place to display data, so we only fetch what we needed. " is one explanation. Anything else? ....وسعت
1. Key Pool for Oauth Operations:
- When you want to reduce the waste of individual overhead, that comes from the whole id="hidden25" class="buttons"> process of ongoing re-rolling API Keys, make a dedicated component for that to have a pool available of valid API Keys or Tokens, so the components which need to work with the API don't have to go through the whole API Key managing process and just do their stuff.
- By letting a dedicated component manage those pool for you, keep an eye that are always enough valid entries available. Based on the need the component can request a bigger amount of keys
- The Life-cycle of that keys and be easily managed by storing them in a redis database with EXPIRE set, so it will get deleted when it's expired also in the according API. ....وسعت
Contrary to id="hidden30" class="buttons"> popular belief, this is most of the times the first and best optimization.
Last year I optimized a specific 'Microservice' away by moving its 'logic' (nearly nothing really useful) to the client. Decreased latency of the whole feature by 80%, and decreased total LOC.
Always try to localize operations or data if your goal is speed and efficiency. ....وسعت