Database Setup
Blink uses MongoDB as database. It's a NoSQL database. Integrating with MongoDB requires only connection string. You can self host your database in the cloud or you can use any managed database service provider like MongoDB Atlas.
tip
Managed MongoDB service is the quick and easy way to get started with MongoDB. MongoDB Atlas provides 512MB of free database storage, which is enough for small workload. Microsoft Azure Cosmos DB for MongoDB provides 32GB of free database storage.
- MongoDB Atlas: https://www.mongodb.com/atlas
- Microsoft Azure Cosmos DB for MongoDB: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/free-tier
Self Hosting
- Follow official MongoDB docs to self host the database: https://www.mongodb.com/docs/manual/self-managed-deployments/
- Get the connection string.
- Open your backend code in VS Code and open
.env
file, and write the MongoDB connection string there and save it.
Managed MongoDB Service
- Get the MongoDB connection string from your database provider.
- Open your
backend
code in VS Code and open.env
file, and write the MongoDB connection string there and save it.
MongoDB Connection String Example:
.env
# MongoDB URI
MONGODB_URI="mongodb+srv://*****************************************************/blink"
info
- How to get MongoDB Atlas Connection String: https://www.mongodb.com/docs/guides/atlas/connection-string
- How to get Azure Cosmos DB for MongoDB Connection String: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/connect-account#get-the-mongodb-connection-string-to-customize