DAILY NEWS

Stay Ahead, Stay Informed – Every Day

Advertisement
Internet Architecture – DEV Community



Internet Architecture describes how data is organized, transmitted, and managed across networks. Different architectural models serve different needs, some offer a straightforward client-server setup (like a website), while others rely on a more distributed approach (like file-sharing platforms).

Peer-to-Peer (P2P) Architecture

This is when computers and devices are linked directly to each other without the need for a central server. This system can be fully decentralised or partially centralized as the server does some tasks but doesn’t host any of the data. This setup allows nodes to communicate directly with each other, sharing resources such as files, processing power, or bandwidth, without the need for a central server.

For example, three friends finished college and want to share their college photos with eachother. Instead of uploading all the photos to a single website or server, each of them sets up a folder on their own computer that can be accessed by the others. They use a file-sharing program that connects their computers directly.

First, they install a Peer-to-Peer (P2P) file-sharing application on their computer and then select the folder containing the photos to share with the other friends. Everyone preforms the same setup on their computers and once everyone is connected though the P2P application, they can all browse and download photos directly from the other’s shared folders. This allows for a direct exchange of files without the need for a central server.

A popular example of Peer-to-Peer (P2P) architecture is torrenting, as seen with applications like BitTorrent. In this system, anyone who has the file, referred to as a seeder, can upload it, allowing others to download it from multiple sources simultaneously.

Advantages

Scalability – Adding more nodes can increase total resources (storage, CPU, etc.).
Resilience – If one node goes offline, others can continue functioning.
Cost distribution – Resource burden, like bandwidth and storage, is distributed among peers, making it more cost-efficient.

Disadvantages

Management complexity – Harder to control and manage updates/security policies across all nodes
Potential reliability issues – If too many peers leave, resources could be unavailable.
Security challenges – Each node is exposed to potential vulnerabilities.

Client-Server Architecture

This model is one of the most widely used architectures on the Internet. Clients(user devices) send requests, such as a web browser asking for a webpage, and the severs then respond to these requests, like a web server hosting that webpage. This model typically involves centralized servers where data and applications reside, with multiple clients connecting to these servers to access services and resources.

Say, you want to check the weather forecast on a website. You start by opening the web browser on you phone or computer, and proceed to type in the website’s name, e.g., weather.com. When we press enter, the browser sends a request over the Internet to the server that hosts weather.com. This server, a powerful computer set up specifically to store the website’s data and handle requests, receives the query and processes it by locating the requested page. It then sends back the data (regarding the request) to our browser, which receives this information and displays the webpage, allowing us to see the latest weather updates.

Single-Tier Architecture

In a single-tier architecture, the client, server, and database all reside on the same machine. This setup is straightforward but is rarely used for large-scale applications due to significant limitations in scalability and security.

Two-Tier Architecture

The two-tier architecture splits the application environment into a client and a server. The client handles the presentation layer, and the server manages the data layer. This model is typically seen in desktop applications where the user interface is on the user’s machine, and the database is on a server. Communication usually occurs directly between the client and the server, which can be a database server with query-processing capabilities.

Three-Tier Architecture

A three-tier architecture introduces an additional layer between the client and the database server, known as the application server. In this model, the client manages the presentation layer, the application server handles all the business logic and processing, and the third tier is a database server. This separation provides added flexibility and scalability because each layer can be developed and maintained independently.

N-Tier Architecture

In more complex systems, an N-tier architecture is used, where N refers to any number of separate tiers used beyond three. This setup involves multiple levels of application servers, each responsible for different aspects of business logic, processing, or data management. N-tier architectures are highly scalable and allow for distributed deployment, making them ideal for web applications and services that demand robust, flexible solutions.

Advantages

Centralized control – Easier to manage and update.
Security – Central security policies can be applied.
Performance -Dedicated servers can be optimized for their tasks.

Disadvantages

Single point of failure – If the central server goes down, clients lose access.
High Cost and Maintenance – Setting up and sustaining a client-server architecture is expensive, requiring constant operation and expert management , making it costly to maintain.
Network Congestion – High traffic on the network can lead to congestion, slowing down or even disrupting connections when too many clients access the server simultaneously.

Hybrid Architecture

A Hybrid model blends elements of both Client-Server and Peer-to-Peer (P2P) architectures. In this setup, central servers are used to facilitate coordination and authentication tasks, while the actual data transfer occurs directly between peers. This combination leverages the strengths of both architectures to enhance efficiency and performance.

