Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

MongoDB 4.2 (Beta) Announced at MongoDB World 2019

DZone 's Guide to

MongoDB 4.2 (Beta) Announced at MongoDB World 2019

Out of many new features of MongoDB 4.2, see a few that will really help the development community.

· Database Zone ·
Free Resource

This week at MongoDB World, Elliot Horowitz, CTO and Co-founder at MongoDB, announced many different new and exciting features in the MongoDB 4.2 release. Out of many new features, I am highlighting a few that will help the development community a lot.

Wildcard Indexes

MongoDB is known as a flexible database that contains different types of data models in one collection. This wildcard index will help a lot in applications where read-heavy operations are dependent on flexible document structures. With this index type, you can create an index on sub/embedded documents and make your reads fast.

As this feature is nice and very useful, it should be used wisely. Don't create your database into a wildcard index, as this will cost you a lot of space, and your write will be super slow.

//example from MongoDB World
{
  "_id: 5835,
    "product_name" : "t-shirt",
    "price" : 29.99 ,
    "attributes" : {
      "color" : "blue" ,
      "size"  : "small",
    }
}

db.inventory.createIndex( { "attributes.$**" : 1 } )
db.inventory.find( { "attributes.color" : "blue"} )

Full-Text Search

Full-text search is the ability to search anything in the string. This is a nice out-of-the-box feature from the database and helps in providing a good search facility in the application. I'd say it's not a replacement of any specialized search platforms like Elasticsearch, but for basic searching capabilities, it would be a nice feature without any additional infrastructure, platform and/or a need to learn or manage something new. 

Data Lake

With the new MongoDB Atlas Data lake capabilities, developers can query data in any format (JSON, BSON, CSV, TSV, Avro, and Parquet) from Amazon S3 by using MongoDB Query Language (MQL). This native support is a completely serverless infrastructure to set up or manage. At this point in time, they have not announced support for any other cloud (or object), so maybe in the future we will see more. 

In combination with the MongoDB chart, one can easily get the required data from S3 objects and present it in a visualized format. MongoDB also introduced an embedded charts feature, which will take this combination to the next level.

Field-Level Encryption

By providing field-level encryption or client-side encryption in the driver rather than data on fly or rest, even your database server has no knowledge of what is coming in and going out, as all encryptions and decryptions are being handled on the client-side drivers. The server only sees ciphertext without any knowledge of any keys. When your application pulls the data from the server to the driver, which already has keys and can decrypt the data and present it to the applications.

Just don't rely on FLE. However, with a combination of data at rest and fly, you can protect your application/data on multiple levels.

Other than these features, they have also announced features like on-Demand Materialized views, expression views, Agg Pipeline ++, Zstandard Compression, distributed transactions, and support for Kubernetes. 

What are your thoughts? Leave a comment in the comments section.

Topics:
mongodb ,nosql ,database ,database application ,big data application ,data lake ,mongodb world 2019

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}