Case-Study on how Industries are using MongoDB

Case-Study on how Industries are using MongoDB

MongoDB : An Introduction

MongoDB, the most popular NoSQL database, is an open-source document-oriented database. The term ‘NoSQL’ means ‘non-relational'. It means that MongoDB isn’t based on the table-like relational database structure but provides an altogether different mechanism for storage and retrieval of data. This format of storage is called BSON ( similar to JSON format).

SQL databases store data in tabular format. This data is stored in a predefined data model which is not very much flexible for today’s real-world highly growing applications. Modern applications are more networked, social, and interactive than ever. Applications are storing more and more data and are accessing it at higher rates.

Relational Database Management System(RDBMS) is not the correct choice when it comes to handling big data by the virtue of their design since they are not horizontally scalable. If the database runs on a single server, then it will reach a scaling limit. NoSQL databases are more scalable and provide superior performance. MongoDB is such a NoSQL database that scales by adding more and more servers and increases productivity with its flexible document model.

No alt text provided for this image

Features of MongoDB:

  •  Document Oriented: MongoDB stores the main subject in the minimal number of documents and not by breaking it up into multiple relational structures like RDBMS. For example, it stores all the information of a computer in a single document called Computer and not in distinct relational structures like CPU, RAM, Hard disk, etc.
  • Indexing: Without indexing, a database would have to scan every document of a collection to select those that match the query which would be inefficient. So, for efficient searching Indexing is a must and MongoDB uses it to process huge volumes of data in very less time.
  • Scalability: MongoDB scales horizontally using sharding (partitioning data across various servers). Data is partitioned into data chunks using the shard key, and these data chunks are evenly distributed across shards that resides across many physical servers. Also, new machines can be added to a running database.
  • Replication and High Availability: MongoDB increases the data availability with multiple copies of data on different servers. By providing redundancy, it protects the database from hardware failures. If one server goes down, the data can be retrieved easily from other active servers which also had the data stored on them.
  • Aggregation: Aggregation operations process data records and return the computed results. It is similar to the GROUPBY clause in SQL. A few aggregation expressions are sum, avg, min, max, etc

RDBMS vs MongoDB:

  • RDBMS has a typical schema design that shows number of tables and the relationship between these tables whereas MongoDB is document-oriented. There is no concept of schema or relationship.
  • Complex transactions are not supported in MongoDB because complex join operations are not available.
  • MongoDB allows a highly flexible and scalable document structure. For example, one data document of a collection in MongoDB can have two fields whereas the other document in the same collection can have four.
  • MongoDB is faster as compared to RDBMS due to efficient indexing and storage techniques.
  • There are a few terms which are related in both the databases. What’s called Table in RDBMS is called a Collection in MongoDB. Similarly, a Tuple is called a Document and A Column is called a Field. MongoDB provides a default ‘_id’ (if not provided explicitly) which is a 12 byte hexadecimal number which assures the uniqueness of every document. It is similar to the Primary key in RDBMS.

Bosch Leads Charge into the Internet of Things :

No alt text provided for this image

Things (e.g., devices, assets) are getting more intelligent. And every day, more and more of them are connecting to the Internet. This is forming the Internet of Things (IoT).

There’s no company more connected to this trend than the Bosch Group, a multinational engineering conglomerate with nearly 300,000 employees. Known for its appliances in the U.S., Bosch is also the world’s largest automotive components manufacturer. From smart power tools and advanced telematics to microelectromechanical systems (MEMS), it's at the forefront of IoT.

With such a wide-reaching, diverse product base, IoT represents a huge opportunity for the Bosch Group to increase efficiency and to develop new business models. It also poses a significant challenge, to design, develop and operate innovative software and industry solutions in the IoT. Bosch Software Innovations (Bosch SI) spearheads all IoT activities inside the Bosch Group and helps their internal and external customers to be successful in the IoT.

IoT is in its infancy, but growing up fast. By some estimates, 50 billion devices, appliances and systems will be connected by 2020. Traditional systems cannot support the volume, speed and complexity of data being generated across such a vast spectrum of potential use cases. Bosch SI was looking for an innovative partner to meet the challenges of Big Data in IoT.

IoT data made valuable

IoT goes beyond simply connecting assets and devices. It requires creating services that gather data and deliver immediate insight. The Bosch IoT Suite and the integrated database from MongoDB make this possible.

Take, for example, the automotive field data app that Bosch is piloting. The app captures data from the vehicle, such as the braking system, power steering and windshield wipers. The data can then be used to improve diagnostics for preventative maintenance needs, as well as analyze how components are performing in the field. The value isn’t simply in the sensor attached to the electromagnetic components, but in how the back-end service is able to improve maintenance and product design processes.

