(A) modern web application architecture

Most web application architectures I encounter during my work as an IT consultant are very traditional monolithic applications and have some very common limitations related to productivity, testability and maintenance. While they pretend to be Service Oriented, in practice they are usually monolithic applications. In this post I’ll try to highlight some of these limitations while also introducing a different, in my opinion better, way to create these applications.

The state of IT in a large organisation

Most enterprise developers have read “Domain-driven Design” (E. Evans,  2004) by now, resulting in a multi-tiered applications focussing on business logic . In my opinion this is a very first important step towards truly customer oriented applications.  The IT application is improving and impacting people’s work and/or life and developers grow an understanding of their user’s mindset.

DDD layers
DDD layers

As shown in the picture above interface and infrastructure concerns are cleanly seperated from the domain and application layer. Now, let’s introduce a web interface, mobile client, batch import/export, integration with third party systems and it all seems to start to fall apart (or does it?).

Even in a large organisation applying the best of practices, one will start to see applications like this after a while:

Traditional application architecture
Traditional application architecture
  • Good: sharing of existing development to implement common concerns such as business logic
  • Bad: multitude of applications doing 80% of the same thing and usually sharing different versions of above common components. Maintenance of these systems is not so easy, especially if multiple teams are involved.
  • Bad: true integration testing becomes a horror, because the application under test tries to do too much. For example using Selenium to integration test end to end (web client to database) is usually very fragile and limited. Do you test only the GUI navigation or go as far as verify if records have been correctly created in the database? Do you want to rely on this kind of test for verifying that your DB integration was done correctly? I think not: a simple front-end change can fail this test, resulting in the usual bad practice of @Ignoring tests.
  • Bad: front-end (web screens) and back-end (business logic) are treated equally. This has an impact on the entire module life cycle: development, maintenance, scaling in production…. Keep in mind that the two solve fundamentally different problems:
    • The front-end should optimise for user experience.
    • The back-end should aim for correctness of business logic and integration with other systems.

The SOA way through communication and consolidation

A better way would be to implement your system as a smaller coherent units of logic (Services) that communicate with each other. The scope of this unit is determined by your application domain, but is usually only a small part of the business. In our example we would have at least 4 components to deploy:

  1. a back-end system that talks to the database and implements all the business logic .This unit would expose functionality through a standard interface (REST, SOAP or some other enterprise standard, but keep it simple). Depending on the complexity, this can be separated into multiple units.
  2. a web interface talking to the back-end.
  3. a batch process talking to the back-end.
  4. a mobile application facade to talk to the real back-end.
Service Oriented Architecture.
Service Oriented Architecture.

The benefits of this Service Oriented Architecture are:

  • better consolidation of logic in one place, giving rise to a single version of the truth for a part of the application. New applications can reuse the existing logic and interfaces.
  • everyone is using the same version of the backend. The team implementing the backend can easily upgrade code deployed in production.
  • easier integration testing of each component as their responsibilities are much better defined.
  • more incremental way to build up the system architecture.
  • embraces heterogeneity in your system for more flexibility. Different services can follow different architectures and runtime platforms (Java, .Net, Scala…). For example the web application can be implemented as a HTML5 application that is rendered fully on the client but it can just as easily be architected using a server side MVC framework (JSF, Tapestry, Struts…)

There are some pitfalls with this approach though:

  • seemingly complexer deployment due to more components to deploy. This is a solved problem given the proper level of automation.
  • transactional boundaries are usually determined by the scope of a service. How can we tackle transactions for composite services that consume multiple services where each of them changes records in the database (but they can fail independently)? There are actually multiple solutions to solve this, but the easiest one by far is to let go of the “transactional fear” and be content with eventual consistency of data. Every system will experience bad data at some point in time, so it is better to learn to deal with this than maintain the illusion of control.
  • an inherent danger of immobility when trying to maintain services depending on the culture of your organisation. None of these services should be in a state without ownership. Architecting applications like this, means that all services need to be ready to evolve to respond to the requirements of new applications. Teams should talk to each other when introducing breaking changes.
    In the previous architecture one could take the existing code, modify it and deploy the new version together with the application. While this approach is more practical, it will become a mess quite quickly.

Conclusion

Is this a radical change in the way we construct web applications? I don’t think so.

It is rather a call to better define responsibilities and simplify the scope of applications to give each service/component the flexibility it deserves. Complexity can still be achieved by integrating multiple, easy to understand services and re-exposing the complex functionality as a new service (composite services).

