Take this

Software Development / Web Development

Mastering Cassandra

Unleash the power of Cassandra to develop complex and feature-rich web applications for efficient data management


As technology evolves, the constant upsurge of data creation leads to a continuous need for a more flexible, secure, and reliable manner of storage. Luckily, Cassandra is able to tackle this growing challenge. Cassandra is a flagship NoSQL database with decentralized, fault-tolerant, scalable, and low-cost features making it a core component of cloud computing systems. The more recent versions have greatly improved the security features, making it suitable for use in enterprise systems. When combined with Java and Spring frameworks, Cassandra can formulate a complete application stack thereby enabling efficient data management.

Mastering Cassandra is a power house of various advanced techniques that will help you become an expert in professional-level data management. This video course starts off from the essence of the web application architecture to setting up the environment with a single-node Cassandra cluster, and takes you to a level where you can build, implement, and secure web applications with ease.

In this step-by-step guide we will develop a real-time web portal application in Java and Cassandra. We'll start off by touching upon the major components of a Java web application and the development tools for the course, and then go deeper into the system analysis and designing of the CassandraWebTrader focusing on the Spring Framework projects. Through our journey to master Cassandra, we'll be working with core concepts and design patterns such as dependency injection, aspect-oriented programming, model-view-controller, and enterprise integration patterns.

We'll build the CassandraWebTrader and implement all the typical functions of a web application as well as demonstrate the application of modeling-by-query techniques of Cassandra data modeling. In addition to this, we’ll understand the techniques and design trade-offs of a real-world complex system. Finally, we will ace production configuration of CassandraWebTrader and discuss the most pertinent tasks in our daily operations, such as application monitoring and database backup.

By the end of this course, you will be armed with all the knowledge needed to efficiently design and develop Java web applications using Cassandra.

