Introduction to MongoDb with .NET part 44: a summary

Introduction

In the previous post we saw how to set the read and write preferences for our MongoDb operations in code. We can set these options at various levels: at the client, at the database or at the collection level. We can also specify our preferences directly in the connection string.

The previous post was also the last in this series dedicated to MongoDb in .NET. We’ve come a long way and it’s time to summarise what we have learnt.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 17: the JobProcessor implementation

Introduction

In the previous post we continued to explore the job processor interface of the job agent. In particular we looked at the WorkResult object which holds a number of properties that describe the job result. These include a summary message, the failure reason, the progress made and various others.

In this post we’ll discuss a possible implementation of the JobProcessor interface. Note that the exact implementation will depend on your business since this is where the actual Code Pipeline work item is processed. Our implementation the interface is also very tightly coupled with the load testing domain of our business. Hence I won’t present every single detail around that code as much of it irrelevant for Code Pipeline and the job agent.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 16: the WorkResult object

Introduction

In the previous post we looked at the job processor interface of the Code Pipeline third party action job agent. The job processor is responsible for processing a new job item returned by polling a Code Pipeline endpoint. The interface has a single method called process which accepts a WorkItem object and returns a WorkResult object. We discussed the WorkItem object in detail. In this post we’ll go through the WorkItem object.

Read more of this post

Introduction to MongoDb with .NET part 43: the read and write preference in the .NET driver

Introduction

In the previous post we discussed the ideas of read preference and read concern in MongoDb. Both play a role in multi-server scenarios where we can give hints to MongoDb where we want to read the data from: the primary server, one of the secondaries, the one with the shortest response time etc.

In this post we’ll see how to set the read and write concern options in the MongoDb .NET driver.

Read more of this post

Introduction to MongoDb with .NET part 42: the read preference

Introduction

In the previous post we first discussed briefly what a replica set in MongoDb is. A replica set is a group of MongoDb servers that behave as a single unit in order to provide increased data availability. There is one primary node and 2 or more secondary nodes. The “w” part of write concern in a replica set can be set to the number of nodes which should all send an acknowledgement of the write/update operation. It can also be set to “majority” where we want an acknowledgement from the majority of the replica set nodes. We can also specify a tag value for “w” so that we wait for the servers with a specific tag to acknowledge the operation.

We eventually want to read from our database as well. An interesting question is where we want to read the data from in a replica set. This is where the read preference enters the picture. There’s also a related term called read concern which we’ll also go through in some details.

Read more of this post

Introduction to MongoDb with .NET part 41: the write concern in a replica set

Introduction

In the previous post we introduced the topic of write concern in MongoDb. The write concern consists of two parts. The ingredient “w” stands for “write” and we can set the level of acknowledgement with it. The default is 1 and it means that we wait for an acknowledgement that the write operation was persisted to memory. 0 means fire-and-forget, i.e. we send the write operation to MongoDb and we don’t want to wait for any type of acknowledgement. The other ingredient of the write concern is “j” which stands for journal. The journal is a log where MongoDb registers all changes to the collection and its documents. We can either wait for the journal to be persisted to disk or not worry about it.

In this post we’ll talk a little bit about replica sets and what the write concern means in that scenario.

Read more of this post

Introduction to MongoDb with .NET part 40: the write concern

Introduction

In the previous post we saw how indexes were handled in the in the MongoDb .NET driver. Normally MongoDb indexes are created through the mongo shell, but the driver also offers a couple of options just in case you need that.

In this post we’ll start the finishing phase in this series on MongoDb and .NET: write and read concerns. These terms are related to durability and consistency of the data in the database.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 15: the job processor interface and related objects

Introduction

In the previous post we looked at a helper class that’s responsible to carry out operations related to load tests. We didn’t actually look at any implementation details as those are bound to our business and don’t have much to do with Code Pipeline. However, it is still important to know its role so that we can follow the code examples. We also briefly looked at some other classes like the one that parses the string that describes the load test thresholds into “real” objects.

We are now ready to move on to the job processor interface and a couple of related objects. We’ll look at the implementation in a later post.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 14: the loadtest executor service

Introduction

In the previous post we took a closer look at how the client token lookup service could be implemented. The client lookup service is responsible for locating the Code Pipeline client token that matches the client ID which CP sends as the first signal of a new job. Without a matching client token CP won’t hand out the job details. It’s up to you how you implement the service exactly. The implementation details will probably depend on how you stored the client token and the client ID of a given user in your backend system.

In this post we’ll keep digging into the code in the job agent by looking at the LtpApiLoadtestJobExecutorService class.

Read more of this post

Introduction to MongoDb with .NET part 39: working with indexes in the MongoDb .NET driver

Introduction

In the previous post we went through a couple of diagnostics tools available in MongoDb. We mentioned the default logging tool which automatically logs all queries that took more than 100ms to complete. Then we looked at 3 tools that provide more details about what is going on in MongoDb: the profiler, mongotop and mongostat. They are great tools especially when we’re trying to optimise our queries. They also help debug our application by looking at the actual queries executed in the database.

This is the final post dedicated to indexing and performance in MongoDb. We’ll look at how to work with indexes in the MongoDb .NET driver.

Read more of this post

Elliot Balynn's Blog

A directory of wonderful thoughts

Software Engineering

Web development

Disparate Opinions

Various tidbits

chsakell's Blog

WEB APPLICATION DEVELOPMENT TUTORIALS WITH OPEN-SOURCE PROJECTS

Once Upon a Camayoc

ARCHIVED: Bite-size insight on Cyber Security for the not too technical.