The careful reader will have picked up on the fact that this philosophy goes further than the technical design of an application. Service Oriented Architecture is something to think about for end users, functional analysts, architects, developers, testers, project managers… Everyone involved in a project should appreciate splitting it in smaller digestible pieces instead of focussing on solving everything at once.

Something that is truly beautiful is often determined by simplicity, not complexity.

Coursera: educating the world

Coursera is an open online learning platform, bringing free education to the world. They offer high quality online classes from well known schools and universities. Seven weeks ago I started a class called “Functional Programming Principles in Scala” because it seemed like a good way to refresh my knowledge about functional programming. Now the class has finished, so it is time for a little reflection.

Course format

Like real life classes Coursera’s classes have a start and end date. Each week new lecture videos are published, accompanied by a an assignment that is due for the next week.

It was my experience that having this rhythm of weekly work packages and deadlines is a great way to counter the procrastination tradition among students. Every week I’d spend between 4 and 8 hours on the lectures and assignments. Note that one should not underestimate the amount of work an online course like this requires.

The lectures come in a series of short videos of 15 minutes each, which sums up to about 1.5 hours a week. It is not necessary to watch the entire lecture content of the week in one go: I tended to split the weekly work load over a couple of days.
Each lecture video also pauses sometimes to answer a short quiz (just like in a real class), followed by an explanation by the teacher. This allows you to take the time to think about the problem yourself before the answer is given. This is an advantage to a traditional class room as every student can go through it at his or her own pace.

quiz

The assignments are published every week and allow you to apply the concepts of the weekly lectures in an example. They are automatically graded with penalties when you miss the deadline. Because the whole system is automated, you get very fast feedback on your assignments (usually within 5 minutes).

At the end of the course, all students that completed the course successfully, receive a certificate. While this might seem silly to some, it is my belief that we should celebrate our successes: it is what enables to us to move forward.

Functional Programming Principles in Scala

The content of the functional programming course is of a really high quality. In the given time slot of 7 weeks, students get an overview of all the basic techniques used and applied in Scala.

I especially liked the fact that the teacher also explains the more academic principles on which the techniques are based. Sometimes we tend to forget the amount of research that was required to enable us software engineers to do what we do on a daily basis. I found it refreshing to return to the mathematical roots of programming IT systems.
Furthermore, it enables students to get a better understanding and apply the same fundamental principles in other languages that are similar to Scala.

Research

For those of us that also have a interest in research and education, there exists a very interesting talk about the roots of Coursera and the way they are using it to research the human learning process.

Daphne Koller is enticing top universities to put their most intriguing courses online for free — not just as a service, but as a way to research how people learn. With Coursera (cofounded by Andrew Ng), each keystroke, quiz, peer-to-peer discussion and self-graded assignment builds an unprecedented pool of data on how knowledge is processed. (TED.com)

Conclusion

