Back-of-the-envelope EstimationSystem Design
QPS, storage மற்றும் bandwidth க்கான விரைவான order-of-magnitude கணக்கு — boxes வரைவதற்கு முன்பே டிசைன்களை ஏற்கிறது அல்லது நிராகரிக்கிறது.
System Design அடித்தளங்கள் →Algorithms, system design, distributed systems மற்றும் AI இன் 59 சொற்கள் — ஒவ்வொன்றும் அதைக் கற்பிக்கும் பாடநெறியுடன் இணைக்கப்பட்டுள்ளது.
QPS, storage மற்றும் bandwidth க்கான விரைவான order-of-magnitude கணக்கு — boxes வரைவதற்கு முன்பே டிசைன்களை ஏற்கிறது அல்லது நிராகரிக்கிறது.
System Design அடித்தளங்கள் →தேர்வுகள் மீதான depth-first search, வேட்பாளரைப் படிப்படியாகக் கட்டி, ஒவ்வொரு படியையும் ஆராய்ந்த பின் undo செய்கிறது.
Recursion & Backtracking →Array இல் தேடுவதற்குப் பதிலாகச் சாத்தியமான விடைகள் (capacity, speed, days) மீது monotone feasibility check மூலம் binary search.
Binary Search →பல requests ஒரே நேரத்தில் cache miss ஆகி (பெரும்பாலும் expiry க்குப் பின்) backing store ஐ அதிகச் சுமையாக்குகின்றன; locking, request coalescing அல்லது முன்கூட்டிய refresh மூலம் தடுப்பு.
Real-time & Streaming →Application முதலில் cache இலிருந்து படிக்கிறது, miss ஆனால் database இலிருந்து ஏற்றித் தானே cache ஐ நிரப்புகிறது.
System Design அடித்தளங்கள் →Network partition போது distributed system consistency, availability இரண்டில் ஒன்றைத் தேர்ந்தெடுக்க வேண்டும்.
Replication & Consistency Models →Content Delivery Network: புவியியல் ரீதியாகப் பரவிய caches, static மற்றும் cache செய்யக்கூடிய content ஐ users அருகிலிருந்து வழங்குகின்றன.
System Design அடித்தளங்கள் →Error வரம்பைத் தாண்டிய பின் தோல்வியடையும் dependency ஐ அழைப்பதை நிறுத்தி, விரைவாக fail ஆகி, மீளும் வரை அவ்வப்போது சோதிக்கிறது.
Fault Tolerance & Graceful Degradation →Keys மற்றும் nodes ஐ ஒரு ring மீது வைத்தல், node சேர்க்கும்போதோ நீக்கும்போதோ அதன் அருகிலுள்ள keys மட்டுமே நகரும்படி.
Partitioning & Sharding →ஒரு request இல் model கவனம் செலுத்தக்கூடிய அதிகபட்ச tokens எண்ணிக்கை, prompt மற்றும் அதன் சொந்த output உட்பட.
LLM அடித்தளங்கள் →Conflict-free Replicated Data Type: ஒரே நேர updates coordination இல்லாமல் எப்போதும் உறுதியாக merge ஆகும் structure.
Replication & Consistency Models →திரும்பத் திரும்ப processing இல் தோல்வியடையும் messages ஐச் சேகரிக்கும் queue, முக்கிய ஓட்டத்தைத் தடுக்காமல் அவற்றை ஆய்வு செய்ய.
System Design அடித்தளங்கள் →Non-negative weights கொண்ட graphs இல் single-source shortest paths, priority queue மூலம் மிக அருகிலுள்ள unvisited node ஐ விரிவாக்குகிறது.
Graph →ஒவ்வொரு transaction உம் accounts முழுவதும் சம debits மற்றும் credits பதிவு செய்கிறது, எனவே balances எப்போதும் பொருந்துகின்றன — payment systems இன் அடிப்படை.
பணம் & Ledgers →உரை (அல்லது images) இன் dense vector வடிவம், இதில் பொருள் ஒற்றுமை வடிவியல் நெருக்கமாக மாறுகிறது.
Retrieval-Augmented Generation (RAG) →Writes நின்றால் அனைத்து replicas உம் இறுதியில் ஒரே value க்கு வருகின்றன; இடைப்பட்ட reads பழையவையாக இருக்கலாம்.
Replication & Consistency Models →Greedy algorithms க்கான proof முறை: எந்த optimal தீர்வின் தேர்வையும் greedy தேர்வால் மாற்றுவது அதை ஒருபோதும் மோசமாக்காது எனக் காட்டுவது.
Greedy →ஒவ்வொரு புதிய post ஐயும் write நேரத்திலேயே ஒவ்வொரு follower இன் முன்கணக்கிட்ட feed இல் தள்ளுதல்; reads வேகம், ஆனால் பெரும் following கொண்ட accounts க்குச் செலவு மிக்கது.
Real-time Fan-out & Push →வெவ்வேறு வேகத்தில் நகரும் இரண்டு pointers — cycles ஐக் கண்டறிய (Floyd's algorithm) மற்றும் linked list இன் நடுவைக் கண்டறியப் பயன்படுகின்றன.
Linked List →Lock அல்லது lease உடன் வழங்கப்படும் தொடர்ந்து அதிகரிக்கும் எண், lease முடிந்த holder இன் writes ஐ storage நிராகரிக்க.
Locks & Coordination →அறிவிக்கப்பட்ட tool க்காக model structured arguments தருதல், applications இயல்பு மொழியிலிருந்து உண்மையான செயல்களைச் செய்ய.
Prompt Engineering & Structured Output →Latitude/longitude ஐ string ஆக encode செய்தல், இதில் பகிர்ந்த prefix என்றால் அருகிலுள்ள cells — locations ஐ index, query செய்யும் எளிய வழி.
Location & Mobility →Hierarchical Navigable Small World graph: வேகமான approximate nearest-neighbour vector search க்கு மிகப் பொதுவான index.
Storage Engines & Indexing →Request இன் முடிவுடன் சேமிக்கப்படும் client-உருவாக்கிய தனித்துவ key, retries side effects ஐ மீண்டும் செய்யாமல் அசல் முடிவையே தர.
Idempotency & Exactly-once →Linear-time maximum subarray sum: ஒவ்வொரு index இலும் முந்தைய subarray ஐ நீட்டுங்கள் அல்லது புதிதாகத் தொடங்குங்கள்.
Dynamic Programming →ஏற்கனவே process ஆன tokens இன் attention keys மற்றும் values சேமிப்பு, generation ஒவ்வொரு படியிலும் முழு prefix ஐ மீண்டும் கணக்கிடாமல் இருக்க.
LLM Serving, செலவு & Performance →ஒவ்வொரு event இலும் அதிகரித்து, message பெறும்போது merge ஆகும் logical counter — causality க்கு ஒத்த வரிசையைத் தருகிறது.
Time, Clocks & Ordering →மிக வலுவான single-object consistency: ஒவ்வொரு operation உம் அதன் தொடக்கம், முடிவு இடையே ஒரு புள்ளியில் atomically நிகழ்ந்ததுபோல் தோன்றுகிறது.
Replication & Consistency Models →Rubric உடன் ஒரு model ஐப் பயன்படுத்தி மற்றொரு model இன் outputs ஐப் பெரிய அளவில் மதிப்பிடுதல்; human labels உடன் calibrate செய்யப்படுகிறது.
Evaluation & Guardrails →Log-Structured Merge tree: writes ஐ memory இல் buffer செய்து, sorted files ஐ flush செய்து compact செய்கிறது — அதிக write loads க்கு உகந்தது.
Storage Engines & Indexing →Model Context Protocol: பொதுவான interface மூலம் AI applications க்கு tools, resources மற்றும் prompts வழங்கும் திறந்த தரநிலை.
Agents & Tool Use →Recursive call இன் முடிவை அதன் arguments அடிப்படையில் cache செய்தல், எனவே overlapping subproblems ஒருமுறை மட்டுமே கணக்கிடப்படுகின்றன — top-down dynamic programming.
Dynamic Programming →ஏறு அல்லது இறங்கு வரிசையில் வைக்கப்பட்ட stack; ஒவ்வொரு pop உம் ஒரு 'next greater / smaller element' கேள்வியை amortised O(1) இல் தீர்க்கிறது.
Stack & Queue →Lead agent வேலையைப் பிரித்து, துணை வேலைகளை workers இடம் ஒப்படைத்து, அவர்களின் முடிவுகளை ஒருங்கிணைக்கும் multi-agent பேட்டர்ன்.
Agentic AI Systems & Orchestration →CAP இன் நீட்சி: Partition எனில் Availability அல்லது Consistency ஐத் தேர்ந்தெடுங்கள்; இல்லையெனில் (Else) Latency அல்லது Consistency.
Replication & Consistency Models →ஒரு running total, இதில் prefix[i] முதல் i elements இன் கூட்டுத்தொகையை வைத்திருக்கிறது, எனவே எந்த range இன் கூட்டுத்தொகையும் prefix[r] − prefix[l] ஆக O(1) இல் கிடைக்கும்.
Array →AI சிஸ்டத்தின் அறிவுறுத்தல்களை மீற முயலும் நம்பகமற்ற input — tools கொண்ட agents க்கு முக்கிய security கவலை.
AI System Design →2D space ஐ மீண்டும் மீண்டும் நான்கு பகுதிகளாகப் பிரிக்கும் tree, proximity search க்காகப் points அடர்த்திக்கேற்ப cell அளவை மாற்றுகிறது.
Location & Mobility →Model weights ஐக் குறைந்த bits இல் (8-bit, 4-bit) குறிப்பிடுதல், சிறிய துல்லிய இழப்புடன் memory, செலவைக் குறைக்க.
LLM Serving, செலவு & Performance →ஒரு read அல்லது write ஐ ஏற்க வேண்டிய குறைந்தபட்ச replicas எண்ணிக்கை; W + R > N எனில் reads சமீபத்திய write ஐப் பார்க்கின்றன.
Replication & Consistency Models →புரிந்துகொள்ள எளிதான consensus algorithm — leader election, log replication மற்றும் safety விதிகளால் ஆனது; etcd, Consul இல் பயன்படுகிறது.
Consensus & Leader Election →Retrieval-Augmented Generation: query நேரத்தில் தொடர்புடைய documents ஐ மீட்டு model க்குக் கொடுத்தல், விடைகள் ஆதாரத்துடன், citable ஆக இருக்க.
Retrieval-Augmented Generation (RAG) →Generation க்கு முன் முதன்மை retrieved passages இன் வரிசையை மாற்றும் இரண்டாவது, அதிகத் துல்லியமான model (பெரும்பாலும் cross-encoder).
Retrieval-Augmented Generation (RAG) →வேலை முடியும் வரை reasoning steps ஐ actions (tool calls) மற்றும் observations உடன் மாறி மாறி இயக்கும் agent பேட்டர்ன்.
Agents & Tool Use →Local steps ஆகப் பிரிக்கப்பட்ட நீண்ட transaction, பின்வரும் step தோல்வியடைந்தால் undo செய்ய ஒவ்வொரு step க்கும் ஒரு compensating action.
Distributed Transactions →ஒரு invariant ஐக் காத்தபடி வலதுபுறம் வளர்ந்து இடதுபுறம் சுருங்கும் தொடர் range — subarray விடைகளை linear time இல் தருகிறது.
Sliding Window →Next-token distribution ஐக் கூர்மையாக (குறைவு) அல்லது சமமாக (அதிகம்) ஆக்கும் sampling parameter — determinism க்குப் பதிலாகப் பன்முகத்தன்மை.
LLM அடித்தளங்கள் →Request இலிருந்து முதல் streamed token வரையிலான latency — chat interfaces இல் users அதிகம் உணரும் எண்.
LLM Serving, செலவு & Performance →Language model படிக்கும், எழுதும் அலகு — tokenizer உருவாக்கும் சொல்லின் துண்டு. செலவு, latency, context limits tokens இல் எண்ணப்படுகின்றன.
LLM அடித்தளங்கள் →Tokens நிலையான விகிதத்தில் நிரம்பி, ஒவ்வொரு request உம் ஒன்றைச் செலவழிக்கும் rate limiter — bucket size வரை சிறிய bursts ஐ அனுமதிக்கிறது.
Rate Limiting & Admission Control →Directed acyclic graph nodes இன் நேரியல் வரிசை, இதில் ஒவ்வொரு edge உம் முன்னோக்கிச் சுட்டுகிறது; Kahn's BFS அல்லது DFS post-order மூலம் கிடைக்கிறது.
Graph →வெளிச்செல்லும் event ஐ state change உள்ள அதே transaction இல் outbox table இல் எழுதி, பின் broker க்கு நம்பகமாக அனுப்புதல்.
Distributed Transactions →Stream இன் கீழ்ப் பாதிக்கு max-heap, மேல் பாதிக்கு min-heap — ஒவ்வொரு insert க்கும் O(log n) இல் running median தருகின்றன.
Heap →ஒரு sequence வழியாக நகரும் இரண்டு indices — ஒன்றையொன்று நோக்கி அல்லது ஒரே திசையில் — nested loop க்குப் பதிலாக ஒரே pass போதுமானதாக.
Array →Coordinator அனைத்து participants ஐயும் முதலில் prepare, பின் commit செய்யச் சொல்கிறது; nodes முழுவதும் atomic, ஆனால் coordinator தோல்வியடைந்தால் தடைபடுகிறது.
Distributed Transactions →Path compression மற்றும் union by rank உடன் கிட்டத்தட்ட-நிலையான find மற்றும் union operations கொண்ட disjoint-set structure.
Graph →இரண்டு events causally வரிசையில் உள்ளனவா அல்லது concurrent ஆ என்று சொல்லக்கூடிய ஒவ்வொரு-node counters இன் vector.
Time, Clocks & Ordering →Stream processing இல், நேரம் T ஐவிடப் பழைய events எதிர்பார்க்கப்படவில்லை என அறிவிக்கும் marker — windows மூடி முடிவுகளைத் தர.
Stream Processing & Aggregation →Data pages மாறும் முன் எழுதப்படும் append-only log, crash க்குப் பின் database committed மாற்றங்களை மீட்க.
Storage Engines & Indexing →