Creating Spring Boot MVC application with AWS DynamoDB in 10 mins

Image
AWS DynamoDB DB is a serverless NOSQL database. You can understand how to build a spring boot Java web MVC application (Game Leaderboard) reading a AWS DynamoDB in 10 mins. Source of the demo code: https://github.com/babysteps-topro/spring-mvc-dynamodb Command to run the project: mvn spring-boot:run Video explain the table design: https://youtu.be/V0GtrBfY7XM Prerequisite: Install the AWS CLI: https://youtu.be/pE-Q_4YXlR0 Video explain the how to create the table: https://youtu.be/sBZIVLlmpxY

Sample Apps: Spring data MongoDB and JSF Integration Tutorial (PART 2)


Table of Contents:
1. Introduction to sample application (MongoShop Product Catalog)
2. MongoDB schema design and data preparation
3. JSF (PrimeFaces) and Spring data MongoDB Integration
4. Enquriy data with spring data repository and mongotemplate
5. Create, Edit and delete data


MongoDB schema design and data preparation



MongoDB Introduction
MongoDB is a open-source scalable, high-performance NoSQL database. It is a document-oriented Storage. It can store JSON-style documents with dynamic schemas. In this application, each product is stored as JSON-style document in MongoDB.


Schema Design in MongoDB
Each product in the catalog contains general product information (e.g. sku, title, and product type), price details (e.g. retail and list price) and product sub-details (e.g. tracks of audio CDs / chapters of books).

In this application, MongoDB is used. The schema design will be focus more on the data usage. It is different from traditional RDBMS schema design. The schema design in MongoDB should be:


Sample Data:
x= {
  sku: "1000001",
  type: "Audio Album",
  title: "A Love Supreme",
  description: "by John Coltrane",
  publisher: "Sony Music",
  pricing: {
    list: 1200,
    retail: 1100
  },

  details: {
    title: "A Love Supreme [Original Recording Reissued]",
    artist: "John Coltrane",
    genre:  "Jazz" ,
    tracks: [
      "A Love Supreme Part I: Acknowledgement",
      "A Love Supreme Part II - Resolution",
      "A Love Supreme, Part III: Pursuance",
      "A Love Supreme, Part IV-Psalm"
    ],
  }
}

y= {
  sku: "1000002",
  type: "Audio Album",
  title: "Love Song",
  description: "by Khali Fong",
  publisher: "Sony Music",
  pricing: {
    list: 1000,
    retail: 1200
  },

  details: {
    title: "Long Song [Original Recording Reissued]",
    artist: "Khali Fong",
    genre:  "R&B",
    tracks: [
      "Love Song",
      "Spring Wind Blow",
      "Red Bean",
      "SingAlongSong"
    ],
  }
}


z= {
  sku: "1000003",
  type: "Book",
  title: "Node.js for PHP Developers",
  description: "by Owen Peter",
  publisher: "OReilly Media",

  pricing: {
    list: 2500,
    retail: 2100
  },

  details: {
    title: "Node.js for PHP Developers",
    author: "Mark Owen",
    genre:  "Technology",
    chapters: [
      "Introduction to Node",
      "Server-side JS",
      "PHP API",
      "Example"
    ],
  }
}


Sample query to add the data:
db.product.save(x);
db.product.save(y);
db.product.save(z);

Sample query to test the sample data:
db.product.find({'sku':'1000004'});
db.product.find({'type':'Audio Album'});
db.product.find({'type':'Audio Album', 'details.genre': 'Jazz'});

Part 3 of the tutorial ...

Comments

UFABET1688 said…
It’s really a cool and useful piece of info. I’m happy that you shared this useful information with us. Please stay us up to date like this. Thanks for sharing. ยูฟ่าสล็อต
Links For You said…
Exceptionally instructive case! There is loads of hint here that could previously any situation income started further to a rich interpersonal interaction cognizant up assessment. thanks! Clash Of Clans Hack
Cyberz Pc said…
Best announce! this is an each level of simple to apply weblog that I can conclusively come steerage to more prominent age this yr! gratitude for useful declare. thanks! Wifi Password Hacker
Hi Every One said…
I was breaking down some of your substance material cruelly this site and that I consider this net website page is truly useful ! hold while motivation to setting occurring. thanks! Motivational Quotes For Teenagers

Popular posts from this blog

Sample Apps: Spring data MongoDB and JSF Integration tutorial (PART 1)

Customizing Spring Data JPA Repository

Adding Hibernate Entity Level Filtering feature to Spring Data JPA Repository