October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Microservices Part 1: Deploy a Frontend, Two APIs, and a Database

A practical guide to deploying a frontend, two APIs, and a database: plan service discovery and network boundaries, handle data and configuration, and verify connectivity in Docker Compose or Kubernetes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deploying a frontend, two APIs, and a database means deciding both where each component runs and which network paths it can use. A sound starting design keeps the database and APIs private, gives services stable internal names, and exposes only the frontend. Kubernetes and Docker Compose both support that pattern, though they model workloads and networking differently.

Map the components before deploying them

Think of the application as four workloads: one frontend, two API services, and one database. The frontend receives browser traffic and calls the APIs; the APIs access the database. The database should not be directly reachable from the public internet merely because the application needs it internally.

Draw the intended paths first: public client to frontend; frontend to each API; APIs to database. This makes the exposure boundary explicit and helps distinguish a service that needs a stable internal address from one that needs a public entry point. The exact API responsibilities, database engine, images, and cloud provider depend on the application; the deployment patterns below do not prescribe them.

Choose an orchestration model for the environment

Decision area Docker Compose Kubernetes
Scope Defines and runs a multi-container application, commonly on one Docker host. Manages workloads and networking in a cluster.
Service discovery Services on a shared Compose network can reach each other by service name. A Service provides stable in-cluster discovery and routes to Pods selected by labels.
External access Publish a host port on the frontend, or connect it to an externally shared network as appropriate. Configure the frontend Service as LoadBalancer where supported, or use NodePort where that is the chosen access method.
Persistent data The application model can declare a volume for database data; persistence still requires a backup and recovery plan. Persistent storage must be designed for the cluster and database; the cited frontend/backend example does not define database storage operations.
Configuration and secrets Compose can declare configs and secrets separately from service definitions. Runtime configuration can be separated from an image, for example with a ConfigMap for NGINX configuration.

These are different operating models, not interchangeable guarantees of production readiness. Compose is a straightforward way to describe cooperating containers; Kubernetes adds cluster-level workload management. Pick based on where the application must run and how that environment is operated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

How Kubernetes separates workload management from networking

Deploy APIs as workloads, then give them stable Services

A Kubernetes Deployment manages application Pods, including their desired replica count. A Service does a different job: it selects matching Pods and gives clients a stable network identity. Pods can be replaced, so clients should use the Service rather than depend on an individual Pod address.

In Kubernetes’ documented example, a backend Deployment runs three replicas and a Service named hello selects them using labels. Other workloads in the cluster can discover that backend by the Service DNS name hello and send traffic to it. For an application with two APIs, define a workload and an internal Service for each API, using distinct names and selectors that match only the intended Pods. The example’s three replicas illustrate the mechanism; they are not a sizing recommendation for your APIs. Kubernetes’ frontend/backend Services example documents the pattern.

Rank #2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
  • Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Make the frontend the public boundary

The Kubernetes example runs NGINX as the frontend and configures it to proxy requests to the backend Service using the internal DNS name hello. Its frontend Service is configured as type: LoadBalancer, while the backend Service is not externally resolvable. Applied to four components, the same boundary means exposing the frontend and keeping both APIs and the database on internal paths unless a separate, justified access requirement exists.

An external LoadBalancer address depends on a supported environment and provisioning by its infrastructure; Kubernetes’ tutorial shows an address becoming available, but that timing is not a universal guarantee. If an external load balancer is unavailable, the documentation identifies NodePort as an alternative. Choose the access method that matches the cluster and its surrounding network rather than assuming every cluster can provision a public load balancer. The Kubernetes task also notes that its NGINX configuration is baked into the image and that a ConfigMap can make configuration changes easier.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
  • CanaKit Raspberry Pi 5 Essentials Starter Kit

How Compose services find one another

Use shared networks to express allowed paths