Full details


  • Introducing Java Web Development
    The Course Overview
    Explain the sections of the course. • Describe the topic of each section • Highlight the contents of each section in sequence • Introduce a hands-on approach to maximize learning from the course
    Web Application Technologies
    Introduce the anatomy of a web application. Review the key concepts and the architectural components. • Introduce the anatomy of a web application • Introduce the wealthy choices of web technologies • Highlight the current and future trends in web application development
    Java Web Frameworks
    Start from the multilayered architecture to Java EE and web frameworks. • Describe the generalized multilayered application architecture • Briefly introduce the Java Enterprise Edition and Web Profile specifications • Introduce the popular Java web frameworks
    Data Persistence
    Learn about the design objectives of the persistence layer and how it can be implemented. • Elicit what the persistence layer is about and its importance • Describe a few popular Java persistence mechanisms • Explain the role of the data access object pattern in the persistence layer
    Talk about the functions that CassandraWebTrader will provide, its architecture, and the development approach. • Describe at a high level the functions of CassandraWebTrader • Present the logical application architecture and the frameworks or components to be used • Describe the development approach
  • Setting Up Our Toolbox
    Java Development Kit
    Follow DataStax's recommendation to select Java 7. • Describe DataStax's recommendation • Configure Ubuntu to install JDK 7 • Set up environment variables and verify the installation
    Apache Maven
    Introduce Apache Maven. Download, install, configure, and verify the installation. • Introduce Apache Maven • Download and install Maven • Set up environment variables and verify the installation
    The Eclipse IDE
    Introduce the Spring Tool Suite. Download, install, configure, and verify the installation. • Introduce the Spring Tool Suite • Download and install STS • Set up environment variables and verify the installation
    The Spring Framework
    Use Spring Boot as a catalyst to quickly develop a simple web application with minimal effort. • Describe the large family of Spring Framework projects • Create a simple web application using Spring Boot Starter • Walk through the Spring Boot settings in maven configuration
    Apache Tomcat
    Introduce Apache Tomcat. Download, install, configure, and verify the installation, and set up the management interface. • Introduce Apache Tomcat • Download and install Tomcat • Configure the Tomcat management interface
  • Designing CassandraWebTrader
    User Requirements
    We need to get a good understanding of what the user requirements are before designing. Describe both the functional and non-functional requirements and the different user roles. • List the user requirements • Describe the user roles and the functions with access rights granted • Cover the non-functional requirements, such as responsive web applications and high availability
    Modules and Functions
    We need to establish an easy-to-expand application foundation. Use modular design and apply good programming practices. • Choose the appropriate design patterns to compose the application architecture whenever possible • Group the program units into logically related packages • Define the URLs of the user functions to be accessed via a web browser
    The Data Model
    List the data entities that need to be stored in Cassandra. Create the corresponding CQL scripts. • Define the persistence entities • Create the keyspace to hold the tables • Create the tables per persistence entity using CQL
    The Class Model
    Prepare the design principles. Put in place a naming convention guideline for different program units and adopt best practices in the application design. • Define a set of naming convention rules • Put and group program units in the layered application architecture • Create the list of Java classes to be developed
    The Screen Design
    Draft the screens to have a consistent style, look, and feel. Use a screen prototyping tool to draw the wireframes. • Briefly introduce the screen prototyping tool • Walk through the major screens of general and member functions • Walk through the major screens of technical analysis and admin functions
  • Understanding the Spring Framework
    The Spring Core
    We want to know what the vast Spring framework is about. Write a simple program to illustrate the main concept of dependency injection. • Introduce the Spring Core framework • Learn about dependency injection • Use annotations to make the program Spring-based
    The Spring Web MVC
    We want to know what Spring Web MVC is about. Write a simple web application using Spring Web MVC. • Explain the core concept of Spring Web MVC • Configure the Spring project to use Spring Web MVC • Write a simple web MVC application
    Spring Security
    We want to know what Spring Security is about. Enhance a web application with Spring Security. • Describe the functionality of Spring Security • Configure the Spring project to turn on Spring Security • Protect the web MVC application with the Spring Security default configuration
    Spring Data Cassandra
    We want to know how to use Spring Data Cassandra to access a Cassandra database. Create a sample database and write a program to access it. • Introduce Spring Data Cassandra • Configure the Spring project to use Spring Data Cassandra and the DataStax drivers • Write a program to query a table in the sample database
    Spring Integration
    We want to know what Spring Integration is about. Implement a simple integration flow with Spring Integration. • Introduce Spring Integration as a simple, lightweight messaging framework for Spring-based enterprise application development • Mock up a sample integration flow to send a trading signal alert via e-mail • Write a program to implement the integration flow and provide an explanation of it
  • Deep Diving into Spring Data Cassandra
    The Core Concepts
    We want to use Spring Data Cassandra in application development. Learn about the basics and set up the maven dependencies. • Acquire basic knowledge of Spring Data Cassandra • Set up maven project dependencies • Know the best practices of using Spring Data Cassandra
    The Query Methods
    We want to know different ways of accessing Cassandra. We use CqlTemplate and QueryBuilder to apply direct CQL statements. • Introduce low-level JDBC style API support for CQL statements by CqlTemplate • Illustrate the use of QueryBuilder as an alternative to writing CQL statements • Demonstrate and compare various ways of accessing data in Cassandra
    Cassandra Template
    We want to work with domain classes instead of low-level calls. We use CassandraTemplate and CassandraOperations to map to POJO. • Describe POJO support • Introduce the Java annotations for POJO • Demonstrate the use of CassandraTemplate and CassandraOperations with POJO
    We want to reduce boilerplate code and XML in a large project. Use dependency injection and JavaConfig to configure Cassandra programmatically. • Learn about AbstractCassandraConfiguration • Create and set up CassandraClusterFactoryBean Demonstrate the use of CassandraRepository
    Administration Template
    We want to use a programmatic approach to manage Cassandra tables. We use CassandraAdminTemplate and CassandraAdminOperations to create, alter, and drop tables. • Introduce CassandraAdminTemplate and CassandraAdminOperations • Write a POJO for table creation in Cassandra • Verify the created table with metadata lookup
  • Building CassandraWebTrader - Part 1
    The Spring Web MVC Architecture
    We want to use Spring Web MVC in application development. You will learn about Spring Boot in order to speed up the development process. • Create a Spring Boot project for a web application • Lay out a prototyping user interface • Customize the default error pages
    Forms and Annotations
    You will be learning about Spring annotations and taglibs. Use them to build forms and MVC classes. • Create a data transfer object to communicate between the controller and the view • Introduce the Spring core taglibs and use them for forms • Create a controller to handle form input with GET and POST requests
    Responsive Web Applications with Bootstrap
    We want to use Bootstrap in web application development. We use the sample and template from Bootstrap as a reference to tailor for our own. • Introduce the Bootstrap library • Install and set up Bootstrap in the project • Use Bootstrap to make our web application responsive
    Making Charts with D3.js
    We want to render stunning stock charts. We use D3.js and Techan.js to make interactive charts. • Introduce D3.js and Techan.js • Install and set up D3.js and Techan.js in the project • Integrate a sample chart into our web application
    E-mail Setup
    We want to enrich our application to send e-mail messages. Use Spring Boot Email to achieve this goal. • Set up the Spring Boot Email maven dependency • Configure the SMTP server settings • Create the mail sending service class
  • Building CassandraWebTrader - Part 2
    We want to make our web application internationalized. We use message bundles and the relevant taglibs. • Create the message sources • Set up web configuration to handle locale changes Use taglibs to make the JSP views internationalized
    We want to link the client-side input form with the backend Cassandra table. We use the GET and POST request methods and Spring Data. • Create a Cassandra configuration to connect to the database • Retrieve and display data in a Bootstrap table • Develop CRUD functions for the watchlist
    Data Feed and the Scheduler
    We want to populate the database with historical prices. Use the free Yahoo! Finance end-of-day historical price service and Spring to automate collection and handling in a scheduled job. • Collect historical prices from Yahoo! Finance • Decode the data feed and save the prices in Cassandra • Use Spring scheduling annotations to manage a scheduled job
    JSON and the Stock Chart
    We want to write a RESTful web service. We use Spring Web MVC to provide JSON data to integrate with the client-side Techan.js. • Write a controller to expose a RESTful web service endpoint • Create a chart input form for the selection of chart symbols • Bind the JSON data returned by the RESTful web service to Techan.js to render stock charts
    Registration and Flash Messages
    We want to save member registration data. Use flash attributes to return the status message to the client side. • Build a service layer for member registration • Save member registration data in Cassandra • Use redirect attributes to add flash messages to improve user experience
  • Building CassandraWebTrader - Part 3
    Logging In and Authentication
    We want to secure some online functions for authenticated users only. Use Spring Security and its taglibs. • Create security JavaConfig for the web MVC • Program the user authentication logic and login form based on the Spring Security framework • Use taglibs to make the JSP views for anonymous access and authenticated access
    Trading Signal
    We want to program the logic for trading signals. Use the technical analysis technique and TA-Lib. • Design a technical analysis trading signal • Integrate TA-Lib to calculate the technical analysis indicator • Verify the algorithm with the external visual stock chart
    Signal History
    We want to save trading signals for different purposes. Use the design-by-query technique to get a denormalized table for each of the purposes. • Design the queries and the corresponding tables • Create the tables, POJOs, and repositories and modify the program to populate the data • Create a function to use a particular table for a query
    E-mail Alerts
    We want to reduce coupling among different application components. We use Spring Integration and messages as a means of decoupling. • Configure Spring Integration and the message channel • Create the business logic as a service producer that sends messages to a channel • Create or modify a service component to be the service consumer
    User Role and Authorization
    We want to provide role-based security for different users. We use Spring Security and its taglibs. • Enhance the member table to include role information • Restrict certain functions for administrators only • Use taglibs to render dynamic menus based on different user roles
  • Deploying to Production
    Send E-mail Alerts to Members
    We want control over who will receive the e-mail alerts. We use a secondary index to determine who the active members are. • Create a secondary index on the member table • Modify the message payload to include the e-mail address of the recipients instead of a hardcoded one • Modify the scheduled job to retrieve the list of active subscribers and send the e-mail to them
    Retrieve Forgotten Password
    We want to provide a self-served forgotten password function. We use a given username to look for the password and then e-mail it to the member. • Build a user interface for a not-logged-in member to input their username for the application • Modify the application to look up the registered e-mail address based on the given username • Modify the mail service to send a forgotten password e-mail to the member
    Refine and Clean Up
    We want to prepare the application for production deployment. Remove all the unnecessary classes, pages, and URLs and make the URLs context-path-sensitive. • Tidy up and remove the test pages • Touch up the user interface and add descriptive texts • Change the absolute URLs to be context-path-sensitive
    The Spring Boot Actuator
    We want to include monitoring and management functions for a production system. We enable Spring Boot Actuator in the production application. • Understand what Spring Boot Actuator is and what functions it can provide • Get familiar with the endpoints and the information they provide • Enable Spring Boot Actuator in the application
    Deploying the Spring Boot Application
    We want to make the application deployable for production. We select the most appropriate approach out of the many options provided by Spring Boot. • Know the different deployment options provided by Spring Boot • Learn about the known issues with Spring Boot and their workarounds • Make the web container or application server ready for deployment
  • Conclusion
    Course Wrap-up
    We will quickly revise and review what you've learned from this course. We will summarize the course with highlights on section topics. • Review the software development process • Summarize the course section by section • Provide the important points that have to be mastered in this course
    Further References
    We have references for further study. We will provide recommendations of some useful resources for reference. • Quickly walk through the relevant websites • Introduce other related e-learning courses and books • Provide a few useful references


  • Cassandra
  • NoSQL

Similar Courses

More Courses by this Instructor