Cassandra demo app - BetterReads (Similar to GoodReads). Data is first loaded into datastax Cassandra cluster using this app
- https://cassandra.apache.org/doc/latest/
- https://cassandra.apache.org/doc/latest/cassandra/data_modeling/index.html
- https://www.datastax.com/blog/basic-rules-cassandra-data-modeling
- https://www.datastax.com/blog/coming-12-collections-support-cql3
- https://www.datastax.com/blog/cql-improvements-cassandra-21
- https://www.datastax.com/blog/whats-new-cassandra-21-better-implementation-counters
- https://www.datastax.com/blog/lightweight-transactions-cassandra-20
- https://www.datastax.com/examples
- https://www.datastax.com/examples/astra-netflix
- https://www.datastax.com/examples/astra-tik-tok
- https://youtu.be/fcohNYJ1FAI
- https://youtu.be/u6pKIrfJgkU
- https://academy.datastax.com/#/courses/c5b626ca-d619-45b3-adf2-a7d2b940a7ee
- https://www.datastax.com/blog/putting-some-structure-storage-engine
Follow this video and this (or this) github repositories to build oauth2Login using github.
- Create a GitHub App and get the Client ID and Client Secret values. (Specify callback URL as http://localhost:8080/login/oauth2/code/github for development, uncheck Web hooks)
- Add those values in application.yml
- Run the Spring Boot App.
- First we create books data in datastax Cassandra cluster using betterread-data-loader app.
- We get data dump from https://openlibrary.org/data. checkout openlibrary developers support page - https://openlibrary.org/developers
- And then process dump file and create authors data and books data in Cassandra cluster.
Cassandra console after data creation:
Checkout the Book.java Class for book_by_id table which facilitates this feature.
We get book by id from Cassandra book_by_id table and display it to UI
We make call to https://openlibrary.org/search.json?q={query} api to get search result. We can't perform search in Cassandra as that would be very slow. Ideally we should have used an Apache Lucene based text search engine (such as elastic-search or solr). We should have build an index in elastic-search from Cassandra (or Kafka depending on how we design it) and then we should have performed the search query on elastic-search. However, since the scope of this app was to learn how to use Cassandra db, we are leveraging openlibrary's available search API - https://openlibrary.org/dev/docs/api/search.
Cassandra console: For every user interaction with a new book, a new row will be added in this table
- user njha-collab adds info for book OL10005006W
- user njha-collab updates info for book OL10005006W (same entry is updated)
- user njha-collab adds info for another book OL10009701W
Checkout the BookInfoByUserIdAndBookId.java Class For book_by_userid_and_bookid table which facilitates this feature.
Displays top books that a user has interacted with on user's home page Cassandra console:
Checkout the BookInfoByUserId.java Class For books_by_userid table which facilitates this feature.