Agile development with NoSQL for Faster Time to Market

November 16, 2016

Contributed by Sandra Wiecki

With digital transformation, software has become the most important tool to attract, keep and grow customer accounts. For a company to stay competitive in a market, its digital offerings need to stay up-to-date with modern technology, cool competitive features and growing user expectations.

Digital offerings are now a business imperative, as companies can easily lose clientele because a competitor has a better website experience, an easier-to-use mobile app, smarter customer service, or cloud-based offerings.

To keep up with these expectations, many companies turn to agile development models. They do Scrum, implement Kanban, build DevOps teams, work with containers and the cloud, develop in JavaScript, and use NoSQL.

Thanks to all of the above and unlike a physical product, software can be modified almost in the blink of an eye. Some companies release software every two weeks while others make changes many times a day.

This blog will take a look at how JavaScript shaped our digital world and how NoSQL gives developers control and flexibility, as well as the ability to store big data to develop modern web, mobile, and Internet of Things (IoT) applications quickly.

The Rise of JavaScript

We see customers using Java, C and C++, but also a growing number of JavaScript users, especially for web and mobile development.

While simple HTML websites are static, JavaScript makes websites interactive by providing intelligent user interfaces (UI) and serving content flexibly based on user needs. Over the years, as the Internet has found its way into our offices and living rooms, the interaction with customers and the user experience have gained significantly in importance.

JavaScript has risen in lockstep with the rise of the Internet. What was created in 1995 as a simple scripting language for the Web has become one of the most important scripting languages today. Some might even consider JavaScript to be the universal language amongst developers.

JavaScript’s support for various programming styles including object-orientation, first-class functions, arrays, and regular expressions gives developers flexibility and makes them work efficiently and innovatively to meet the needs set forth above.

While there were no programming standards for JavaScript in the beginning, this changed with jQuery in 2005. Nowadays, JavaScript complies with the EcmaScript (ES) standard. So do all popular Web browsers. Thanks to this compatibility, JavaScript is agnostic with respect to hardware platforms and server technologies, which allows developers to implement new features without worrying about compatibility.

In addition to standards, UI frameworks like Angular, Backbone or React contribute to JavaScript’s popularity. Thanks to these open-source libraries, business logic like data validation and security can now be handled easily by the client browser allowing developers to take control of user input.

But JavaScript has become bigger than being just a scripting language for Web applications. With Node.js, for example, it has started being used to develop desktop and mobile applications, as well as server-side programming. While Node.js is not a JavaScript framework per se, it allows developers to build applications using JavaScript and thus has become very popular.

The Rise of NoSQL

Relational database management systems have dominated the IT landscape for more than 40 years and they still are the most reliable and secure options today. However, they have not been designed for all of the workloads of the 21st century. Hence the rise of new models.

Modern technologies like JavaScript applications need modern data management solutions.

This is why unstructured data types like JSON, and databases to work with them, emerged. NoSQL does not describe one single technology; it is rather a variety of non-relational technologies and architectures aiming to address the challenges of new use cases.

One type of NoSQL technology is JSON. JSON stands for JavaScript Object Notation and is a document data type to store data in a human-readable collection rather than in columns and rows. While data types in a relational database are specific and static, JSON can store any type of data. Data in one document can look very different from data in another document.

Benefits of JSON

While designing a database schema for a relational database often involves a team of developers, database architects, DBAs, and business users, creating a JSON document does not.

With JSON, developers have the flexibility to store any kind of data without prior planning, which allows them to start development sooner. They can also go through many iterations of data changes without having to rely on and wait for a DBA to implement those changes. All they need to do is change their application code. This is why many developers love JSON.

Due to its flexibility, JSON is often used for unstructured, non-standard, or rapidly changing data.

JSON also has a performance benefit over relational data. When storing all related data about a user, process or thing within one JSON document, “joins” become mostly unnecessary. Joins are costly and reducing them to a minimum saves query time.

One good example to demonstrate a valid use for the JSON data type is a B2C catalog. While some data types are static, easily defined and common to all items, other data might not be. One can assume that every product has a name and a description and probably some other data in common. Not every product has data like “batteries included”, “water resistant depth” or “age restriction”. While data patterns are best stored in a relational data type field, unusual product properties can be stored flexibly using a JSON data type.

Another valid use case is the collection of data from various sources – sensor data for example. When using sensors from different vendors, data might be submitted in different formats. While a relational database would require this data to be standardized, JSON allows the storage of this data as is.

NoSQL Caveats

JSON is a non-relational data type. Hence when using JSON, you are giving up some of the benefits of relational database models, such as the relational structure, schema control, and data governance.

While NoSQL’s flexible data structure is its greatest benefit, it can also be a disadvantage.

