Seven Deadly Sins of Microservices

The Microservice approach is gaining a lot of traction at the minute however not all of it is smooth sailing for development teams. A number of anti-patterns have been suggested in the following article and video recording:

https://opencredo.com/the-seven-deadly-sins-of-microservices-redux/

https://www.infoq.com/presentations/7-sins-microservices

Personally I have to admit to observing several of these issues first hand. In the case of the Sloth sin there is a natural tendency for some teams to enforce DRY principles to the extreme. One such example of this is the desire to create a single common domain to be shared across Microservices. I personally feel that this should be avoided at all costs as it results in high degrees of efferent coupling across applications. Any benefits this approach might provide will ultimately work against the Microservice desire to encapsulate and segregate common functionality. In addition the net effect will often require bigger releases to accommodate basic changes to the domain.

Advertisements

Thinking in Coroutines (Python Asyncio)

Interesting O’Reilly podcast today by Lukasz Langa (Facebook) on Python Asyncio.

Python threads still seems to suffer when it comes to parallel processing although this all seems to be due to the structure of the Global Interpreter Lock.

Thankfully asyncio looks reasonably developer friendly by focusing on concurrency rather than parallel processing. Combined with the use of Processor Pool Executors it looks like some potential performance gains. It also finally suggests some real gains to finally switch up to Python 3.5!

Hosting Static Website on AWS S3 Bucket

Great little introduction on how to host a static website on AWS S3 bucket.

http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Its really easy to setup and configure. I used a GoDaddy certificate and redirected with a masked url. All in all it took a matter of minutes to set it up but you have to make sure to make the site public each time you upload / re-upload content to the s3 bucket 😦

Spring Boot REST External APIs

Recently I’ve been developing a lot of REST styled microservices using Spring Boot. We’ve been looking a lot at technologies to make these new endpoints available externally.

Some nice technologies we’ve come across so far include:

  • Spring Cloud Security
    • https://cloud.spring.io/spring-cloud-security/
    • Greatly simplifies spring security 4 so that all you need are meta annotations and basic spring configuration (i.e. application.yml).
    • This allowed us to setup microservices as Resource Services!
  • JSON Web Tokens (JWT)
    • Supports json data in authentication tokens (i.e. bearer token)
    • The http://jwt.io provides a fantastic introduction and a very useful debugging tool
  • Swagger
    • Rest api documentation generated at source
  • HTTPie