NoSQL Simplifies Database DevOps
Relational databases certainly have uses, but NoSQL's approach to schema flexibility, impedance mismatches, and flexibility give it a leg up when implementing DevOps.
Join the DZone community and get the full member experience.Join For Free
the state of database devops is a survey on devops adoption rates among sql server professionals. over 1000 sql server professionals responded to the survey. the respondents came from across the globe and represent a wide range of job roles, company sizes, and industries.
there are some good findings in the survey results. a few key findings worth highlighting here:
the greatest challenge with integrating database changes into a devops process would still be synchronizing application and database changes
another one …
the greatest drawback identified with traditional siloed database development is the increased risk of failed deployments or downtime when introducing changes. this is closely followed by slow development and release cycles and the inability to respond quickly to changing business requirements
and another one …
increasing the speed of delivery of database changes and freeing developers up to do more value added work are the key drivers for automating the delivery of database changes
the challenges highlighted here are not mentioned in the context of sql server only, but would be applicable towards any relational database. you may be using oracle, postgres, mysql, mariadb, or any other relational database for that matter and would be very much facing these issues. why?
why is relational not well-suited for database devops?
it’s common for an application to operate on data from multiple tables in an rdbms. for example, placing an order may use customer, order and product tables. each table has multiple columns with standard data types specific to a database. tables may have primary, reference, and foreign key constraints. developers building applications using a relational database typically use an object relational mapper (orm), such as hibernate or java persistence api for java developers. there are similar orm for other languages as well. orms captures the underlying complex database structure and allow programmers to build applications naturally using their language.
orms also use a persistence provider and allows your application to be independent of the underlying database. this persistence provider creates a binding between the language-specific class to the database structure. for example, it maps a class to a table or multiple tables, binds the language data types to the types defined in the database and captures the relationship between tables. theoretically, a programmer can use a different persistence provider to use a different rdbms for the application. but this is far from a practical experience!
any database change requires the orm classes to be updated otherwise the application may not work. for example, adding a new table may mean a new java class or updating an existing class. change of a data type in a column requires the class definition to be updated otherwise the application will not even compile. adding a new column means adding a new field in the class. any change requires the classes to be updated and the application needs to be repackaged.
changes in database structure are required all the time to meet the evolving needs of a business. but if the dbas make a database change and the orm classes are not updated then there is a disconnect. application deployment needs to be coordinated with the updating the database schema. there are tools like flyway , liquibase , and others that integrate application and database deployment. but developers are often not allowed to make any direct changes to the production database. a disconnect would result in your application not working and the business to suffer. devops practices can definitely help solve these issues as it requires a close collaboration between developers that are building applications and dbas that are updating database scripts.
but as the survey reports, more than 50% of the respondents do not have devops adopted today.
there are challenges even if you were to integrate database changes into a devops process.
synchronizing application and database changes where the orm classes need to be synchronized with the backend database structure is the biggest challenge. dbas may want to structure the database in a certain way which may not be optimal for application development. applying consistency across application and database development is the next major challenge for ensuring a seamless database devops.
a siloed development has serious issues on your ability to rapidly innovate and deliver value to your business.
as shown in this image, failed deployments when introducing changes, slow development/release cycles and inability to respond to business needs account for over 60% of the drawbacks.
speed of delivery of database changes is the biggest concern for database devops.
so what do you do?
how does nosql simplify database devops?
nosql document database helps to simplify database devops!
how does nosql simplify database devops?
- schema flexibility – developers need a single database that can store rapidly changing structured, semi-structured and unstructured data. nosql document database offers schema flexibility by allowing developers operate directly on json data and derive meaning out of it
- no impedance mismatch – with no orm for the application, there is no impedance mismatch between domain classes and database structure. only the application code needs to be updated and no coordination is required with the schema changes
- scalability – one of the drawbacks mentioned in the report is the inability to adapt to changing business requirements. this highlights scalability as a major devops challenge. if the volume of data, the number of queries, or the types of indexes required to support the application changes the database needs to change to accommodate those changes. not in weeks or months, but today! no sql databases run on commodity hardware and has a scale-out architecture as opposed to scale-up with rdbms. sharding can help with scalability in rdbms but that’s an extra complexity that now need to be dealt with.
learn more about why enterprises move to nosql .
which nosql database is preferred by ge, marriott, verizon, united, linkedin, directv and many others?
what are some other advantages of couchbase ?
- homogeneous distributed architecture – no master/slave
- sql-like query language to query json documents
- auto-sharding using vbuckets
- memory-first architecture reduces the need for an additional caching layer
- cross-data center replication
- multiple sdks
- database on server or mobile device , with a complete synchronization between them
- different container orchestration frameworks
nosql is not a panacea by any means. if you are building a system that needs complex transaction logic or real-time data warehousing, then rdbms may be a better fit. however, it addresses your scalability and agility concerns and simplifies database devops.
here is a great video on migrating from a relational database to nosql:
here is another interesting video that shows why marriott transitioned from relational to nosql:
Published at DZone with permission of Arun Gupta, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.