The relational model aims to normalize data to eliminate redundancy and reduce storage. The NoSQL data type does not. If ten employees work for the same department and the same manager, the department name and the manager’s name will be stored 10 times. This introduces data redundancy and a possibility that data gets out of sync. The manager’s name might be spelled “Johnson” nine times and “Jonson” once. Querying for employees working for Mr Johnson will now show nine employees instead of ten.

NoSQL itself also does not offer data verification. For example, instead of using the valid zip code “01730”, the data type would also accept “0173”. Unless your application—possibly using a JavaScript UI framework—validates data, you can end up with invalid or inconsistent data.

Many applications, especially off-the-shelf applications, require a fixed data structure to be able to work with the data. Using JSON might not be an option in this case.

NoSQL-only Technologies

Some vendors base their database entirely on NoSQL. Besides offering JSON’s flexible data model, these technologies and architectures are designed to scale-out horizontally to cope with big data. This scalability comes at a price though.

In order to achieve this level of horizontal scalability some NoSQL-only technologies trade data integrity. Instead of ACID (Atomicity, Consistency, Isolation, Durability) compliance, which is the foundation of database transactions, these databases offer BASE (Basic Availability, Soft-state, Eventual consistency).

While this trade-off can be easily made for some use cases, it should not be made in others.

This might be true for extreme cases of big data that need to be captured, but losing a click here and a “like” there is not critical to your business. If that is the case, a NoSQL-only technology will do the job.

While this means that you are giving up the relational view of data within the database itself, EDB Postgres helps you to integrate this solution with the rest of your data, thereby building a relational view on top of NoSQL-only databases.

EDB Postgres Data Adapters allow you to connect to external data sources like MongoDB or Hadoop to query and join data with data in EDB Postgres building a data platform viewing your enterprise data in one single place making it accessible for company-wide analytics through a standard SQL interface.

NoSQL with EDB Postgres

PostgreSQL is a traditional relational DBMS, but has been adapted to the changing needs of data management. It has become a multi-model database, offering NoSQL capabilities with many traditional relational benefits. PostgreSQL is also object-relational, meaning that it can add new complex data types and the operators required to handle them and allow it to extend and accommodate new capabilities like JSON support. For the EDB Postgres Platform, EnterpriseDB (EDB) extends PostgreSQL with enterprise-class performance, security, and management enhancements.

Relational data helps you to see relations between data. When having different records about one particular user or process, a relational database makes it easy to identify those relationships to help you gain more insight into behaviour or processes than just collecting data.

Due to EDB Postgres’ relational capabilities, you can add check constraints on JSON nodes to validate data or make sure that some nodes must not be null.

EDB Postgres also offers ACID compliance. This means that NoSQL can now be used in database transactions where data modifications have to either be guaranteed or rolled back. ACID guarantees that the database is at all times in a consistent state or can be recovered to a consistent state. This is not the case with all NoSQL database vendors.

EDB Postgres also has reliable multi-version concurrency control (MVCC), which allows every single query to see a consistent point-in-time snapshot of the data, instead of seeing data that has been added or modified after the query was started. This functionality is crucial to pull valid data from a database in a multi-user environment.

While I think that NoSQL is great for flexibility, I see that many enterprises do not want to fully trade the benefits of the relational data model for horizontal scalability, especially when horizontal scalability is not even required by the application.

We see the advantages of NoSQL—including an accelerated time to market—but we also see that over time data structures evolve. With JSON, EDB Postgres allows you to start developing using a flexible data model. Once data patterns emerge, you can implement those structures as relational data types without the effort of migrating to another database.

With JSON in EDB Postgres you can use a resilient data store for persistence and for storing and serving up of content while retaining the flexible document-oriented approaches that are a good match or JavaScript programming.

Summary

NoSQL is a great opportunity to flexibly develop applications and to get them out to your staff and customers sooner, allowing you to manage your digital transformation staying ahead in competitive markets.

Relational databases stand firm and have not lost in importance. Instead of replacing relational databases, I believe that NoSQL is a valuable addition to them.

EDB Postgres offers NoSQL as a capability embedded in its relational framework for data integrity, reliability and better insight into how data relates to other data giving you the best of both worlds.

When horizontal scalability is paramount, you can leverage the capabilities of NoSQL-only data stores with EDB Postgres. EDB Postgres allows you to eliminate data silos by integrating NoSQL only databases into your data platform to make best use of all your enterprise data.

In any case, it makes sense to be clear about the requirements and the desired outcome of your project. Make sure to talk to us about finding the best data management solution.

Sandra Wiecki is Director, Product Marketing at EnterpriseDB. 

Share this

Relevant Blogs

How to Choose Which Database to Use

Some notes  What is SQL database? What is NoSQL database? NoSQL types of databases  (Document oriented, columnar, keyvalue and Graph) Relational Vs Document (NoSQL) key differences.  Today, many people are selecting...
October 21, 2020

StackBuilder Package Updates

If you've ever used one of the PostgreSQL installers for v8.2 or above, either the old Windows MSI installer or the newer "one click" installers that also support Linux and...
October 05, 2011