Posts by Lyle Frost
Techniques For Effective Models in C#
Large, complex data models are ubiquitous today. Whether destined for a database or a service API, constructing valid data is essential. Having a clear and concise way of defining data models, as well as populating and validating them, can greatly increase productivity and reliability. When building models with hundreds of fields and several levels, clarity…
Read MoreUsing Java Libraries in Scala
Scala does not transpile to Java as TypeScript does to JavaScript. It is a distinct language that compiles directly to JVM bytecode just as Java does. Because both compile to the same bytecode, however, Java libraries can be accessed natively from Scala. This is similar to the sharing of libraries by languages compiled to the…
Read MoreFully Type-Safe JSON in TypeScript
There are several libraries available for validating JSON in TypeScript, but the ones that I am aware of have at least one of the following drawbacks. The type safety of TypeScript itself does not come into play until after the validation is complete. There is excessive boilerplate code, either manually created or generated. The flexibility…
Read MoreWebSocket Connections with Akka Streams
The WebSocket protocol provides full-duplex communication channels between web clients and servers. Using Play Framework’s WebSocket class along with Akka Streams provides effective support for WebSockets on the server side. Add an Alpakka connector for the desired data source, and you have all the pieces to create flexible, reliable, and elegant solutions for connecting WebSockets…
Read MoreETL With Scala and Native SQL – Part 2
In part 1 we completed the steps necessary for the extraction and transformation of our operations data. Before proceeding to load our data warehouse, let’s go into more detail on Anorm queries. There is a great deal of consistency in how Anorm handles different types of SQL statements, and having a more general understanding of…
Read MoreETL With Scala and Native SQL – Part 1
For almost as long as software engineers have been using object-oriented programming languages to access relational databases, we have been lamenting the “impedance mismatch” between the two. The lack of straightforward language constructs to allow data to move cleanly back and forth between objects and tables led to the rise of object-relational mapping tools. ORM…
Read MoreModeling Hierarchical Data in Postgres
Hierarchical data has historically been a challenge with relational databases. There are well-known solutions for implementing a hierarchy in a purely relational fashion, but their complexity and performance are not generally desirable. To overcome this, some modern RDBMSs have a special data type for hierarchical values. In the case of Postgres, this data type is…
Read More