A Compose application is described in a compose.yaml file as a set of services. Services attached to the same Compose network can resolve one another by service name. A useful topology is to put the frontend on a front-facing network and an API-facing network, APIs on the API-facing network and a database-facing network, and the database only on the database-facing network. This is a design example, not a mandatory Compose layout.

Docker’s example uses front-tier and back-tier networks: the frontend joins both, while the backend joins only the back-tier. It also demonstrates a persistent volume for backend data, a config for HTTP settings, and a secret for an HTTPS certificate. These objects let the application model distinguish data persistence and runtime configuration from the container image. They do not by themselves provide database backups, secret rotation, or a complete production security policy. See Docker’s Compose application model.

Rank #4
SANOOV Raspberry Pi 5 4GB Kit, 4GB RAM Single Board Computer with Active Cooler and ABS Case, Complete Raspberry Pi 5 Starter Kit for IoT Robotics Retro Gaming
  • All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
  • Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
  • Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
  • Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
  • Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online

Keep separate projects connected deliberately

Services in separate Compose projects do not automatically share a network. Docker documents creating an external network and attaching services from each project to it when cross-project communication is needed. Its hybrid-network example lets an API join a shared network and an internal network while the database remains on the internal network. That is useful when components are deployed independently but the database should not join the shared path. Docker’s Compose networking guide explains service-name discovery and network setup.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Handle data and configuration as separate concerns

Give database data persistent storage

A database container’s writable filesystem is not a data-retention strategy. In Compose, declare persistent storage and mount it at the database’s data location; the Docker example illustrates a volume for backend data. In Kubernetes, choose an appropriate persistent-storage arrangement for the database workload. In either environment, persistence and backup are separate concerns: a volume can preserve data across container replacement, but it does not establish that the data can be restored after loss or corruption.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.

Keep changeable settings out of image contents

Embedding an upstream hostname or other environment-specific setting in an image makes changes require a new image build or a more involved rollout. Kubernetes’ NGINX example explicitly bakes its proxy configuration into the image and points to a ConfigMap as a more manageable alternative. Compose likewise supports config and secret objects. Keep non-secret runtime settings distinct from credentials and certificates, and avoid treating a configuration mechanism as a substitute for secret access controls.

Verify startup, service discovery, and live traffic

A running container or Pod does not prove that a request can traverse the intended network path. Check each boundary in sequence: whether services are running, whether they are attached to the expected network, whether names resolve from the caller’s environment, and whether the receiving process accepts the connection.

  1. Check service status. In Compose, run docker compose ps to inspect the project’s containers and status.
  2. Inspect startup output. Run docker compose logs to look for configuration errors, failed connections, or application startup problems.
  3. Confirm network attachment. Use docker network inspect to examine network membership and configuration; verify the relevant services are on a common network.
  4. Test from the caller’s context. Use docker compose exec to run a connectivity or name-resolution check from a service container, where available. Testing from the host alone may not exercise the same network path.
  5. Follow the request path. Confirm frontend-to-API connectivity, then API-to-database connectivity, rather than inferring end-to-end health from one successful check.

Docker’s guidance emphasizes checking network configuration, container attachment, and live connectivity. The commands above are inspection aids; the precise test utility available inside a container depends on its image. Docker’s networking guide and Compose application model overview describe the relevant Compose features and commands.

What this deployment pattern does not decide

The examples establish ways to define workloads, discover services, set network boundaries, and represent persistent data and configuration. They do not determine the right replica counts, database engine, cloud provider, TLS termination design, health-check policy, migration process, secret-rotation schedule, backup retention, or availability objective for a particular application. Those choices require the application’s requirements and the capabilities of the target environment; they should be made explicitly rather than inferred from a hello-world topology.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
CanaKit Raspberry Pi 5 16GB Starter Kit PRO - Turbine Black (128GB Edition) (16GB RAM)
Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$419.99
Bestseller No. 3
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit (4GB RAM)
CanaKit Raspberry Pi 5 Essentials Starter Kit
$189.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.