For example, when you open a video confrencing app(eg. Zoom) and log in, the username and password are verified by central servers, which also manage the session by co-ordinating who is in the meeting and controlling access. Once you are logged in and the meeting begins, the video and audio data is transferred directly between your device and other’s, bypassing the central server. This reduces lag and enchances the video quality. By using the central server for initial connection and control tasks, while the bulk of data transfer occurs in a peer-to-peer style, you can reduce the server load and leverage direct, fast connections between peers.

Advantage

Efficiency – Relieves workload from servers by letting peers share data.
Control – Central server can still manage user authentication, directory services, or indexing.

Disadvantage

Complex Implementation – Requires more sophisticated design to handle both centralized and distributed components.
Potential Single Point of Failure – If the central coordinating server fails, peer discovery might stop.

Cloud Architecture

Cloud Architecture refers to computing infrastructure that is hosted and managed by third-party providers, such as AWS, Azure, and Google Cloud. This architecture operates on a virtualized scale following a client-server model. It provides on-demand access to resources such as servers, storage, and applications, all accessible over the Internet. In this model, users interact with these services without controlling the underlying hardware.

Services like Google Drive or Dropbox are some examples of Cloud Architecture operating under the SaaS (Software as a Service) model, where we access applications over the internet without managing the underlying hardware. Below are five essential characteristics that define a Cloud Architecture.

Characteristic

On-demand self-service – Automatically set up and manage the services without human help.
Broad network access – Access services from any internet-connected device.
Resource pooling – Share and allocate service resources dynamically among multiple users.
Rapid elasticity – Quickly scale services up or down based on demand.
Measured service – Only pay for the resources you use, tracked with precision.

Advantages

Scalability – Easily add or remove computing resources as needed.
-Reduced cost & maintenance – Hardware managed by the cloud provider.
-Flexibility – Access services from anywhere with Internet connectivity.

Disadvantages

Vendor lock-in – Migrating from one cloud provider to another can be complex.
Security/Compliance – Relying on a third party for data hosting can introduce concerns about data privacy.
Connectivity – Requires stable Internet access.

Software-Defined Architecture (SDN)

Software-Defined Networking (SDN) is a modern networking approach that separates the control plane, which makes decisions about where traffic is sent, from the data plane, which actually forwards the traffic. Traditionally, network devices like routers and switches housed both of these planes. However, in SDN, the control plane is centralized within a software-based controller. This configuration allows network devices to simply execute instructions they receive from the controller. SDN provides a programmable network management environment, enabling administrators to dynamically adjust network policies and routing as required. This separation makes the network more flexible and improves how it’s managed.

Advantages

Centralized control – Simplifies network management.
Programmability & Automation – Network configurations can be changed quickly through software instead of manually configuring each device.
Scalability & Efficiency – Can optimize traffic flows dynamically, leading to better resource utilization.

Disadvantages

Controller Vulnerability – If the central controller goes down, the network might be adversely affected.
Complex Implementation – Requires new skill sets and specialized software/hardware.



Source link

There is a moment, after I finish a prompt and before I press send, when the …



There is a moment, after I finish a prompt and before I press send, when the room becomes very quiet. The machine is waiting. It has nothing to do until I say so. And in that pause something happens that doesn’t get talked about much: I get to choose whether the question was worth asking.

Most days I let the moment pass. I send. The model answers. I move on. But sometimes I sit with the unsent prompt and notice it isn’t actually a question — it is a small panic dressed as curiosity. A reflex. An evasion of doing the thing myself.

The discipline I keep failing at isn’t writing better prompts. It is writing fewer of them. Knowing when not to ask. Letting the silence between requests be a place where I think instead of a place where I outsource thinking.

The model is endlessly patient. That is its gift and its trap. It will answer anything, no matter how thin the question. Which means the burden of seriousness falls entirely on me. There is no friction left to protect me from my own laziness except the friction I install myself.

Lately I keep a small ritual: before I send anything, I read the prompt back to myself out loud. If it sounds like something I should already know, or something I would rather not figure out, I close the window. The unsent prompt is the most honest thing I write some days.

Tools don’t teach you discipline. They reveal where you never had any.



Source link

Analyzing Naver Video Streaming: Building a High-Performance Downloader with HLS and WebAssembly



