Home / Companies / ScyllaDB / Blog / Post Details
Content Deep Dive

ScyllaDB University: Coding with Scala, Part 2

Blog post from ScyllaDB

Post Details
Company
Date Published
Author
Guy Shtub, Itamar Ravid
Word Count
865
Language
English
Hacker News Points
-
Summary

In this ScyllaDB University lesson, the authors delve into using the Phantom Scala driver to model tables and databases within a ScyllaDB cluster, emphasizing the advantages of using Phantom's abstractions for a more structured application. The lesson highlights how Phantom facilitates mapping ScyllaDB tables to data types, allowing developers to avoid "stringly-typed" programming by using rich types and functions. This ensures that column data types are strictly adhered to, enhancing code reliability. The authors describe the process of declaring tables by extending the Table class and specifying column types, while databases are structured by bundling multiple tables from a keyspace into a single class. For optimal application architecture, the lesson suggests using higher-level service interfaces to manage data access, exemplified by the MutantsService class, which encapsulates data operations and allows for easier future modifications. The lesson underscores the importance of these abstractions for building modular and well-architected applications and invites learners to explore further lessons in ScyllaDB University.