Using PostgreSQL as an Append-only Datastore with Kotlin and Exposed

This page summarizes the projects mentioned and recommended in the original post on /r/Kotlin

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Exposed

    Kotlin SQL Framework

    In our last episode (https://youtu.be/Uza\_dWsNMUs) we worked out how to save stock items in PostgreSQL (https://www.postgresql.org/) using the JetBrains Exposed library (https://github.com/JetBrains/Exposed). This time we refactor our existing file-based storage, extracting an interface that we can implement with files, in-memory, or with Exposed. For the database version, instead of replacing items in a table when they change, we choose to implement an append-only datastore. This keeps all the old versions of every row, using a query to select the latest versions when we want to see the current state. This has the advantage that we can rebuild the state of our system if things go wrong, and may also be faster than amending when we consider transactions. This is part 62 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Kotlin. You can see the whole series as a playlist https://www.youtube.com/playlist?list=PL1ssMPpyqociJNwykAOB9\_KEZVW7BW7m2 and the code on GitHub https://github.com/dmcg/gilded-rose-tdd If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook (http://java-to-kotlin.dev). It's about far more than just the syntax differences between the languages - it shows how to upgrade your thinking to a more functional style. I have some free time between producing videos and working for team Gilded Rose. If you like these videos I'd like to work with you - please get in touch - [email protected]

  • PostgreSQL

    Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch

    In our last episode (https://youtu.be/Uza\_dWsNMUs) we worked out how to save stock items in PostgreSQL (https://www.postgresql.org/) using the JetBrains Exposed library (https://github.com/JetBrains/Exposed). This time we refactor our existing file-based storage, extracting an interface that we can implement with files, in-memory, or with Exposed. For the database version, instead of replacing items in a table when they change, we choose to implement an append-only datastore. This keeps all the old versions of every row, using a query to select the latest versions when we want to see the current state. This has the advantage that we can rebuild the state of our system if things go wrong, and may also be faster than amending when we consider transactions. This is part 62 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Kotlin. You can see the whole series as a playlist https://www.youtube.com/playlist?list=PL1ssMPpyqociJNwykAOB9\_KEZVW7BW7m2 and the code on GitHub https://github.com/dmcg/gilded-rose-tdd If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook (http://java-to-kotlin.dev). It's about far more than just the syntax differences between the languages - it shows how to upgrade your thinking to a more functional style. I have some free time between producing videos and working for team Gilded Rose. If you like these videos I'd like to work with you - please get in touch - [email protected]

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • gilded-rose-tdd

    A TDD implementation of the Gilded Rose stock control system

    In our last episode (https://youtu.be/Uza\_dWsNMUs) we worked out how to save stock items in PostgreSQL (https://www.postgresql.org/) using the JetBrains Exposed library (https://github.com/JetBrains/Exposed). This time we refactor our existing file-based storage, extracting an interface that we can implement with files, in-memory, or with Exposed. For the database version, instead of replacing items in a table when they change, we choose to implement an append-only datastore. This keeps all the old versions of every row, using a query to select the latest versions when we want to see the current state. This has the advantage that we can rebuild the state of our system if things go wrong, and may also be faster than amending when we consider transactions. This is part 62 of an exploration of where a Test Driven Development implementation of the Gilded Rose stock control system might take us in Kotlin. You can see the whole series as a playlist https://www.youtube.com/playlist?list=PL1ssMPpyqociJNwykAOB9\_KEZVW7BW7m2 and the code on GitHub https://github.com/dmcg/gilded-rose-tdd If you like this, you’ll probably like my book Java to Kotlin, A Refactoring Guidebook (http://java-to-kotlin.dev). It's about far more than just the syntax differences between the languages - it shows how to upgrade your thinking to a more functional style. I have some free time between producing videos and working for team Gilded Rose. If you like these videos I'd like to work with you - please get in touch - [email protected]

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts