In a previous article, I was showing you how to create a .net5 webapp with the ultimate goal to containerize it using docker.

In this second part of the journey, I will show you how to make your webapp consume data from your own database and how to turn this into a docker scenario where the .net5 web app container talks securely to a database container.

Image for post
Image for post
Image by Alfred Derks from Pixabay

Prerequisites:


I was heavily using relational SQL databases for ages and I would even call myself a SQL-Ninja. Oh boy… how flat my earth has been for years. There’s nothing wrong with relational databases if one knows their limitations.

Image for post
Image for post
Image by Pete Linforth from Pixabay

Relational database systems like Microsoft SQL server, Oracle, PostgreSQL, MySQL etc. are excellent choices for storing structured data. For the sake of simplicity, let’s consider them a good choice if the data to be stored is some kind of Microsoft Excel workbook with multiple sheets. Like an accounting journal, an address book or something similar.

And what RDBMs can also handle just fine are simple relationships between the data entries. This is comparable with a link between two Excel Sheets — to bring up this generalization again.
A use case would be to have a list of names in one place and a list of addresses in another place — linked through some shared identifier (e.g. PersonId). The first table below contains three of my friends and the second table contains addresses. They are linked to my friends using the ID and PersonID fields. For Peter Piper, no address is known. …


I spent a few hours during the Christmas holidays to see if I could migrate my .net5 (aspnetcore) app and all of it’s components into Docker on my shiny new Synology DS220+ NAS. This is part one of the journey and the part-time goal is a .NET5 web application in a local Docker.

My .NET 5 (Microsoft removed the core branding recently) application helps me automating my day-to-day tasks, comes with reports about my time tracking and serves as a playground to try out new technologies.

Image for post
Image for post
Image by Julius Silver from Pixabay

Prerequisites:

  • Debian or Ubuntu Linux to follow the guide here, but works with other OS too. …

About

Martin Horvath

I'm a consultant working on international projects in the field of geospatial data and customer experience, with a passion for technology and mountaineering.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store