EP106: How Does JavaScript Work?

This week’s system design refresher:


New Relic IAST exceeds OWASP Benchmark with accuracy scoring above 100% (Sponsored)

New Relic Interactive Application Security Testing (IAST) allows security and engineering teams to save time by focusing on real application security problems with zero false positives, as validated by the OWASP benchmark result of 100% accuracy.

Get started for free


Roadmap for Learning SQL


Can Kafka lose messages?

Error handling is one of the most important aspects of building reliable systems.

Today, we will discuss an important topic: Can Kafka lose messages?

A common belief among many developers is that Kafka, by its very design, guarantees no message loss. However, understanding the nuances of Kafka's architecture and configuration is essential to truly grasp how and when it might lose messages, and more importantly, how to prevent such scenarios.

The diagram below shows how a message can be lost during its lifecycle in Kafka.

diagram

A good practice is to combine both synchronous and asynchronous commits, where we use asynchronous commits in the processing loop for higher throughput and synchronous commits in exception handling to make sure the the last offset is always committed.


Latest articles

If you’re not a paid subscriber, here’s what you missed.

  1. A Crash Course in CI/CD

  2. A Crash Course in IPv4 Addressing

  3. A Brief History of Scaling Netflix

  4. 15 Open-Source Projects That Changed the World

  5. The Top 3 Resume Mistakes Costing You the Job

To receive all the full articles and support ByteByteGo, consider subscribing:

Subscribe now


9 Best Practices for building microsercvices

Creating a system using microservices is extremely difficult unless you follow some strong principles.

No alt text provided for this image

9 best practices that you must know before building microservices:

  1. Design For Failure
    A distributed system with microservices is going to fail.

    You must design the system to tolerate failure at multiple levels such as infrastructure, database, and individual services. Use circuit breakers, bulkheads, or graceful degradation methods to deal with failures.

  2. Build Small Services
    A microservice should not do multiple things at once.
    A good microservice is designed to do one thing well.

  3. Use lightweight protocols for communication
    Communication is the core of a distributed system.
    Microservices must talk to each other using lightweight protocols. Options include REST, gRPC, or message brokers.

  4. Implement service discovery
    To communicate with each other, microservices need to discover each other over the network.
    Implement service discovery using tools such as Consul, Eureka, or Kubernetes Services

  5. Data Ownership
    In microservices, data should be owned and managed by the individual services.
    The goal should be to reduce coupling between services so that they can evolve independently.

  6. Use resiliency patterns
    Implement specific resiliency patterns to improve the availability of the services.
    Examples: retry policies, caching, and rate limiting.

  7. Security at all levels
    In a microservices-based system, the attack surface is quite large. You must implement security at every level of the service communication path.

  8. Centralized logging
    Logs are important to finding issues in a system. With multiple services, they become critical.

  9. Use containerization techniques
    To deploy microservices in an isolated manner, use containerization techniques.

Tools like Docker and Kubernetes can help with this as they are meant to simplify the scaling and deployment of a microservice.

Over to you: what other best practice would you recommend?


Roadmap for Learning Cyber Security

By Henry Jiang. Redrawn by ByteByteGo.

No alt text provided for this image

Cybersecurity is crucial for protecting information and systems from theft, damage, and unauthorized access. Whether you're a beginner or looking to advance your technical skills, there are numerous resources and paths you can take to learn more about cybersecurity. Here are some structured suggestions to help you get started or deepen your knowledge:


How does Javascript Work?

The cheat sheet below shows most important characteristics of Javascript.

No alt text provided for this image

SPONSOR US

Get your product in front of more than 500,000 tech professionals.

Our newsletter puts your products and services directly in front of an audience that matters - hundreds of thousands of engineering leaders and senior engineers - who have influence over significant tech decisions and big purchases.

Space Fills Up Fast - Reserve Today

Ad spots typically sell out about 4 weeks in advance. To ensure your ad reaches this influential audience, reserve your space now by emailing [email protected].