Web_programming
https://blog.klauspost.com/fast-stream-deduplication-in-go/ #stream #deduplication
توجه کنید که deduplication میتواند سخت افزاری و یا مانند بالا نرم افزاری پیاده سازی شود
حملاتی که به عنوان یک توسعه دهنده وب باید با آنها آشنا باشید
known attacks
— Known-Plaintext Attacks
— Chosen-Plaintext Attacks
— Chosen-Ciphertext Attacks
— Replay attacks
— Man-in-the-middle attacks
— hash-collision attacks
— Length extension attacks
known attacks
— Known-Plaintext Attacks
— Chosen-Plaintext Attacks
— Chosen-Ciphertext Attacks
— Replay attacks
— Man-in-the-middle attacks
— hash-collision attacks
— Length extension attacks
the known-plaintext attack (KPA) is an attack model for cryptanalysis where the attacker has samples of both the plaintext, and its encrypted version (ciphertext).
By definition, a chosen-plaintext attack (CPA) is an attack model for cryptanalysis which presumes that the attacker has the capability to choose arbitrary plaintexts to be encrypted and obtain the corresponding ciphertexts.
By definition, a chosen-ciphertext attack (CCA) is an attack model for cryptanalysis in which the cryptanalyst gathers information, at least in part, by choosing a ciphertext and obtaining its decryption under an unknown key. In the attack, an adversary has a chance to enter one or more known ciphertexts into the system and obtain the resulting plaintexts. From these pieces of information the adversary can attempt to recover the hidden secret key used for decryption.
By definition, length extension attacks are a type of attack when certain types of hashes are misused as message authentication codes, allowing for inclusion of extra information.
A replay attack (also known as playback attack) is a form of network attack in which a valid data transmission is maliciously or fraudulently repeated or delayed. This is carried out either by the originator or by an adversary who intercepts the data and re-transmits it, possibly as part of a masquerade attack by IP packet substitution. This is one of the lower tier versions of a "Man-in-the-middle attack".
تلگرام چگونه فایل upload میکند:
- بر اساس سرعت اینترنت شما میزان بافر چانک را مشخص یکند
- در حداکثر ۴ connection فایل را به صورت پارت پارت به سرور ارسال میکند (تعداد پارت ها تابعی است بر اساس حجم فایل)
- پس از ارسال همه فایلها یک api دیگر را فراخوانی میکند که وظیفه ان ایجاد فایل نهایی بر روی media data center است و هچنین تنظیمات مرتبط با cdn برای ان فایل (و البته تهیه چند نسخه از فایل)
به عبارت دیگر در حالتی که اینترنت سرعت مناسب دارد فرایند را میتوانید اینگونه تصور کنید ۴ thread در چانک های موازی یک فایل در پوشه tmp سرور ایجاد میکنند وقتی کار پایان یافت بخشهای مختلف با هم ترکیب شده و در مقصد نهایی نوشته میشود. میدانیم که برای این scale حتما از network file system ها و یا فایل سیستمهای توزیع شده استفاده میکنند.
پ.ن. البته با پیچیدگی های کمی بیشتر :)
- بر اساس سرعت اینترنت شما میزان بافر چانک را مشخص یکند
- در حداکثر ۴ connection فایل را به صورت پارت پارت به سرور ارسال میکند (تعداد پارت ها تابعی است بر اساس حجم فایل)
- پس از ارسال همه فایلها یک api دیگر را فراخوانی میکند که وظیفه ان ایجاد فایل نهایی بر روی media data center است و هچنین تنظیمات مرتبط با cdn برای ان فایل (و البته تهیه چند نسخه از فایل)
به عبارت دیگر در حالتی که اینترنت سرعت مناسب دارد فرایند را میتوانید اینگونه تصور کنید ۴ thread در چانک های موازی یک فایل در پوشه tmp سرور ایجاد میکنند وقتی کار پایان یافت بخشهای مختلف با هم ترکیب شده و در مقصد نهایی نوشته میشود. میدانیم که برای این scale حتما از network file system ها و یا فایل سیستمهای توزیع شده استفاده میکنند.
پ.ن. البته با پیچیدگی های کمی بیشتر :)
یک کاربر در تلگرام چه تعداد connection با سرور دارد:
۱. یکی برای درخواستهای رایج
۴. چهار تا برای upload
۲. دو تا برای دانلود
۱. یکی برای دریافت internal push
۱. یکی برای کارهای موقتی و حساس
۱. یکی برای درخواستهای رایج
۴. چهار تا برای upload
۲. دو تا برای دانلود
۱. یکی برای دریافت internal push
۱. یکی برای کارهای موقتی و حساس
یکی از منابع بسیار خوب برای آشنایی با raft در لینک زیر آورده شده است. این پروتکل در پیاده سازی سیستم های توزیع شده کاربرد دارد.
http://thesecretlivesofdata.com/raft/
https://raft.github.io/
#raft
http://thesecretlivesofdata.com/raft/
https://raft.github.io/
#raft
https://instagram-engineering.com/open-sourcing-a-10x-reduction-in-apache-cassandra-tail-latency-d64f86b43589
#db #cassandra
#db #cassandra
Medium
Open-sourcing a 10x reduction in Apache Cassandra tail latency
At Instagram, we have one of the world’s largest deployments of the Apache Cassandra database. We began using Cassandra in 2012 to replace…