So we’re past ‘Daj sie poznac 2016’ finals and I feel a lot more pumped for further activities than I thought I would be. Competition was great but the finals were even greater. The amount of positive energy and interesting, really diverse topics that were presented made me really happy that I could be part of it. Kudos to the winner of competition, Piotr Gankiewicz and his Warden. Amazing project.
As for my current developer activity in web,
Graphinder will currently be on hold, yet I’ve decided to try some new stuff and write my very first
More of me in web
I feel quite guilty that I did not do my best to promote
Graphinder and my blog per se in recent competition, therefore you’ll see me more and more in web. I’ve decided to share more and ‘attend’ more. As for a nearby future, you’ll hear me in upcoming episode of DevReview hosted by Dariusz Pawlukiewicz @ Forever F[r]ame. I hope you’ll like it!
New project: Selectibles.js
When working with plain ASP.NET MVC I’ve found it to be pain in the ass to use libraries like Select2 and Selectize.
They were often incompatible with jQuery (which I’m not a biggest fan tbh) versions I’ve used and I needed to juggle with them around just to make things (at least) work. What’s more I felt that even when they had many options, doing stuff my way was quite… dodgy.
Therefore, here it comes. My attempt for selectable controls for web.
I’m going to start with basic functionalities that will mimic Select2 from it greater days (ie. when I had 0 problems working with it).
Then, I’ll probably move on to some other controls that would be cool to have but optional to bundle (!).
I would also like to make sure the library does not need jQuery at all. It’s about time for web to move on I guess.
If you want to follow up with the project, it will build up on GitHub:
Selectibles.js @ GitHub.com
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
Web) and one, that is currently on hold (
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 new
WorkerApi 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 parent
- User posts new solution finding request →
Web application calls
Algorithms.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 →
GatewayApi for archival data ->
GatewayApi takes data from
algorithms_db and returns it to
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.
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
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.
Over week ago we’ve seen a second month of
Daj sie poznac 2016 passing by.
Same as month ago, I’ve come to conclusion, that it would a good idea to note down what have I done in Graphinder project during last 4 weeks.
Current state of a project
April brought both progress on implementation and architecture levels. I’ve written less code and spent much, much more time actually thinking on why and how to do many things to stay both flexible and content about my decisions.
Algorithms microservice – persistence
First of all, persistence layer for
Algorithms microservice in its bare implementation is in place.
While working on it, I needed to work my way around few hurdles, that is:
- Unconventional domain layer – raw algorithms and optimization problems are generally a way of solving problems given by business, not a business domain per se; in Graphinder they are the core of the application
- Unconventional data types – to preserver progress of algorithm, I need to persist its current state; persisting solution as One-To-Many association with
Node table smelled like NO-NO solution, so I’ve ended up borrowing idea from
Genetic Algorithm and mapped chosen nodes as an array of
bool, mapping it layer as
byte array to DB. Not an ideal solution but quite fast. Would probably need a revision for more universal approach for other optimization problems.
- Completely hiding up knowledge of how persistence works – that was actually quite fun part to do and quite personally rewarding to see the outcome: any other layer that asks persistence to retrieve or save data, has no idea what’s going on out there and has no way to use it if not through queries and commands
Graphinder project – architecture
Second of all, I’ve almost crystallized my idea on how an architecture of whole system would look like.
While I’d like to keep this covered in a separate post, I’d like to note few things that will be part of project:
- Graphinder.WebApp – application based on ASP.NET MVC, SignalR, D3.js and (possibly, but not from start) React.
- Graphinder.Algorithm.GatewayApi – application based on ASP.NET WebAPI, serving as a gateway for scheduling work for algorithms and serving as CRUD endpoint for algorithms-related data; I’m almost 100% sure that it’d also share location with
- Graphinder.Algorithm.WorkerApi – multiple instances of worker APIs that will be responsible for job retrieval, processing and persisting solutions for a problem and then returning it back to user; although written in WebAPI now, can be for example a NodeJS API and I’m definitely looking into creating one in a more distant future as
As project structure also changed, it made some of links in previous posts pointing to location that no longer exists on GitHub.
I’d like to deeply apologize for that and as an atonement I’ve decided to… fix that next week. 🙈
I’m also revising possibilities on fitting everything I want to show on each consecutive release on Azure. For now, I’ve finally configured virtual network based Windows Server 2012 VM with RDP access through VPN. Took only 4 hours. Huh…
A week off from project
You probably haven’t noticed if you didn’t visit my GitHub account page, but my contributions in April went down to 50% of what I’ve done in March. I’ve also ended up with 20 out of 30 days with a commit, as opposed to 23 out of 30 days in March.
One of the reason of such state is that – as I’ve mentioned – I both fought few hurdles in persistence layer and wanted to revise entire
Graphinder architecture idea based on experience I’ve made during those 2 months.
But what’s more important is that as a simple, human being I needed some rest from a project and I took a whole week off from writing both posts and (partly) code for
Graphinder. I’ve been busy with code nonetheless as Regalia: Of Men And Monarchs is coming due to its beta and some of school work made me crunch on it a little more than usual.
While it’s almost impossible in job environment to take a week off from a certain project not taking a break from work per se, I’m glad I could do this with
Graphinder as now I’ve already grew hungry for new things that are waiting for implementation, starting from Monday and on!