Microservices

#Microservices

Microservices, the new fancy word for the creation of complex apps which are decoupled. One of the most common critics of Microservices is that sometimes it would be better to have a slightly decoupled Monolith than going for a full Microservices architecture, because of the required coordination that Microservices must have. Having logging systems and distributed coordination, is quite different to having all of this.

One of the main ideas of Microservices is to implement problemas for distributed teams, where one team is working on another location from another. At the end of the day, collaborating within teams is one of the most exhausting activities that can be held in a corporate environment.

It sounds simple, but often teams have different goals, and different schedules all together. How can we guarantee that we are going to have amazing collaboration? The main way to collaborate between teams is to provide different completed sections of the code.

Martin Fowler talks about what Microservices really are. Plenty of people just try to implement different methodologies that might work, but the harsh truth in software engineering is that often in order to have a good system, you don't need Microservices, block chain or whatever the new flavor of the day is. Often you need to think and be auto-critical. That allows for bigger growth than only exploring different frameworks of growth.


At the end, I've seen good Monoliths with amazing code, and I've seen bad monoliths with complicated code. Microservices can become a mess to manage if it isn't done in a correct way. More often than not we have comments of people having extreme trouble with Microservices. You have to remember that you aren't Google or Microsoft or Netflix. More often than not, a good monolith is the solution.

As always, I love martin's blogs.

Fowler, M. and Lewis. J."Microservices a definition of this new architectural term" https://martinfowler.com/articles/microservices.html  Consulted on Apr 23rd 2018

L. Lamport, "The Implementation of Reliable Distributed Multiprocess Systems", 1978 http:// research.microsoft.com/en-us/um/people/lamport/pubs/implementation.pdf



Ready Player One

Morrow wrote in his autobiography that he’d left GSS because ... he felt that the OASIS had evolved into something horrible. “It had become a self-imposed prison for humanity,” he wrote. “A pleasant place for the world to hide from its problems while human civilization slowly collapses, primarily due to neglect.” (p. 120)

(Halliday speaking) “I created the OASIS because I never felt at home in the real world. I didn’t know how to connect with people there. I was afraid, for all of my life. Right up until I knew it was ending. That was when I realized, as terrifying and painful as reality can be, it’s also the only place where you can find true happiness. Because reality is real.” (p. 364)

Reflect and discuss in your blog entry the answers to at least three or four of the following questions:
Do you agree with the two previous quotations?
I don't agree with the previous two quotations, yet they seem to be terrible relevant in 2018 with the facebook crisis. Is it an addiction? Maybe. But this might be the best thing to happen to people, the equalization of the world. Parzival was dirt poor, but as he was issued a system into OASIS, he didn't need to have more things in his life, that was pretty awesome, he could escape poverty in a simple way. That is really amazing. So for one side, yes, they neglected reality, buy for another part, they allowed everyone to partake in wonderful experiences.

Do you personally see any virtues in a system like the OASIS?
As mentioned in the system above, I see virtues in a system like OASIS where we can integrate people from other contexts into a life of fun and jobs from whenever they are.

Do you think our value system (personal and cultural values) could be altered if we spent most of our time in an OASIS like system?
Yes, as always, people adapt to different ethic contexts so that we can integrate them into society, and it would become a more merithocrathic society, because as we can adopt different personas, we can be who we really are. Nowadays we can see things like this in Reddit, where we have anonymized personas, where people are more "raw", or have weird or often ugly stuff, but that is because humanity has this, not because anonymity causes this.

Do you think that there are any similarities between the OASIS and the way we currently use IT technology (computers, game consoles, smart phones, etc.) and social networks (Facebook, Twitter, Instagram, Pinterest, etc.)?
I'd say there are some similarities, specially in the positive feedback loop we get with social media, we often see that clicking notifiactions of diferent systems, creates a framework of repetitive self-motivation for entering Facebook or other social networks, I think this works in a degree as OASIS. But OASIS promises so much more than a screen. It promises experiences, which are more valiable than conections.

Did you find any interesting resemblances between the dystopic “real world” presented in “Ready Player One” and those presented in other works of fiction such as “Nineteen Eighty-Four”, “The Hunger Games”, “The Matrix”, “Soylent Green”, etc.
Well, there is a line of similarity to 1984 with the element of Big Brother, and the theme seems to be the same: given enough time for Big Brother to transform, they will transform and change into this machine of hate, that self-propagates to fullfill their objective no matter what. Also IOI is really similar in tactics to Big Brother in 1984. to "The Matrix", I didn't see that many similarities, but it is interesting how on the worst times of the human species, machines come to our aid to escape reality.

Do you think it’s possible, technologically speaking, to have something similar to the OASIS by the years 2040 or 2050?
Yes, it is really easy, but the motivation isn't there, we would need amazingly expensive tools and machinery to make it real, and Moore's law seems to be reaching it's limit. Moore and other experts believe that Moore's law is going to end by 2050. That means that we are going to have a really difficult time fooling our brain. Nowadays, one of the major froteers of VR is that it causes sickness to lots of people while wearing the googles, as our brain can understand that someting is "off" about this.

Can you envision a software architecture, using currently available technologies and tools, to build a system that could evolve to something like the OASIS?
Yes, I can since procedural generation in Minecraft. Right now you can explore unlimited worlds in Minecraft, one of the particular youtubers I've seen is KurtJMac that is walking across a minecraft world, for 5 years. He has several years walking east, and he is still finding new stuff, that makes it incredibly likely for systems like OASIS to acomplish things like this. Specially with ML and AI.

[1] Cline, E. (2011). Ready player one. New York: Crown Publishers.
[2] Schaller, R. R. (1997). Moore's law: past, present and future. IEEE spectrum, 34(6), 52-59.
[3] Mac, Kurt J. “Kurtjmac.” YouTube, YouTube, 2 Dec. 2012, www.youtube.com/channel/UC1Un5592U9mFx5n6j2HyXow.
[4] Orwell, George. 1984. Harcourt Brace Jovanovich, Publishers, 1984.



PEAR

After reading the article from Edward Guiness with examples on how SOLID is implemented, I've come to want to add some things to SOLID myself, that were learned from my adventures in functional programming.

I'm introducing now:

PEAR

(P)ure functions
(E)xpect (A)nything (and Address Domain)
(R)eturn early.

(also because acronyms are cool)

(P)ure Functions

As long as you don't have to do things that modify state, or writes to I/O, try to encapsulate them into pure functions. Pure functions are those who don't have a side effect.

When possible, and not constrained by memory use:

(E)xpect (A)nything (and Address Domain)

Let's say you are making a function to sum the digits in an array. One of the main learnings of my trip through clojure was to make your input work, for all the elements in a domain.

Let's assume two things, we don't have python's sum(), and we are creating a function that adds all the elements in a list.


This guarantees that your software isn't going to crash because of an unhandled exception, and allows you to think in different ways.

You can even do this in statically typed languages like C#, for certain types, or using dynamic.


(R)eturn early


But I'll show a simple example.


Over time, i've found in my short coding career, that these save a lot of time figuring out pain points, and helps get to more practical and usable software.

What are your coding principles? The ones you couldn't live without? I'd love to know more principles you like.

References 

“Understanding the SOLID Principles” by Edward Guiness (from the book “Ace the Programming Interview: 160 Questions and Answers for Success” published by Wiley in 2013) Retrieved from: http://webcem01.cem.itesm.mx:8005/s201811/tc3049/solid.html

Uncle Bob

One of the books in my book backlog is Clean Code, In this episode of Software Engineering Daily we listen about Software Craftmanship.

From wikipedia we can see his bio:

Robert Cecil Martin (colloquially known as Uncle Bob) is an American software engineer and author. He is a co-author of the Agile Manifesto. He now runs a consulting firm called Uncle Bob Consulting LLC and Clean Coders which hosts videos based on his experiences and books.

He is a contributor to SOLID, TDD, and Agile.

One of the things he exposes in this podcast, is that being Agile is not separated from a document driven approach, but that the team decides which documents are important, and exclusive to the team.

"When software developers come out of college, they know very little of what they have to do on the job. It is very shocking to come out of school and see that it is different." starts his explanation of how it is problematic to start in software craftsmanship.

Let's look at how a carpenter would start at work, the first carpenters would start learning from a master, and do simple jobs. Then he would slowly start progressing, to more complex work, this is different from working people right now, where they are expected to be productive from day one.

Martin exposes a new concept of "proudness". Being proud about the code you produce, see that the code that you wrote is really good, that you followed really good patterns. Pushing out code you are proud it is incredible.

In my work, lately, I've been working with continuous development, and having wonderful times with the speed it provides. Software craftsmanship is a base part of how we become professionals, instead of code monkeys.


Martin, Bob. Software Engineering Radio (2009).

Robert Cecil Martin. (n.d.). In Wikipedia. Retrieved Feb 6, 2018, from



Design is dead.


In this wonderful article, Martin fowler talks about how trying to fit your code around patterns, and forcing them, could do more harm than good. Personally in my experience I've had lots of problems with YAGNI (You aren't going to need it). Even though I profess some of the things related to XP, I try not to marry into anything. There is times where careful design is needed, and you can't do everything as fast as with XP.

One of my major pet peeves is when I create software, and they ask me to draw the UML. The UML often times is illegible, but I could understand how in really complex software you would love a UML in order to make sense of the data.

I think, that as always, *it depends* on the scale and purpose of your system, trying to make absolute asseverations only hurts the software engineering space.

I will make an emphasis on the next points, which are really important.

- A constant desire to keep code as clear and simple as possible
- Refactoring skills so you can confidently make improvements whenever you see the need.
- A good knowledge of patterns: not just the solutions but also appreciating when to use them and how to evolve into them.
- Designing with an eye to future changes, knowing that decisions taken now will have to be changed in the future.
- Knowing how to communicate the design to the people who need to understand it, using code, diagrams and above all: conversation.

I'd like to make an emphasis in <understanding> the patterns and <appreciating> when to use them. Those two things, are the entire reason for taking this class, and it is wonderful. I hope that soon we can see a beautiful array of patterns in the wild.

Fowler, Martin. "Is Design Dead" (2004). Retrieved from https://martinfowler.com/articles/designDead.html