This content is part of the Essential Guide: The vital guide to modern programming languages and their uses
Get started Bring yourself up to speed with our introductory content.

3 ways Steeltoe opens the door to microservices in .NET

The .NET framework doesn't leap to mind in a conversation about microservices development, but an open source project called Steeltoe could change that.

Although Java still offers the most compelling approach to create high-scale microservices, there are plenty of .NET developers who would like to work in distributed architectures without the need to learn another programming language.

Steeltoe is an open source project that's been in the works for a few years, and it helps developers create microservices in .NET and clear pathways for .NET app modernization. It helps developers create cloud-native applications that run on Cloud Foundry and perform as well as any Spring Cloud or Spring Boot application. Moreover, companies also gain the ability to remain vendor-agnostic and work with a broader range of technology providers because they can choose the development approach that best suits their business needs.

In hyperscale cloud environments, standard .NET best practices don't allow for needed scalability or high resiliency. Tight one-to-one coupling between a server and an application is one scenario where scalability can be limited. Moreover, it's long overdue that developers have an easy way to create microservices in .NET.

How does Steeltoe help?

Steeltoe offers a set of components to extend .NET Core and .NET Framework and allow developers to tap into that configuration subsystem to access a remote config server. Its client libraries provide apps with the ability to use Netflix Eureka, Hystrix, Spring Cloud Config Server and Cloud Foundry services. Steeltoe enables .NET devs to perform service discovery and be part of a live registry, in contrast to a relatively static, out-of-date and stale integration management database.

Three components in Steeltoe make this flexibility in .NET applications possible: - service discovery, circuit breakers and config servers.

Steeltoe provides additional connectors to popular open source projects, such as Redis, MySQL, Postgres, RabbitMQ and OAuth. As IT leaders increasingly strive to create ecosystems with the best possible technologies for meeting different business needs, they're discovering the advantages of decoupled services and statelessness.

Three components in Steeltoe make this flexibility in .NET applications possible: service discovery, circuit breakers and config servers.

Service discovery

Scalability is a key benefit of microservices. However, it can be tough to keep track of all the dependent services. Microservices connect with each other through Steeltoe's service discovery, and applications look to the registry for their dependent services.

Netflix Eureka is a key service discovery application pattern for many developers. It provides a centralized repository for microservices to register themselves and look up other registered services. Steeltoe includes a service discovery client that ensures .NET apps can connect to a Eureka server and register or retrieve a list of stable service instances. This provides developers with real-time visibility into the registry along with frequent health checks.

What about security?

When it comes to securing .NET apps, Steeltoe integrates with Cloud Foundry security features. Specifically, it employs OAuth2 Single Sign-on and protects access to REST resources and endpoints via open standard JSON Web Tokens (JWTs).

Circuit breaker

Steeltoe also provides circuit breaker software patterns to keep failures that may occur in one service component from creating cascading failures across an entire environment. Circuit breakers are a proven way to bring more resiliency to microservices and enables them to self-heal as necessary. Initially, Spring Cloud Hystrix kept those Java-based service failures in check by watching and periodically checking for potential failures.

Similarly, the Steeltoe Hystrix library provides for app failures in .NET calls, invokes fallback operations as needed, trips circuits and ensures the health of all downstream services. Through the Hystrix dashboard, developers who create microservices in .NET can get a visual of the system's health and create circuits that relay information to other developers if a downstream app fails. Those circuits can also poll downstream apps for availability. In addition to automatically performing failover actions, the Steeltoe package offers different circuit scenarios for use in app integration tests.

Config servers

The config server acts as a central place to manage external properties for applications across all environments. Developers can use it to easily manage configurations as applications move through development, testing and deployment. They can also ensure that individual apps have everything they need to migrate to another environment. The Spring Cloud Config server offers a simple API for retrieving app configuration settings, and it is optimized for microservices.

A key advantage that Steeltoe provides via the Spring Cloud Config server is increased interoperability. Moreover, .NET developers can manage configurations for their Windows-based apps. Separating configuration from application code is an important discipline in cloud development.

Steeltoe Configuration builds upon the .NET configuration API. Developers can also use configuration providers to configure an application with values from a variety of sources. Steeltoe ensures that configurations for multiple services are not only externalized and discrete from code, but also contained in a central location.

Dig Deeper on Application development and management