# No Connectivity? No Problem! Enable Offline Inventory with Atlas Edge Server

> If you haven’t yet followed our guide on how to build an inventory management system using MongoDB Atlas, we strongly advise doing so now. This article builds on top of the previous one to bring powerful new capabilities for real-time sync, conflict resolution, and disconnection tolerance!

In the relentless world of retail logistics, where products are always on the move, effective inventory management is crucial. Fast-moving operations can’t afford to pause when technical systems go offline. That's why it's essential for inventory management processes to remain functional, even without connectivity. To address this challenge, supply chains turn to Atlas Edge Server to enable offline inventory management in a reliable and cost-effective way. In this guide, we will demonstrate how you can easily incorporate Edge Server into your existing solution.

, we explored how MongoDB Atlas enables event-driven architectures to enhance inventory management with real-time data strategies. Now, we are taking that same architecture a step further to ensure our store operations run seamlessly even in the face of connectivity issues. Our multi-store setup remains the same: We’ll have three users — two store managers and one area manager — overviewing the inventory of their stores and areas respectively. We'll deploy identical systems in both individual stores and the public cloud to serve the out-of-store staff. The only distinction will be that the store apps will be linked to Edge Server, whereas the area manager's app will remain connected to MongoDB Atlas. Just like that, our stores will be able to handle client checkouts, issue replenishment orders, and access the product catalog with no interruptions and minimal latency. This is how Atlas Edge Server bridges the gap between connected retail stores and the cloud.

Without further ado, let's dive in and get started!

## Prerequisites

For this next phase, we'll need to ensure we have all the prerequisites from Part 1 in place, as well as some additional requirements related to integrating Edge Server. Here are the extra tools you'll need:

- **Docker** (version 24 or higher): Docker allows us to package our application into containers, making it easy to deploy and manage across different environments. Since Edge Server is a containerized product, Docker is essential to run it. You can choose to install Docker Engine alone if you're using one of the supported platforms or as part of the Docker Desktop package for other platforms.
- **Docker Compose** (version 2.24 or higher): Docker Compose is a tool for defining and running multi-container Docker applications. The Edge Server package deploys a group of containers that need to be orchestrated effectively. If you have installed Docker Desktop in the previous step, Docker Compose will be available by default. For Linux users, you can install Docker Compose manually from this page: Install the Docker Compose plugin.
- **edgectl** (version 0.23.2 or higher): edgectl is the CLI tool for Edge Server, allowing you to manage and interact with Edge Server instances. To install this tool, you can visit the official documentation on how to configure Edge Server or simply run the following command in your terminal: `curl https://services.cloud.mongodb.com/edge/install.sh | bash`.

With these additional tools in place, we'll be ready to take our inventory management system to the next level.

## A quick recap

Alright, let's do a quick recap of what we should have in place already:

- **Sample database**: We created a sample database with a variety of collections, each serving a specific purpose in our inventory management system. From tracking products and transactions to managing user roles, our database laid the groundwork for a single view of inventory.
- **App Services back end**: Leveraging Atlas App Services, we configured our app back end with triggers, functions, HTTPS endpoints, and the Data API. This setup enabled seamless communication between our application and the database, facilitating real-time responses to events.
- **Search Indexes**: We enhanced our system's search capabilities by setting up Search Indexes. This allows for efficient full-text search and filtering, improving the user experience and query performance.
- **Atlas Charts**: We integrated Atlas Charts to visualize product information and analytics through intuitive dashboards. With visually appealing insights, we can make informed decisions and optimize our inventory management strategy.

 documentation.

Follow these instructions to set up and run Edge Server on your own device:

We will configure Edge Server using the command-line tool edgectl. By default, this tool will be installed at `.mongodb-edge` in your home directory. You can reference the entire path to use this tool, `~/.mongodb-edge/bin/edgectl`, or simply add it to your `PATH` by running the command below: 

```
export PATH="~/.mongodb-edge/bin/:$PATH"
```

The next command will generate a docker-compose file in your current directory with all the necessary steps to deploy and manage your Edge Server instance. Replace `` with the value obtained in the first part of this tutorial series, and `` with the token generated in the previous section.

```
edgectl init --platform compose --app-id  --registration-token  --insecure-disable-auth
```

> Note: To learn more about each of the config flags, visit our documentation on how to install and configure Edge Server.

This application is able to simulate offline scenarios by setting the edge server connectivity off. In order to enable this feature in Edge Server, run the command below.

```
edgectl offline-demo setup
```

- Atlas Edge Server
- How Atlas Edge Server Bridges the Gap Between Connected Retail Stores and the Cloud
- Grainger Innovates at the Edge With MongoDB Atlas Device Sync and Machine Learning

  [1]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt8ea62e50ad7e7a88/66293b9985518c840a558497/1.png
  [2]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt43b8b288aa9fe608/66293bb6cac8480a1228e08b/2.png
  [3]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltf2995665e6146367/66293bccb054417d969a04b5/3.png
  [4]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt5fad48387c6d5355/66293bdb33301d293a892dd1/4.png
  [5]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt480ffa6b4b77dbc0/66293bed33301d8bcb892dd5/5.png
  [6]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltc5f671f8c40b9e2e/66293c0458ce881776c309ed/6.png
  [7]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/bltd31d0f728d5ec83c/66293c16b8b5ce162edc25d0/7.png
  [8]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt3c061edca6899a69/66293c2cb0ec77e21cd6e8e4/8.png
  [9]: https://images.contentstack.io/v3/assets/blt39790b633ee0d5a7/blt2d7fd9a68a6fa499/66293c4281c884eb36380366/9.gif