Git Product home page Git Product logo

zhaojj2209 / teammates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teammates/teammates

0.0 0.0 0.0 228.28 MB

This is the project website for the TEAMMATES feedback management tool for education

Home Page: https://teammatesv4.appspot.com/

License: GNU General Public License v2.0

Java 60.89% HTML 8.81% CSS 0.01% JavaScript 0.03% TypeScript 29.75% SCSS 0.49% Shell 0.02% Dockerfile 0.01%

teammates's Issues

V9 Migration PoC

This issue keeps track of all the tasks related to the PoC:

  • Setting up ORM (#11)
  • Implement CRUD on Course and Instructor with transactions (#13 and #15)
  • Implement the logic layer based on the interoperability design laid out here ( #12)
  • Demonstrate how integration and system level tests can be set up with the new database ( #18)
  • Demonstrate how database migrations will be done when the data model changes e.g. adding or removing of fields (#16)

Implement CRUD on Instructors table

In order to experiment with JOIN operations, we need at least two tables.

  • Implement Create on Instructors table
  • Implement Read on Instructors table
  • Implement Update on Instructors table
  • Implement Delete on Instructors table

Implement CRUD on Courses table

  • Implement Create on Courses table
  • Implement Read on Courses table
  • Implement Update on Courses table
  • Implement Delete on Courses table

Implement a routine involving join operations

Demonstrate how a join operation between two tables would work, e.g. getCoursesForInstructors (should return a list of courses, except for courses in the recycle bin, for a given list of instructors)

Handle exceptions thrown by Hibernate

Many conditions can cause exceptions to be thrown while using Hibernate. These can be mapping errors, infrastructure problems, SQL errors, data integrity violations, session problems, and transaction errors.

These exceptions mostly extend from HibernateException.

Furthermore, most of these are unrecoverable. As a result, retrying the operation would not help. This means we have to abandon the current session on encountering them.

Useful links:

Explore how to set up base test case with local SQL DB access

Explore how to write component tests (e.g. for course) against SQL DB. Run tests for CoursesDb, CoursesLogic, and a few course-only APIs.

Updated:
The current most viable solution is to use throwaway instances of databases running in Docker containers.

There are two options we can consider:

  • Option A: OpenTable Embedded PostgreSQL Component
    • This library is maintained by OpenTable, Inc. It uses TestContainers under the hood, but adds value with builders, the api compatibility, the wrapping around Flyway to allow users to adopt a smooth transition to a Docker-based test approach.
  • Option B: TestContainers
    • We can also directly use TestContainers, a well-known Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases
    • We will need to integrate Flyway with TestContainers ourselves

Demonstrate how a twin-DB architecture will work

Create package for the new logic and storage layer:

  • teammates.storage.sqlentity.*: entities to be persisted to SQL
  • teammates.storage.sql.*Db: DB layer for CRUD for dedicated entities
  • teammates.logic.sql.*Logic: logic layer
  • teammates.logic.api.LogicNew: facade logic

Transaction methods should not be called in the DB layer

How to group transactions is business logic and ideally should not be defined in the db layer.

A simple way to rationalise this, say we need to apply a transaction that does operation A on courses then operation B on instructors. If the transaction is to be defined in the db layer, we need to write this specific method in db layer.

Transaction tx = ...
operationAOnCourses()
operationBOnInstructors()
tx.commit()

As you can see, we are now forced to move the business logic to the db layer.

Develop PoC for version-controlled schema migration

To migrate existing data from Datastore to SQL, a migration script is needed. We can also look into having the script create the relation if it does not yet exist in the database, so that we do not have to create all the relations manually in the database first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.