MicroBPF-Kernel is a RISC-V edge-device unikernel built from first principles to combine seL4's formal verification, Unikraft-style efficiency and in-kernel eBPF programmability. Each application is compiled into a minimal unikernel image (<2 MB) that boots in under 10 ms, safe!
🎁 Giving Away 100 Digital System Design, ML System Design, & Newsletter Subscriptions 🎁
𝐇𝐨𝐰 𝐭𝐨 𝐩𝐚𝐫𝐭𝐢𝐜𝐢𝐩𝐚𝐭𝐞:
✅ Like & retweet
✅ Subscribe to our free weekly newsletter: https://t.co/5teyU77Kjr
✅ Winners get all 3
Happy Thanksgiving ❤️
⏰ The giveaway ends in 72 hours.
Winners will receive an email on how to redeem the rewards on Nov 26.
IBM MQ -> RabbitMQ -> Kafka ->Pulsar, How do message queue architectures evolve?
�� IBM MQ
IBM MQ was launched in 1993. It was originally called MQSeries and was renamed WebSphere MQ in 2002. It was renamed to IBM MQ in 2014. IBM MQ is a very successful product widely used in the financial sector. Its revenue still reached 1 billion dollars in 2020.
🔹 RabbitMQ
RabbitMQ architecture differs from IBM MQ and is more similar to Kafka concepts. The producer publishes a message to an exchange with a specified exchange type. It can be direct, topic, or fanout. The exchange then routes the message into the queues based on different message attributes and the exchange type. The consumers pick up the message accordingly.
🔹 Kafka
In early 2011, LinkedIn open sourced Kafka, which is a distributed event streaming platform. It was named after Franz Kafka. As the name suggested, Kafka is optimized for writing. It offers a high-throughput, low-latency platform for handling real-time data feeds. It provides a unified event log to enable event streaming and is widely used in internet companies.
Kafka defines producer, broker, topic, partition, and consumer. Its simplicity and fault tolerance allow it to replace previous products like AMQP-based message queues.
🔹 Pulsar
Pulsar, developed originally by Yahoo, is an all-in-one messaging and streaming platform. Compared with Kafka, Pulsar incorporates many useful features from other products and supports a wide range of capabilities. Also, Pulsar architecture is more cloud-native, providing better support for cluster scaling and partition migration, etc.
There are two layers in Pulsar architecture: the serving layer and the persistent layer. Pulsar natively supports tiered storage, where we can leverage cheaper object storage like AWS S3 to persist messages for a longer term.
Over to you: which message queues have you used?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/FIzCeaWsZV
We are often asked to design for high availability, high scalability, and high throughput. What do they mean exactly? The method to download the high-resolution PDF is available at the end.
The diagram below is a system design cheat sheet with common solutions.
1. High Availability
This means we need to ensure a high agreed level of uptime. We often describe the design target as “3 nines” or “4 nines”. “4 nines”, 99.99% uptime, means the service can only be down 8.64 seconds per day.
To achieve high availability, we need to design redundancy in the system. There are several ways to do this:
- Hot-hot: two instances receive the same input and send the output to the downstream service. In case one side is down, the other side can immediately take over. Since both sides send output to the downstream, the downstream system needs to dedupe.
- Hot-warm: two instances receive the same input and only the hot side sends the output to the downstream service. In case the hot side is down, the warm side takes over and starts to send output to the downstream service.
- Single-leader cluster: one leader instance receives data from the upstream system and replicates to other replicas.
- Leaderless cluster: there is no leader in this type of cluster. Any write will get replicated to other instances. As long as the number of write instances plus the number of read instances are larger than the total number of instances, we should get valid data.
2. High Throughput
This means the service needs to handle a high number of requests given a period of time. Commonly used metrics are QPS (query per second) or TPS (transaction per second).
To achieve high throughput, we often add caches to the architecture so that the request can return without hitting slower I/O devices like databases or disks. We can also increase the number of threads for computation-intensive tasks. However, adding too many threads can deteriorate the performance. We then need to identify the bottlenecks in the system and increase its throughput. Using asynchronous processing can often effectively isolate heavy-lifting components.
3. High Scalability
This means a system can quickly and easily extend to accommodate more volume (horizontal scalability) or more functionalities (vertical scalability). Normally we watch the response time to decide if we need to scale the system.
To achieve high scalability, it is important to segregate the responsibilities of the services. Microservices are widely adopted for this purpose. We also leverage the service registry and load balancer to route requests to the proper instance.
Over to you: Do you have other things to share in your design toolbox?
–
Subscribe to our newsletter to download the 𝐡𝐢𝐠𝐡-𝐫𝐞𝐬𝐨𝐥𝐮𝐭𝐢𝐨𝐧 𝐏𝐃𝐅. After signing up, find the download link on the success page: https://t.co/5w1YCB3vOJ
Found the system prompt that drives this thing here: https://t.co/UdSV5rUY2S
It works by generating a base64 encoded PNG of the drawn components, then passing that to GPT-4 Vision with that system prompt and instructions to "Turn this into a single html file using tailwind"
Top 3 API Gateway Use Cases.
API gateway sits between the clients and services, providing API communications between them.
1. API gateway helps build an ecosystem.
The users can leverage an API gateway to access a wider set of tools. The partners in the ecosystem collaborate with each other to provide better integrations for the users.
2. API gateway builds API marketplace
The API marketplace hosts fundamental functionalities for everyone. The developers and businesses can easily develop or innovate in this ecosystem and sell APIs on the marketplace.
3. API gateway provides compatibility with multiple platforms
When dealing with multiple platforms, an API gateway can help work across multiple complex architectures.
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7CdXXC
𝗙𝗮𝗰𝗲𝗯𝗼𝗼𝗸 𝗰𝗿𝗲𝗮𝘁𝗲𝗱 𝗮 𝘁𝗼𝗼𝗹 𝘄𝗵𝗶𝗰𝗵 𝗱𝗲𝘁𝗲𝗰𝘁 𝗮𝗻𝗱 𝗿𝗲𝗽𝗮𝗶𝗿 𝗯𝘂𝗴𝘀 𝗮𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗰𝗮𝗹𝗹𝘆
The recent document by engineers from Facebook explains how they wrote a tool that can automatically fix bugs. In the paper, they introduced 𝗦𝗔𝗣𝗙𝗜𝗫, an automated tool designed to detect and repair bugs in software. The tool has suggested fixes for six essential Android apps in the Facebook App Family: Facebook, Messenger, Instagram, FBLite, Workplace, and Workchat.
How Does It Work?
𝗦𝘁𝗲𝗽 𝟭: Detect a Crash - Another tool, 𝗦𝗮𝗽𝗶𝗲𝗻𝘇, finds app crashes. When Sapienz identifies a crash, it is logged into a database.
𝗦𝘁𝗲𝗽 𝟮: Identify the Problem - SAPFIX pinpoints the exact line of code causing the issue. It first checks if the crash is reproducible. If it's not reproducible, the crash is discarded. It uses a technique called "spectrum-based fault localization" to identify the most likely lines of code responsible for the crash.
𝗦𝘁𝗲𝗽 𝟯: Suggest a Fix - Using predefined templates or code mutations, SAPFIX proposes a solution. After identifying the fault location, SAPFIX attempts to generate a patch. It employs two strategies:
🔹 𝗧𝗲𝗺𝗽𝗹𝗮𝘁𝗲-𝗯𝗮𝘀𝗲𝗱 𝗙𝗶𝘅𝗶𝗻𝗴: SAPFIX uses predefined templates to suggest fixes for common bugs. These templates are designed based on standard developer practices.
🔹 𝗠𝘂𝘁𝗮𝘁𝗶𝗼𝗻-𝗯𝗮𝘀𝗲𝗱 𝗙𝗶𝘅𝗶𝗻𝗴: SAPFIX resorts to a mutation-based system if the template-based approach fails. It systematically applies a series of code mutations to the fault location to generate potential fixes.
𝗦𝘁𝗲𝗽 𝟰: Test the Fix - The proposed solution is tested to ensure it's valid. It uses the test cases from 𝗦𝗮𝗽𝗶𝗲𝗻𝘇 to check the validity of the patch. If the patch passes all tests, it's considered a good fix. After patch validation, SAPFIX uses 𝗜𝗻𝗳𝗲𝗿 (a static analysis tool) to analyze the proposed fix further. Infer checks if the patch introduces any new potential issues.
𝗦𝘁𝗲𝗽 𝟱: Review - Developers get the final say, reviewing and approving the fix.
Check the entire document in the comments.
Image credits: Facebook.
What do you think about this?
_______
If you like my posts, please follow me, @milan_milanovic, and hit the 🔔 on my profile to get a notification for all my new posts.
Grow with me 🚀!
#technology #softwareengineering #programming #techworldwithmilan #coding
My recommended materials for cracking your next technical interview:
Coding
- Leetcode
- Cracking the coding interview book
- Neetcode
System Design Interview
- System Design Interview book 1, 2 by Alex Xu
- Grokking the system design by Design Guru
- Design Data-intensive Application book
Behavioral interview
- Tech Interview Handbook (Github repo)
- A Life Engineered (YT)
- STAR method (general method)
OOD Interview
- Interviewready
- OOD by educative
- Head First Design Patterns Book
Mock interviews
- Interviewingio
- Pramp
- Meetapro
Apply for Jobs
- Linkedin
- Monster
- Indeed
Over to you: What is your favorite interview prep material?
–
Subscribe to our weekly newsletter to get a Free System Design PDF (158 pages): https://t.co/uc5M7Cdq84