-
Graphinder series articles
- Graphinder – Project Introduction
- Graphinder – I don’t need this covered…
- Graphinder – Minimum Vertex Cover problem
- Graphinder – Simulated Annealing algorithm
- Graphinder – Code review yourself
- Graphinder – Genetic Algorithm – Introduction
- Graphinder – Genetic Algorithm – Selection
- Graphinder – Genetic Algorithm – Crossover
- Graphinder – Genetic Algorithm – Mutation
- Graphinder – Genetic Algorithm – Wrap up
- Graphinder – Monthly Progress Report – March
- Graphinder – Async IEnumerable with Rx.Net and IObservable
- Graphinder – Reporting progress with Rx.Net
- Graphinder – TDD and starting from red
- Graphinder – Domain models vs Persistence models
- Graphinder – Queries and Commands vs Repository pattern
- Graphinder – Encapsulating persistence layer
- Graphinder – Solution changes and nuget hell
- Graphinder – Monthly Progress Report – April
- Graphinder – Application architecture
- Graphinder – Resources planning on Azure
- Graphinder – Quick summary and what next
- Quick thoughts after Daj Sie Poznac 2016 finals
In a previous post I mentioned that I came to agreement with myself on Graphinder’s application architecture.
As it’s a moment when I’m slowly moving out to other services working around the whole infrastructure, it would be wise to wrap things up and pinpoint possible points of failure or misuse. I’d also share a little insight on my plans of putting such architecture in place on Azure, but wider coverage of that topic would come as a next article.
Application architecture overview
To keep you accustomed with my concept right from the start, I guess the wisest idea would be to start from graphical visualization.
As its far from ideal and still evolving (but not so dramatically as before), please keep it mind that it’s far from ideal in representing every aspect of architecture that’s out there. It would be impossible to put it all organized in a small space of diagram.
Alrighty. We have three web applications I’m currently developing for Graphinder
(WorkerApi
, GatewayApi
and Web
) and one, that is currently on hold (Users
).
For anyone that’s at least a little into microservices idea, one thing would be odd here. There is no service directory (or registry – have seen many names around the web) and my services are not designed to use service discovery.
Why not? Well, I’m really, really new into microservices. When I’ve said I’m quite new in Reactive Extensions
and would want to compare it with my experience with microservices, I’d have to say I’m Rx.Net pro. But I’m not.
Step by step, over next iterations of project I’m gonna improve the whole architecture but hey, first things first. Let’s at least deliver minimal project on end of May!
Services communication flow
Since I have more than one communication flow from frontend down to database, I’ve separated responsibilities in algorithms domain:
- Algorithms.GatewayApi – manages classical requests like get me a data set, accept a new data set and persists it etc;
GatewayApi
also stands as point of requesting problem solutions, manages queue of requests and stands as a point of registration for newWorkerApi
instances; has also knowledge of SignalR hubs that will accept live progress reports from workers - Algorithms.WorkerApi – works on a problem received from gateway; persist current state of worked problem; notifies to address given by gateway; has no idea of nothing around except
algorithms_db
and parentGatewayApi
Example workflows
- User posts new solution finding request →
Web
application callsAlgorithms.GatewayApi
with request data →GatewayApi
enqueues request, callbacks on what has been done →Web
informs user what has been done - User opens view for currently worked algorithm →
Web
connects user to SignalR hub user requested ↔Worker
keeps on posting progress to hub so that user has feedback on what’s going on - User requests historical data of once completed solution finding →
Web
callsGatewayApi
for archival data ->GatewayApi
takes data fromalgorithms_db
and returns it toWeb
→Web
displays archival data to user
The list of possible scenarios for this design is long, but I hope you get the idea on why it has been split up here.
Infrastructure concepts
Since I’m going to communicate over unsecured HTTP protocol throughout the architecture, I’d need to put some sort of environment isolation.
I’ve decided to put all services into separate virtual network, provided out of the box by Azure.
The only valid, public endpoint for accessing whole application would be HTTPS (443) port on Web
application.
Since I will cover whole configuration on Azure in the next post, I will leave the rest for that post.
Point of interest
- Since whole architecture is strongly encapsulated, there would be a need for at least one more public endpoint for other applications reaching services, e.g. mobile applications and other web apps
- Provided I would like to add integration with other vendors services, I would need to decide whether
Web
application is point of connecting to them or should I provide small service inside infrastructure for this, depending on my requirements - Provided I would like to connect to any on-premise (or different Azure subscription) applications I have, I would need to think of Site-To-Site VPN configuration or additional endpoint for that (VPN gateway cost vs performance)
And that’s it for today. Let me know what you think on my current design.