MongoDB
-
How to Handle MongoDB Migrations with ts-migrate-mongoose
Database migrations are modifications made to a database. These modifications may include changing the schema of a table, updating the data in a set of records, seeding data or deleting a range of records. Database migrations are usually run before an application starts and do not run successfully more than once for the same database. Database migration tools save a history of migrations that have run in a database so that they can be tracked for future purposes. In this…
-
Use the FARM Stack to Develop Full Stack Apps
The FARM stack is a modern web development stack that combines three powerful technologies: FastAPI, React, and MongoDB. This full-stack solution provides developers with a robust set of tools to build scalable, efficient, and high-performance web applications. In this article, I’ll be giving you an introduction to each of the key technologies, and then we’ll build a project using the FARM stack and Docker so you can see how everything works together. This article is based on a course I…
-
Using Entity Framework Core with MongoDB
Entity Framework Core is a popular ORM (Object-Relational Mapper) for .NET applications, allowing developers to work with databases using .NET objects. It can be used with many types of databases, including MongoDB. In this article, you will learn how you can use Entity Framework Core with MongoDB. This article covers the basics, explains the benefits, and provides a step-by-step tutorial. Whether you’re new to MongoDB or Entity Framework Core, or just looking to integrate these tools into your .NET projects,…
-
How to Set Up a Fast API Application with a NoSQL Database
Introduction When developing Python applications, FastAPI stands out as a top choice for building high-performance solutions. It offers speed, simplicity, and support for asynchronous programming, making it ideal for developing modern, scalable applications. In this tutorial, we will walk you through the process of setting up a FastAPI application with a NoSQL database. When it comes to storing and managing data, NoSQL databases offer flexibility and scalability, making them a great fir doe applications that need to handle diverse and…
-
Building a To-Do List With MongoDB and Golang
Hi, there! Many have wondered how a simple task sheet or applications that provide such functionality work. In this article, I invite you to consider how you can write your small service in Go in a couple of hours and put everything in a database. Let’s start our journey with Golang and MongoDB. Why Golang? I want to show the keys: Minimalistic design and fast compilation Strong concurrency model with Goroutines and channels Huge ecosystem Cross-platform from the box…
-
How To Design a Document Schema in MongoDB
The author selected the Open Internet/Free Speech Fund to receive a donation as part of the Write for DOnations program. Introduction If you have a lot of experience working with relational databases, it can be difficult to move past the principles of the relational model, such as thinking in terms of tables and relationships. Document-oriented databases like MongoDB make it possible to break free from rigidity and limitations of the relational model. However, the flexibility and freedom that comes with…
-
Part 3: Transforming MongoDB CDC Event Messages
In our last blog post, we introduced a reference implementation for capturing change data capture (CDC) events from a MongoDB database using Debezium Server and Memphis.dev. At the end of the post, we noted that MongoDB records are serialized as strings in Debezium CDC messages like so: Python { “schema” : …, “payload” : { “before” : null, “after” : “{\\”_id\\”: {\\”$oid\\”: \\”645fe9eaf4790c34c8fcc2ed\\”},\\”creation_timestamp\\”: {\\”$date\\”: 1684007402978},\\”due_date\\”: {\\”$date\\”: 1684266602978},\\”description\\”: \\”buy milk\\”,\\”completed\\”: false}”, … } } We want to use the Schemaverse functionality…
-
Part 2: Change Data Capture (CDC) For MongoDB With Debezium and Memphis.dev
This is part two of a series of blog posts on building a modern event-driven system using Memphis.dev. Our last blog post introduced a reference implementation for capturing change data capture (CDC) events from a PostgreSQL database using Debezium Server and Memphis.dev. By replacing Apache Kafka with Memphis.dev, the solution substantially reduced the operational resources and overhead – saving money and freeing developers to focus on building new functionality. PostgreSQL is the only commonly used database, however. Debezium provides connectors for…
-
A Developer\’s Guide to Database Sharding With MongoDB
As a developer, you may encounter situations where your application’s database must handle large amounts of data. One way to manage this data effectively is through database sharding, a technique that distributes data across multiple servers or databases horizontally. Sharding can improve performance, scalability, and reliability by breaking up a large database into smaller, more manageable pieces called shards. In this article, we’ll explore the concept of database sharding, discuss various sharding strategies, and provide a step-by-step guide to implementing…