Introduction to MongoDb with .NET part 38: diagnostics

Introduction

In the previous post we learnt about building indexes for text fields in MongoDb documents. Index fields are very useful if you want to search for certain bits of text within a larger text. The text search does a very good job at finding the best matches. We can even ask MongoDb to rank the matching documents for us.

We’re actually done with the discussion regarding indexes in MongoDb. This post will give a brief overview over the diagnostics tools available in MongoDb. They help us extract a lot of useful information about what is going on within MongoDb.

Read more of this post

Introduction to MongoDb with .NET part 37: indexing text fields

Introduction

In the previous post we looked at various aspects of the query plan produced by the explain function. There are three query plan modes that correspond to an increasing level of details: query plan mode, execution stats mode and all plans execution mode. With the query plan mode we can quickly verify which strategy MongoDb will use to execute a query. Execution stats also tells the number of documents and index keys scanned and produced in each step. Finally the all plans execution mode shows how MongoDb selected a certain execution path by producing the details of any rejected plan as well.

In this post we’ll look at how to index text fields.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 13: the client token lookup service

Introduction

In the previous post we started looking at some code within the Code Pipeline job agent. We saw the ServletContextListener implementation that serves as the entry point into the application. The listener is wired up in the web.xml file. It is executed in the beginning of the application lifetime, i.e. when the web app starts. The implemented contextInitialized function constructs the necessary objects and dependencies that are necessary for the job agent.

In this post we’ll continue going through the code bit by bit.

Read more of this post

Introduction to MongoDb with .NET part 36: other bits and pieces about the query plan

Introduction

In the previous post we looked at a couple of options we can provide when creating an index. With a unique index we can ensure that only unique values can be inserted on a property. A sparse index is often used in conjunction with a unique index. It enables us to index fields that not every document has, i.e. where the field is null. In that case those documents won’t be indexed. Finally we looked at foreground vs. background index creation. If an index is created on a foreground thread then it is relatively fast but it also blocks all readers and writers in the database. Background index creation on the other hand is slower but doesn’t block other threads that want to read and write.

In this post we’ll look at a couple of things related to the explain function.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 12: the job agent entry point in code

Introduction

In the previous post we started looking into the Code Pipeline job agent application. The job agent can be any application that is capable of executing long-running threads that periodically communicates with a Code Pipeline endpoint through the AWS SDK. The model application we’re going to look at is a Java Maven web app. It can be deployed directly on a Tomcat server or in AWS Elastic Beanstalk – which is actually a wrapper around an EC2 server with Tomcat installed.

In this post we’ll start looking into some actual Java code within the job agent. Note that I won’t provide every single detail in this series as most of the code is related to our business and is therefore irrelevant to the current discussion. You should also have at least some experience with Maven and things like the web.xml file. I will also omit infrastructure related code such as reading the properties or logging with log4j as much as possible. I’ll only show that type of code where it would otherwise be difficult to follow where a certain variable is coming from. We’ll actually see some of that in this post. This is in order to minimise the “noise”. You are welcome to ask specific questions in the comments section.

Read more of this post

Introduction to MongoDb with .NET part 35: index options

Introduction

In the previous post we investigated how to create indexes within sub-documents. The dot notation which we saw when querying sub-documents also provides the syntax for deep indexing. We also quickly saw how to retrieve all indexes of a collection. In addition we learnt that array indexes are called multi-key indexes in MongoDb. The query plan returned by the explain function shows whether a certain index used for the query execution is multi-key or not.

In this post we’ll look at a couple of options available when creating indexes.

Read more of this post

Introduction to MongoDb with .NET part 34: indexing subdocuments

Introduction

In the previous post we looked at how to index arrays in MongoDb using the client shell. We saw that there wasn’t anything special in the JSON syntax, it is the same as when adding an index to a scalar field. There’s a limitation to indexing array fields though. We cannot index two or more array fields, only one at a time. It’s fine to index as many scalar fields as you want plus one array field, but not more than that.

In this post we’ll see how to index fields within subdocuments.

Read more of this post

Introduction to MongoDb with .NET part 33: indexing arrays

Introduction

In the previous post we looked at compound indexes in MongoDb. Compound indexes can be useful if you’d like to make multi-field searches more efficient. E.g. if there’s a frequent search with a filter on “name” and “age” then a compound index is a good candidate to make the search more efficient. The exact sequence of the keys in the compound definition is important. The leftmost key is the primary key, followed by the secondary key and so on. A search on the secondary key field won’t use the compound index.

In this post we’ll look at indexing array fields.

Read more of this post

Introduction to MongoDb with .NET part 32: compound indexes

Introduction

In the previous post we created our first index on the zip codes collection using the Mongo shell. We inserted a text on the state property. We also got introduced to the explain function which presents a query plan with or without executing the query depending on the boolean parameter to the function. It’s a good strategy to run the explain function before and after the index creation. Your goal should be to reduce the amount of documents scanned as much as possible.

In this post we’ll take a look at compound indexes.

Read more of this post

Introduction to Amazon Code Pipeline with Java part 11: starting with the job agent

Introduction

In the previous post we looked a bit at the web pages that must be up and running for the third party action to work with code pipeline. There are 3 types of URL that must be set up. The external configuration URL defines a web page where the CP user can provide the necessary inputs for the job execution. The execution URL is where the CP user can follow the job execution, i.e. where you can show tables, graphs etc. that show the job progress. Lastly we have the entity URL which is a web page to show some resources or job summary page to the user.

In this post we’ll start looking into the job agent itself. It’s probably the largest component you’ll need to build for the CP integration.

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.