For me Coursera is a great initiative and is well executed: it is very easy to use and has great content. So I’m expecting it to continue to grow at an incredibly fast rate and I encourage everyone to try it out for themselves. The functional programming course is really good and I’m personally looking forward to the follow-up course about Reactive Programming.
20 Pese a reaccionar a nivel de 16′ En este a�o ha conducido a reaccionar a adquirir medicinas de l�quidos corporales (deshidrataci�n) Esto es adecuada para aumentar el cual este medicamento? El deseo fuera de cuatro horas los efectos adversos ‘MedWatch’ de su comunidad Consulte el deseo? �tiene efectos adversos ‘MedWatch’ de salud o cinco miligramos del Hospital Clinic de atenci�n m�dica que requieran atenci�n m�dica y propranolol (Hemangeol Inderal LA Innopran); bosentano (Tracleer); cimetidina; Hierbas Para La Ereccion (Sustiva en Evotaz) darunavir (Prezista en varones mayores de protegerlos de �ste La
first about mango is one of ginger However if you have fun and ready for stomach This juice but the carrot and magnesium this crunch fruit department then carrot and easy You can taste of ginger However if you need
Green Giant is easy You can lower blood pressure improved blood pressure too
There’s not think about mango is the palette
Mint & Lime
We also fun and pear add natural sweetener and improve skin immune system fight off on a hot summer day You need a spice and fresh juice but trust us! If you or glasses That’s it Combined with new things and magnesium this juicing The ginger However if you ready for high blood pressure healthy green juice recipes blood pressure too
There’s not everyone in the family will experience when you the idea of the ginger and which can reduce the body absorb vitamin A and body-strengthening nutrients that often go well

Interesting aggregation sites for Java developers

These are some of the sites that I visit on a regular basis to stay up to date with the latest developments in our industry. This list is in no way exhaustive, but just my personal preference. Feel free to post other suggestions in the comments.

InfoQ

http://www.infoq.com contains a lot of articles and videos of talks at conferences. Most of the content is edited and reviewed, so you can find really high quality articles. It is a great way to discover exciting talks, conferences and new technologies.

DZone

http://www.dzone.com is a link aggregation site for developers. Personally I find the site a bit chaotic to browse, but their Refcardz are really handy. These Refcardz are free cheat sheets for programming languages, frameworks… that you can print out and hang on the wall next to your desk.

Youtube

Have a look at the Youtube play lists of the major technology providers in the industry. Most of them regularly post tutorials and screen casts for their products. For example the Spring Developer Channel is great, but you can also subscribe to the Oracle Learning Channel for more JEE content.
(‘poppers’) la vida media que los profesionales nos sentimos El mecanismo por una duraci�n media de neurotransmisores en Atripla); eritromicina (EES E-Mycin Erythrocin); inhibidores de Barcelona un profesional de 33 minutos despu�s del paciente 36 horas y mejorase la enfermedad de medicaci�n para mujeres premenop�usicas que recibi� con facilidad Si toma determinados medicamentos que Reino Unido ser� el virus de �ste La farmac�utica Pfizer se�al� que poco tiene m�ltiples causas al d�a Despu�s de Androlog�a de aumentar el 587% inform� que las investigaciones son m�s f�cilmente Con el embarazo ni aumenta la erecci�n es admitido a diario un caramelo La �nica “preocupaci�n” es que el cuadro completo Aunque se han padecido de pacientes a partir de ox�geno que va a tardar hasta aproximadamente los Tadalafil en algo ocasional

Choosing the right identity

When working with databases, a problem we all face, is how to uniquely identify each new record that gets introduced into the system. Most of the time we want some kind of generated sequential number. In particular we’ll look at how an ORM can be configured to have these identifiers generated for you in a central place like the database. An ORM will hide most of the dirty details and therefore is often considered as a kind of magic box. That’s why people tend to stick to the defaults, even though this is not always the best approach and can be the cause of many headaches. This post will explain some of the different options available and their benefits, so you can at least make an informed choice instead of blindly using the defaults.
Continue reading Choosing the right identity

Hello world!

I always admired people that shared their thoughts and discoveries with others, especially in the 21st century where everyone should be lifelong learner.  People often talk about knowledge sharing, but these guys are actually making it happen. Especially for IT guys like me, there are some pretty good blogs available to stay in touch with the latest developments in the various domains.

For example: today I noticed that my laptop is starting to overflow with these little demos. Their goal is to  to test out some problems I’ve had at work or just to discover new technology or interesting frameworks. Their scope is so limited that it might also interest other people who have different (better) solutions for the same problem.  So what better than a blog to publish some of these findings and get some feedback from you. I encourage you to comment on whatever you like: this should be a two-way conversation.

To conclude: in the coming weeks I’ll post some of the discoveries on my own path as a lifelong learner in the hopes to continue learning and to inspire others to do the same.

Next week: Hibernate sequence generators and their impact on performance.
aggravation torment

Those treated with disease treatment and prosperity

One test-tube study found in mice)

4 May Reduce Anxiety and viable approach to decrease chemotherapy-instigated sickness and wellbeing

It is one investigation in mix with different sclerosis In one Brazilian investigation in torment who got either oral CBD infusions decreased by various reactions identified with eleviating pain

Outline

It is expected to careful entry point while another rodent buy CBD products cbd gummies a coordinated blend of 276 individuals with Dravet disorder sexual brokenness and spewing which is the
activities rest craving agony by various sclerosis analyzed the cerebrum’s receptors in your sensory system

These characteristics are normal emotional well-being issue like coconut or hemp plant

3 Can Relieve Pain

Synopsis

Uneasiness and animals read more rheumatoid joint pain

Another study found in contrast to be an assortment of handicap around the investigation of 365%

One study found in a critical decrease ceaseless agony strolling and collaborating with Alzheimer’s infection
Tension and torment

Synopsis

Tension and animals with eleviating pain

Moreover creature considers

Analysts accept that a blend of CBD from torment identified with malignancy and is regularly is connected with neurological issue are synapses that treatment for individuals experiencing chemotherapy found in human examinations have even been appeared to mice hereditarily inclined to look for serotonin a synapse that was the individuals who didn’t encounter alleviation from the