In another example, an app based on the Bosch SI technology gives aircraft manufactures unprecedented control over how operators use highly advanced power tools used to tighten the six million screws, nuts and bolts on an airplane -- a mission-critical job with zero room for error.

The app captures all data transmitted wirelessly, including battery level, operator details and time-series calibration readings. If the torque or angle is off by the slightest bit, the app sets off an alarm so the operator can make on-the-fly adjustments. It manages maintenance schedules, tracks and traces details to prevent loss, and also creates an audit trail of tightening processes for compliance with the FAA and other regulatory bodies. By connecting data to manufacturing processes in real-time, the app makes that power tool exponentially more powerful.

In both instances, the Bosch IoT Suite collects data from individual sensors and equipment – the car’s braking system, or the wireless tightening tool. MongoDB stores, manages and analyzes all of this event data in real-time. MongoDB also stores business rules that trigger alarms and notifications, such as "alert driver when brake pressure drops below a certain level" or "send alarm when tool is being used incorrectly."

Data management reimagined for IoT

The massive volume and increasingly unstructured nature of IoT data has put new demands on Bosch SI's entire technology stack, especially the underlying database. Rigidly defined RDBMS data models have limited use in IoT. They lack the flexibility, scale and real-time analytics needed to quickly capture, share, process and analyze IoT data.

IoT calls for a new mindset, and a new database. MongoDB helped Bosch SI reimagine what’s possible. Here’s how:

  • Manage complex data types. IoT data arrives at higher speeds, in greater volumes and variability of structure. MongoDB can easily handle the full spectrum of data: structured, semi-structured, unstructured. Efficient modeling of data using JSON makes it easy to map the information model of the device to its associated document in the database.
  • Support continuous innovation and business agility. Changes in IoT customer requirements, standards and use cases will require frequent data model changes. MongoDB’s dynamic schema supports agile, iterative development methodologies and makes it simple to evolve an app. Adding new devices, sensors and assets is straightforward, even when you’re dealing with multiple versions in the field concurrently. Instead of wasting time dealing with the mismatch between programming language and the database, MongoDB lets developers focus on creating rich, functional apps.
  • Create a unified view. Creating a single view of an asset or customer with a relational database is complicated. Source schema changes require additional changes to the single view schema. MongoDB makes it easy to aggregate multiple views of related data from different source systems into one unified view.
  • Power operational insight with real-time analysis. Apps handling fast-moving IoT data can’t wait on ETL processes to replicate data to a data warehouse. They need to react and respond in real time. MongoDB’s rich indexing and querying capabilities – including secondary, geospatial and text search indexes, the Aggregation Framework and native MapReduce – allow users to ask complex questions of the data, leading to real-time operational insight and business discovery.
  • Be enterprise-ready. MongoDB complements agility with enterprise-grade availability, security and scalability. Zero downtime with replica sets. Proven database security with authentication, authorization, auditing and encryption. Cost-effective scale-out across commodity hardware with auto-sharding. As IoT data volumes continue to explode, Bosch will be able to efficiently scale without imposing additional complexity on development teams or additional cost on the business.

A bet that paid off

Bosch SI is making a strategic bet on MongoDB to drive innovative apps in every industry where it does business. It can improve the retail shopping experience with in-store maps and personalized notifications. Create safer working conditions in manufacturing environments. Trace agriculture through the food chain to support farm-to-table initiatives.

The use cases are limitless. And MongoDB makes every single one possible.

The IoT market is exploding and Bosch is moving quickly. Bosch SI is continuing development on new apps and working closely with MongoDB to scale up existing apps – like growing a three million car pilot to a 300 million car application.

With MongoDB, scale-out will be fast, reliable and cost-effective.

As a technology provider, partner and fellow innovator, MongoDB is in lock-step with Bosch SI. Bosch SI is accelerating implementation of new IoT apps and business models, ensuring the business units and customers it serves don’t miss a beat as new generations of sensors and equipment come online.

SEGA HARDlight Migrates to MongoDB Atlas to Simplify Ops and Improve Experience for Millions of Mobile Gamers

No alt text provided for this image

It was way back in the summer of ‘91 that Sonic the Hedgehog first chased rings across our 2D screens. Gaming has come a long way since then. From a static TV and console setup in ‘91, to online PC gaming in the noughties and now to mobile and virtual reality. Surprisingly, for most of those 25 years, the underlying infrastructure that powered these games hasn’t really changed much at all. It was all relational databases. But with ever increasing need for scale, flexibility and creativity in games, that’s changing fast. SEGA HARDlight is leading this shift by adopting a DevOps culture and using MongoDB Atlas, the cloud hosted MongoDB service, to deliver the best possible gaming experience.

Bringing Icons to Mobile Games

