Topic: DevOps
Difficulty: ⭐
Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
🔗 Source: edureka.co
Topic: Docker
Difficulty: ⭐
🔗 Source: edureka.co
Topic: DevOps
Difficulty: ⭐⭐
Containerisation is a type of virtualization strategy that emerged as an alternative to traditional hypervisor-based virtualization.
In containerization, the operating system is shared by the different containers rather than cloned for each virtual machine. For example Docker provides a container virtualization platform that serves as a good alternative to hypervisor-based arrangements.
🔗 Source: linoxide.com
Topic: Microservices
Difficulty: ⭐⭐
Microservices, aka Microservice Architecture, is an architectural style that structures an application as a collection of small autonomous services, modeled around a business domain.
🔗 Source: lambdatest.com
Topic: DevOps
Difficulty: ⭐⭐⭐
Blue-green deployment is a technique that reduces downtime and risk by running two identical production environments called Blue and Green. At any time, only one of the environments is live, with the live environment serving all production traffic. For this example, Blue is currently live and Green is idle.
As you prepare a new version of your software, deployment and the final stage of testing takes place in the environment that is not live: in this example, Green. Once you have deployed and fully tested the software in Green, you switch the router so all incoming requests now go to Green instead of Blue. Green is now live, and Blue is idle.
This technique can eliminate downtime due to application deployment. In addition, blue-green deployment reduces risk: if something unexpected happens with your new version on Green, you can immediately roll back to the last version by switching back to Blue.
🔗 Source: cloudfoundry.org
Topic: DevOps
Difficulty: ⭐⭐⭐
In Blue Green Deployment, you have TWO complete environments.
One is Blue environment which is running and the Green environment to which you want to upgrade. Once you swap the environment from blue to green, the traffic is directed to your new green environment. You can delete or save your old blue environment for backup until the green environment is stable.
In Rolling Deployment, you have only ONE complete environment. The code is deployed in the subset of instances of the same environment and moves to another subset after completion.
🔗 Source: stackoverflow.com
Topic: DevOps
Difficulty: ⭐⭐⭐
🔗 Source: atlassian.com
Topic: DevOps
Difficulty: ⭐⭐⭐
Serverless refers to a model where the existence of servers is hidden from developers. It means you no longer have to deal with capacity, deployments, scaling and fault tolerance and OS. It will essentially reducing maintenance efforts and allow developers to quickly focus on developing codes.
Examples are:
🔗 Source: linoxide.com
Topic: Microservices
Difficulty: ⭐⭐⭐
🔗 Source: lambdatest.com
Topic: Microservices
Difficulty: ⭐⭐⭐
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐
Microservices
Monolithic Architecture
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐
As we start to model more and more complex logic, we have to deal with the problem of managing business processes that stretch across the boundary of individual services.
With orchestration, we rely on a central brain to guide and drive the process, much like the conductor in an orchestra. The orchestration style corresponds more to the SOA idea of orchestration/task services. For example we could wrap the business flow in its own service. Where the proxy orchestrates the interaction between the microservices like shown in the below picture.
With choreography, we inform each part of the system of its job, and let it work out the details, like dancers all find‐ ing their way and reacting to others around them in a ballet. The choreography style corresponds to the dumb pipes and smart endpoints mentioned by Martin Fowler’s. That approach is also called the domain approach and is using domain events, where each service publish events regarding what have happened and other services can subscribe to those events.
🔗 Source: stackoverflow.com
Topic: Microservices
Difficulty: ⭐⭐⭐
Smart endpoints just meaning actual business rules and any other validations happens behind those endpoints which are not visible to anyone to the consumers of those endpoints think of it as a place where actual Magic happens.
Dumb pipelines means any communication means where no further actions e.g validations are taken place, it simply carries the data across that particular channel and it may also be replaceable if need be. The infrastructure chosen is typically dumb (dumb as in acts as a message router only). It just means that routing is the only function the pipes should be doing.
🔗 Source: stackoverflow.com
Topic: Microservices
Difficulty: ⭐⭐⭐
GraphQL and microservices are a perfect fit, because GraphQL hides the fact that you have a microservice architecture from the clients. From a backend perspective, you want to split everything into microservices, but from a frontend perspective, you would like all your data to come from a single API. Using GraphQL is the best way I know of that lets you do both. It lets you split up your backend into microservices, while still providing a single API to all your application, and allowing joins across data from different services.
🔗 Source: stackoverflow.com
Topic: DevOps
Difficulty: ⭐⭐⭐⭐
🔗 Source: stackoverflow.com
Topic: Docker
Difficulty: ⭐⭐⭐⭐
VM manager takes over the CPU ring 0 (or the “root mode” in newer CPUs) and intercepts all privileged calls made by guest OS to create illusion that guest OS has its own hardware. Fun fact: Before 1998 it was thought to be impossible to achieve this in x86 architecture because there was no way to do this kind of interception. The folks at VMWare were the first who had an idea to rewrite the executable bytes in memory for privileged calls of guest OS to achieve this.
The net effect is that virtualization allows you to run two completely different OS on same hardware. Each guest OS goes through all the process of bootstrapping, loading kernel etc. You can have very tight security, for example, guest OS can’t get full access to host OS or other guests and mess things up.
🔗 Source: stackoverflow.com
Topic: Docker
Difficulty: ⭐⭐⭐⭐
Paravirtualization, also known as Type 1 hypervisor, runs directly on the hardware, or “bare-metal”, and provides virtualization services directly to the virtual machines running on it. It helps the operating system, the virtualized hardware, and the real hardware to collaborate to achieve optimal performance. These hypervisors typically have a rather small footprint and do not, themselves, require extensive resources.
Examples in this category include Xen, KVM, etc.
🔗 Source: stackoverflow.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
Idempotence refers to a scenario where you perform a task repetitively but the end result remains constant or similar.
🔗 Source: lambdatest.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
Pros:
Cons:
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
According to Martin Flower, contract test is a test at the boundary of an external service which verifies that it meets the contract expected by a consuming service.
Also, contract testing does not test the behavior of the service in depth. Rather, it tests that the inputs & outputs of service calls contain required attributes and the response latency, throughput is within allowed limits.
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
An architect in microservices architecture plays the following roles:
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
An API Gateway is a server that is the single entry point into the system. It is similar to the Facade pattern from object‑oriented design. The API Gateway encapsulates the internal system architecture and provides an API that is tailored to each client. It might have other responsibilities such as authentication, monitoring, load balancing, caching, request shaping and management, and static response handling.
A major benefit of using an API Gateway is that it encapsulates the internal structure of the application. Rather than having to invoke specific services, clients simply talk to the gateway.
🔗 Source: nginx.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
There are some:
🔗 Source: nginx.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐
Materialized View pattern is the solution for aggregating data from multiple microservices and used when we need to implement queries that retrieve data from several microservices. In this approach, we generate, in advance (prepare denormalized data before the actual queries happen), a read-only table with the data that’s owned by multiple microservices. The table has a format suited to the client app’s needs or API Gateway.
A key point is that a materialized view and the data it contains is completely disposable because it can be entirely rebuilt from the source data stores.
This approach not only solves the problem of how to query and join across microservices, but it also improves performance considerably when compared with a complex join, because you already have the data that the application needs in the query table.
🔗 Source: microsoft.com
Topic: DevOps
Difficulty: ⭐⭐⭐⭐⭐
Canary Releasing is a technique to reduce the risk of introducing a new software version in production. This is done by slowly rolling out the change to a small subset of users before giving it out to the entire infrastructure, i.e. making it available to everybody.
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Conway’s Law applies to modular software systems and states that:
“Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization’s communication structure”.
🔗 Source: lambdatest.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
🔗 Source: quora.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Cohesion refers to what the class (or module) can do. Low cohesion would mean that the class does a great variety of actions - it is broad, unfocused on what it should do. High cohesion means that the class is focused on what it should be doing, i.e. only methods relating to the intention of the class.
As for coupling, it refers to how related or dependent two classes/modules are toward each other. For low coupled classes, changing something major in one class should not affect the other. High coupling would make it difficult to change and maintain your code; since classes are closely knit together, making a change could require an entire system revamp.
Good software design has high cohesion and low coupling.
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
This is basically a pattern for developing Microservices so that they can be used by external systems. When we work on microservices, there is a particular provider who builds it and there are one or more consumers who use Microservice.
Generally, providers specify the interfaces in an XML document. But in Consumer Driven Contract, each consumer of service conveys the interface expected from the Provider.
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Reactive Extensions also are known as Rx. It is a design approach in which we collect results by calling multiple services and then compile a combined response. These calls can be synchronous or asynchronous, blocking or non-blocking. Rx is a very popular tool in distributed systems which works opposite to legacy flows.
🔗 Source: edureka.co
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Microservices introduce eventual consistency issues because of their laudable insistence on decentralized data management. With a monolith, you can update a bunch of things together in a single transaction. Microservices require multiple resources to update, and distributed transactions are frowned upon (for good reason). So now, developers need to be aware of consistency issues, and figure out how to detect when things are out of sync before doing anything the code will regret.
Think how transactions occur and what kind make sense for your services then, you can implement a rollback mechanism that un-does the original operation, or a 2-phase commit system that reserves the original operation until told to commit for real.
Financial services do this kind of thing all the time - if I want to move money from my bank to your bank, there is no single transaction like you’d have in a DB. You don’t know what systems either bank is running, so must effectively treat each like your microservices. In this case, my bank would move my money from my account to a holding account and then tell your bank they have some money, if that send fails, my bank will refund my account with the money they tried to send.
🔗 Source: softwareengineering.stackexchange.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Here are two approaches which I know are used to implement distributed transactions:
2PC is a protocol for applications to transparently utilize global ACID transactions by the support of the platform. Being embedded in the platform, it is transparent to the business logic and the application code as far as I know.
Sagas, on the other hand, are series of local transactions, where each local transaction mutates and persist the entities along with some flag indicating the phase of the global transaction and commits the change. In the other words, state of the transaction is part of the domain model. Rollback is the matter of committing a series of “inverted” transactions. Events emitted by the services triggers these local transactions in either case.
I personally consider Saga capable of doing what 2PC can do, but they have the overhead of implementing the redo mechanism. Opposite is not accurate. I think Sagas are universal, while 2PC involves platform/vendor lockdown and lacks platform independence.
🔗 Source: stackoverflow.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Components in a system use “pipes” (HTTP/S, queues, etc…) to communicate with each other. Usually these pipes flow through an ESB (Enterprise Service Bus) which does a number of things to the messages being passed between components.
It might do:
Once it’s completed these tasks the message will be forwarded onto the “endpoint” component. This is an example of “smart pipes” as lots of logic and processing reside inside the ESB (part of the system of “pipes”). The endpoints can then be “dumb” as the ESB has done all the work.
“Smart endpoints and dumb pipes” advocates the opposite scenario. That the lanes of communication should be stripped of business processing and logic and should literally only distribute messages between components. It’s then the components themselves that do processing / logic / validation etc… on those messages.
🔗 Source: stackoverflow.com
Topic: Microservices
Difficulty: ⭐⭐⭐⭐⭐
Add identity service and authorize service access through it using tokens. Any service that has protected resources will talk to the Identity service to make sure the credentials (token) it has are valid. If they are not it will redirect the user for authentication. Once the token had been validated then it could be saved in the session so subsequent calls in the user’s session did not have to make the additional call. You can also create a scheduled job if tokens need to be refreshed in that session.
A good way to resolve it is by using the OAuth 2 protocol. In this situation you could authenticate with an OAuth 2.0 endpoint and the token will be added to the HTTP header for calls to your domain. All of the services shall be routed from that domain so you could get the token from the HTTP header.
🔗 Source: stackoverflow.com
Thanks 🙌 for reading and good luck on your interview!
Please share this article with your fellow devs if you like it!
#microservices #docker #devops #aws #serverless