Chapter 5. Creating a Data Service
If youâve been doing any reading lately about cloud-native services and applications, then youâre probably getting sick of hearing that these services all need to be stateless.
Stateless in this case doesnât mean that state canât exist anywhere; it just means that it cannot exist in your applicationâs memory. A truly cloud-native service does not maintain state between requests.
To build stateless services, we really just need to kick the state responsibility a little further down the road. In this chapter, weâll talk about how to build a microservice that depends on an external data source. Our code in this chapter will work with Entity Framework (EF) Core, and weâll upgrade the team and location services weâve been working with to true data persistence.
Choosing a Data Store
There are many risks associated with embracing a 1.0-level technology. The ecosystem is generally immature, so support for your favorite things may be lacking or missing entirely. Tooling and integration and overall developer experience are often high-friction. Despite the long and storied history of .NET, .NET Core (and especially the associated tooling) should still be treated like a brand new 1.0 product.
One of things we might run into when trying to pick a data store that is compatible with EF Core is a lack of available providers. While this list will likely have grown by the time you read this, at the time this chapter was written, the following ...
Get Building Microservices with ASP.NET Core now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.