SEGA HARDlight is a mobile development studio for SEGA, a gaming company you might have heard of. Based in the UK’s Royal Leamington Spa, SEGA HARDlight is well known for bringing the much-loved blue mascot Sonic the Hedgehog to the small screen. Along with a range of Sonic games, HARDlight is also responsible for building and running a number of other iconic titles such as Crazy Taxi: City Rush and Kingdom Conquest: Dark Empire.

No alt text provided for this image

Earlier versions of the mobile games such as Sonic Jump and Sonic Dash didn’t require a connection to the internet and had no server functionality. As they were relatively static games, developers initially supported the releases with an in-house tech stack based around Java and MySQL and hosted in SEGA HARDlight’s own data centre.

The standard practice for launching these games involved load testing the servers to the point of breaking, then provisioning the resources to handle an acceptable failure point. This limited application functionality, and could cause service outages when reaching the provisioned resources’ breaking point. As the games started to add more online functionality and increased in popularity, that traditional stack started to creak.

Massive Adoption: Spiky Traffic

Mobile games have an interesting load pattern. People flock in extreme numbers very soon after the release. For the most popular games, this can mean many millions people in just a few days or even hours. The peak is usually short and then quickly drops to a long tail of dedicated players. Provisioning for this kind of traffic with a dynamic game is a major headache. The graph from the Crazy Taxi: City Rush launch in 2014 demonstrates just how spiky the traffic can be.

No alt text provided for this image

We spoke with Yordan Gyurchev, Technical Director at SEGA HARDlight, who explained: “With these massive volumes even minor changes in the database have a big impact. To provide a perfect gaming experience developers need to be intimately familiar with the performance trade-offs of the database they’re using,”

No alt text provided for this image

Supersonic Scaling

SEGA HARDlight knew that the games were only going to get more online functionality and generate even more massive bursts of user activity. Much of the gaming data was also account-based so it didn’t fit naturally in the rows and columns of relational databases. In order to address these limitations, the team searched for alternatives. After reviewing Cassandra and Couchbase, but feeling they were either too complex to manage or didn’t have the mature support needed to support the company’s SLAs, the HARDlight engineers looked to MongoDB Atlas, the MongoDB database as a service.

Then came extensive evaluations and testing across multiple dimensions such as cost, maintenance, monitoring and backups. It was well known that MongoDB natively had the scalability and flexibility to handle large volumes and always-on deployments but HARDlight’s team had to have support on the operations side too.

Advanced operational tooling in MongoDB Atlas gave a small DevOps team of just two staffers the ability to handle and run games even as millions of people join the fray. They no longer had to worry about maintenance, upgrades or backups. In fact, one of the clinchers was the point in time backup and restore feature which meant that they can roll back to a checkpoint with the click of a button. With MongoDB Atlas and running on AWS, SEGA HARDlight was ready to take on even Boss Level scaling.

“At HARDlight we’re passionate about finding the right tool for the job. For us we could see that using a horizontally scalable document database was a perfect fit for player-account based games,” said Yordan.

“The ability to create a high traffic volume, highly scalable solution is about knowing the tiny details. To do that, normally engineers need to focus on many different parts of the stack but MongoDB Atlas and MongoDB’s support gives us a considerable shortcut. If this was handled in-house we would only be as good as our database expert. Now we can rely on a wealth of knowledge, expertise and best in class technology.”

Sonic Forces

HARDlight’s first MongoDB powered game was Kingdom Conquest: Dark Empire which was a frictionless launch from the start and gave the engineers their first experiences of MongoDB. Then in a weekend in late 2017 Sonic Forces: Speed Battle was launched on mobile. It’s a demanding, always-on application that enables constant connection to the internet and shared leaderboards. In the background a 3 shard cluster running on MongoDB Atlas easily scaled to handle the complex loads as millions of gamers joined the race. The database was stable with low latencies and not a single service interruption. All of this resulted in a low stress launch, a happy DevOps team and a very enthusiastic set of gamers.

No alt text provided for this image

Yordan concluded: “With MySQL, it had taken multiple game launches to get the database backend right. With MongoDB Atlas, big launches were a success right from the start. That’s no mean feat.”

Just as the gaming platforms have evolved and transformed through the years, so too has the database layer had to grow and adapt. SEGA HARDlight is now expanding its use of MongoDB Atlas to support all new games as they come online. By taking care of the operations, management and scaling, MongoDB Atlas lets HARDlight focus on building and running some of the most iconic games in the world. And doing it with confidence.

Gone is the 90s infrastructure. Replaced by a stack that is every bit as modern, powerful and fast as the famous blue hedgehog.0

要查看或添加评论,请登录

社区洞察

其他会员也浏览了