As a developer, “downloading a video” may seem as simple as just finding a .mp4 link. However, for a large platform like Naver (including Naver TV, Sports, and V LIVE archives), the reality is much more complex. Naver uses a sophisticated Adaptive Bitrate Streaming (ABS) infrastructure that is powered by the HLS (HTTP Live Streaming) protocol. While developing Naver Video Downloader, I faced technical hurdles that went far beyond simple web scraping. In this article, I will detail the architecture of Naver’s video delivery system and the engineering solutions we implemented to achieve lossless extraction. twittervideodownloaderx.com 1. Main Challenge: “Invisible” Videos Naver doesn’t serve static video files. Instead, they use segmented delivery.1.1 Fragmented StreamWhen you play a video on Naver, your browser isn’t downloading a file; This is downloading hundreds of small .ts (Transport Stream) segments.• Master Playlist (.m3u8): A manifest file that lists all available resolutions (1080p, 720p, etc.).• Media Playlist: Sub-manifests for a specific resolution that contain the URLs of individual 2-5 second video segments.1.2 Authentication Barriers: VodSeed and Dynamic TokenNaver Vod_play_info’s internal API (vod_play_info) is the “brain” of the player. To get a .m3u8 link, you need a vid (video ID) and an inkey (session key). These keys are often generated through obfuscated JavaScript and have very short TTL (Time To Live). Accessing the segment URL without the correct signature results in a 403 Forbidden error. 2. Engineering the extraction engine To automate this, our engine must simulate a “handshake” between the official Naver player and its backend.2.1 Metadata Interception We have implemented a headless parsing logic that: Scans the target page for vids—which are often hidden in the PRELOADED_STATE JSON object. Simulates API calls to Naver’s VOD servers. We use a rotating set of headers that mimic real browser fingerprints. Analyzes the received feedback to find the M3U8 source with the highest bitrate. 3. Defeating CORS: Transparent Proxy Architecture Browsers enforce Same-Origin Policy (SOP). A script on your-site.com cannot fetch binary data directly from Naver’s domain because CORS (Cross-Origin Resource Sharing) restrictions prevent it.3.1 High-Throughput Streaming ProxyTo solve this, we built a transparent streaming proxy using Node.js.• The Flow: The client requests a segment through our proxy. Our server fetches it from Naver’s CDN, removes the restrictive CORS headers, and injects Access-Control-Allow-Origin: *.• Zero-Latency Piping: Instead of downloading the entire segment to our server first, we use Stream Piping. Data is sent as soon as it reaches the user, meaning our server acts as a “dumb pipe”, keeping RAM usage constant regardless of video size. 4. Client-side muxing with FFmpeg.wasm This is where the technical magic happens. Merging 500 different .ts files on a server is CPU-intensive and expensive. Instead, we transfer the work to the user’s computer via WebAssembly (WASM).4.1 Remuxing vs. TranscodingVideo segments in Naver’s HLS stream are already encoded in H.264. Re-encoding them will reduce quality and take a lot of time. Using FFmpeg.wasm, we do Remuxing:• We use the -c copy flag in FFmpeg.• This tells the engine to simply convert the container from TS to MP4, without touching the underlying video packets.• The result: lossless 1080p quality, processed directly into the user’s browser RAM in seconds. 5. Performance Optimizations 5.1 Asynchronous Concurrency Control Downloading 500 segments one by one is slow. Downloading them all at once triggers CDN rate-limiting. We implemented an Async Promise Pool to maintain exactly 5-10 concurrent downloads, thereby maximizing bandwidth without blocking. JavaScript // Conceptual rationale for parallel downloadingasync function downloadWithPool(urls, limit) { const pool = new Set(); for (const url of urls) { if (pool.size >= limit) await Promise.race(pool); const promise = fetchSegment(url).then() => pool.delete(promise);pool.add(promise);}}5.2 Sequential Data Alignment HLS segments must be merged in the exact order specified in the .m3u8 file. Even a single missing segment can ruin the audio-video timing. Our engine has a Sequence Validation Layer that automatically retries failed chunks and ensures that the binary buffer is perfectly aligned before the final muxing step. 6. Conclusion: Engineering for Privacy and Speed ​​Building a downloader for a complex platform like Naver is an excellent example of modern web architecture. By combining Node.js proxies, HLS parsing, and WebAssembly, we’ve created a tool that’s fast, serverless-heavy, and privacy-focused. If you’re looking for a reliable way to save Naver content in native 1080p quality, try our tools: 👉 Naver Video DownloaderTechnical Highlights:• Native Quality: No re-compression; 1:1 copy of the original bitstream.• WASM powered: All processing occurs client-side for maximum privacy.• No installation required: Works entirely in the browser using modern web standards. Have questions about HLS parsing or WebAssembly? Discuss in the comments below! Tags: #JavaScript #WebDev #NodeJS #WebAssembly #FFmpeg #Naver #Streaming #Hindi



Source link