Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Local Development with the MongoDB Atlas CLI and Docker

Need a consistent development and deployment experience as developers work across teams and use different machines for their daily tasks? That is where Docker has you covered with containers. A common experience might include running a local version of MongoDB Community in a container and an application in another container. This strategy works for some organizations, but what if you want to leverage all the benefits that come with MongoDB Atlas in addition to a container strategy for your application development?

In this tutorial we’ll see how to create a MongoDB-compatible web application, bundle it into a container with Docker, and manage creation as well as destruction for MongoDB Atlas with the Atlas CLI during container deployment.

Read More

Getting Started with MongoDB Atlas and Azure Functions using Node.js

So you’re building serverless applications with Microsoft Azure Functions, but you need to persist data to a database. What do you do about controlling the number of concurrent connections to your database from the function? What happens if the function currently connected to your database shuts down or a new instance comes online to scale with demand?

The concept of serverless in general, whether that be through a function or database, is great because it is designed for the modern application. Applications that scale on-demand reduce the maintenance overhead and applications that are pay as you go reduce unnecessary costs.

In this tutorial, we’re going to see just how easy it is to interact with MongoDB Atlas using Azure functions. If you’re not familiar with MongoDB, it offers a flexible document model that can be used to model your data for a variety of use cases and is easily integrated into most application development stacks. On top of the document model, MongoDB Atlas makes it just as easy to scale your database to meet demand as it does your Azure Function.

Read More

Developing Your Applications More Efficiently with MongoDB Atlas Serverless Instances

If you’re a developer, worrying about your database is not necessarily something you want to do. You likely don’t want to spend your time provisioning or sizing clusters as the demand of your application changes. You probably also don’t want to worry about breaking the bank if you’ve scaled something incorrectly.

With MongoDB Atlas, you have a few deployment options to choose from when it comes to your database. While you could choose a pre-provisioned shared or dedicated cluster, you’re still stuck having to size and estimate the database resources you will need and subsequently managing your cluster capacity to best fit demand. While a pre-provisioned cluster isn’t necessarily a bad thing, it might not make sense if your development becomes idle or you’re expecting frequent periods of growth or decline. Instead, you can opt for a serverless instance to help remove the capacity management burden and free up time to dedicate to writing code. Serverless instances provide an on-demand database endpoint for your application that will automatically scale up and down to zero with application demand and only charge you based on your usage.

In this short and sweet tutorial, we’ll see how easy it is to get started with a MongoDB Atlas serverless instance and how to begin to develop an application against it.

Read More

Creating a User Profile Store for a Game With Node.js and MongoDB

When it comes to game development, or at least game development that has an online component to it, you’re going to stumble into the territory of user profile stores. These are essentially records for each of your players and these records contain everything from account information to what they’ve accomplished in the game.

Take the game Plummeting People that some of us at MongoDB (Karen Huaulme, Adrienne Tacke, and Nic Raboy) are building, streaming, and writing about. The idea behind this game, as described in a previous article, is to create a Fall Guys: Ultimate Knockout tribute game with our own spin on it.

Since this game will be an online multiplayer game, each player needs to retain game-play information such as how many times they’ve won, what costumes they’ve unlocked, etc. This information would exist inside a user profile document.

In this tutorial, we’re going to see how to design a user profile store and then build a backend component using Node.js and MongoDB Realm for interacting with it.

Read More

Maintaining a Geolocation Specific Game Leaderboard with Phaser and MongoDB

When it comes to game development, an often forgotten component comes in the form of a database for storing gameplay information. The database can contribute to numerous roles, such as storing user profile information, game state, and so much more.

In fact, I created a previous tutorial titled Creating a Multiplayer Drawing Game with Phaser and MongoDB. In this drawing example, every brushstroke made was stored in MongoDB.

In this tutorial, we’re going to look at a different data component for a game. We’re going to explore leaderboards and some of the neat things you can do with them. Like my other tutorial, we’ll be using Phaser and JavaScript.

Read More

Getting Started with Building Chatbots using AWS Lex and Node.js

Amazon and a lot of cloud vendors such as Microsoft and Google have services around machine learning (ML), artificial intelligence (AI), and virtual assistants. A popular one that might come to mind is Amazon Alexa, something I’ve written quite a few tutorials around over the years.

The concept around Alexa is simple. Provide the Alexa service some audio, have that audio converted into text or some other format that can be evaluated, execute some code, and respond with something to be spoken to the user. However, what if you didn’t necessarily want to use a virtual assistant with audio, but integrate as part of a chat application in the form of a chatbot?

In this tutorial we’re going to look at using Amazon Web Services (AWS) Lex, which is a service for adding conversational interfaces to your applications. If you’re coming from an Amazon Alexa background, the concepts will be similar as AWS Lex shares the same deep learning technologies.

Read More

Password Hashing and JWTs for NativeScript Apps with an Express.js Backend

When building an application that allows users to have accounts, you have to ensure that access to these accounts is secure. When building a user account system, an important factor to keep in mind is how passwords are stored. Storing passwords as plain text is a complete rookie move that leaves your users vulnerable to all sorts of data breaches.

The best way to protect passwords is to employ hashing and salting and in this tutorial, we’ll show you exactly how to do this. We’ll also show you how to generate JSON Web Tokens (JWT) on a Node.js server backend that can be used to authenticate and authorize users, as well as how to store those tokens on the client NativeScript application.

Read More