Adding a Database Resource to a Lab Template

Modified on Fri, 19 Jan at 1:59 PM

How to add a database resource to a lab template 


Most server-based applications require a database to store persistent data. OrasiLabs supports creating database resources in a lab template through the Lab Template Designer. The database will then be created and started just like any other lab template resource when the template is started or when it's used in a class lab.

 

Note: For a complete description of how to use the Lab Template Designer, please see the article Creating a Lab Template with the Lab Template Designer.

 

Currently, OrasiLabs supports the following database management systems:

  • MariaDB

  • Microsoft SQL Server Enterprise

  • Microsoft SQL Server Express

  • Microsoft SQL Server Standard

  • Microsoft SQL Server Web

  • MySQL

  • Oracle Standard

  • Postgres

Adding a Database as a Shared Resource

There are two primary techniques for adding a database resource to a lab template. The first, and most common, approach is to add a Shared Database to a lab template so that each student in an instructor-led class can share the same resource. Adding a Shared Database to a lab template, and using that template in a class, will create a single instance of the database that is then shared across all of the instructor and student labs. Any changes a class participant makes to the database will be reflected in all other participants' labs as well.

 


For most server-based applications, using a Shared Database is the preferred approach. It is also the most cost-effective solution since there is only one instance of the database being used during a class.

 

NOTE:

  • Participants access shared resources with the syntax "<resource name>.shared" where <resource name> is replaced with the name of the resource in the Lab Template Designer. The default name for a database resource is "db-a", so with a default name, the students would use "db-a.shared" to access the shared database. This Connection URL can also be viewed from the Lab Template Details in the Template Resources table.

  • Using a Shared Database in an on-demand class works differently than described above. Since each student in an on-demand class can have different start/end dates, each student will receive their own database instance.

 

Adding a Database for each Class Participant

A second technique for adding a database resource is to add the database object to the existing Instructor/Student lab template. This will create a separate, isolated database for each class participant, and changes a participant makes to their database will not be reflected in other participants' labs.

 

This approach runs a unique database instance for each class participant. In cases where student changes could conflict with each other (e.g., metadata/structural changes or common table updates), this may be the only practical solution.

 

NOTE:

  • Participants access lab-specific resources (i.e., not shared with other students) with the syntax "<resource name>.local" where <resource name> is replaced with the name of the resource in the Lab Template Designer. The default name for a database resource is "db-a", so with a default name, the students would use "db-a.local" to access the local database. This Connection URL can also be viewed from the Lab Template Details in the Template Resources table.

 

Additional Notes

Please also note the following:

  • Each database management system (DBMS) requires specific Amazon EC2 instance types. You may have to modify your database server policy to include additional instance types in order to enable a specific DBMS to be used in the Lab Template Designer. To modify the database server policy, use "Settings...Server Policies" and edit the Default Database server policy.

     

  • Database resources take much longer to provision in Amazon than operating system resources. For example, an average Windows 2019 resource will normally start and be ready for use in 3-5 minutes, whereas a Microsoft SQL Server Enterprise resource will require 20-30 minutes. This is expected behavior so please plan accordingly when starting resources before a class.

     

  • It is also possible to install a DBMS directly into an operating system image in the lab template rather than using the OrasiLabs database resource object. In this case, OrasiLabs has no knowledge of the database and you must manually configure it. However, while more complex, this approach also allows the user complete administrative control over the DBMS engine rather than using the preconfigured Amazon RDS instances. This might also be necessary to install DBMS products that aren't currently directly supported by Amazon.

 

Where to go from here...

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article