Posts

Showing posts with the label MongoDB

Aspire

.NET Aspire  .NET Aspire is .NET 8 way to build cloud-based web apps with microservices and easier integration with Redis, MongoDB, and PostgreSQL . The Aspire components have health checks and telemetry built in.    .NET Aspire - is an opinionated, cloud-ready stack for building observable, production ready, distributed applications.    - Cloud-native apps often consist of small, interconnected pieces or microservices rather than a single, monolithic code base.    - Cloud-native apps generally consume a large number of services, such as databases, messaging, and caching.    - App composition limits    - Orchestration - doesn't replace Kubernetes, but helps setup of service discovery, environment variables, and container configurations    - Components for services (Redis or Postgres). .NET Aspire components add health checks and telemetry.    - Tooling    - Cloud-native, observable, production read...

AngularJs & MongooseJS

 If MongoDB, then use MongooseJS (http://mongoosejs.com/) Advantages of Mongoose over usual MongoDB wrapper:  1. MongoDB uses named collections of arbitrary objects, and a Mongoose JS Model abstracts away this layer. Because of this, we don t have to deal with tasks such as asynchronously telling MongoDB to switch to that collection, or work with the annoying createFromHexString function.  2. Mongoose Models handle the grunt work of setting default values and validating data.  3. Mongoose lets us attach functions to our models  4. Mongoose handles limited sub-document population using manual references (i.e. no MongoDB DBRefs), which gives us the ability to mimic a familiar SQL join. Ways to use Mongoose correctly: 1) 1 Schema = 1 file 2) Mongoose can t handle multi-level population yet, and populated fields are not Documents. Nesting schemas is helpful but it s an incomplete solution. Design your schemas accordingly.   3) Declare your models exactly once a...