Architecture Flashcards

1
Q

coupling vs cohesion

A

If we have a number of Java classes, coupling describes the relationship between those classes, while
cohesion describes the relationships between the methods inside each one.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

advice on what makes good code

A
  • Say what you mean, mean what you say
    A common mistake with method naming is to describe how it works internally, instead of describing what the outcome is.
  • Take care of the details in private
  • Avoid accidental complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

TDD approch

A

Red — think about what you want to develop
Green — think about how to make your tests pass
Refactor — think about how to improve your existing implementation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Protocol Buffers (Protobuf):

A
  • Protobuf is a method for serializing structured data, and it’s language-agnostic.
  • It provides a way to define data structures and then generate code in various programming languages to read and write data in those structures.
  • Protobuf is often used for data interchange between systems, configuration files, and for storing structured data. It’s efficient, compact, and easier to maintain than hand-written data serialization code.
  • Protobuf files use a .proto extension and contain the data structure definitions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

gRPC

A
  • gRPC is a high-performance, language-agnostic remote procedure call (RPC) framework that uses Protobuf for data serialization.
  • It allows you to define the structure of your service methods and message types using Protobuf.
  • gRPC supports multiple programming languages and enables efficient communication between distributed systems.
  • It uses HTTP/2 as the transport protocol, which offers features like multiplexing, flow control, and header compression.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Scaling

A

Vertical scaling, referred to as “scale up”, means the process of adding more power (CPU, RAM, etc.) to your servers
* Vertical scaling has a hard limit. It is impossible to add unlimited CPU and memory to a
single server.
* Vertical scaling does not have failover and redundancy. If one server goes down, the
website/app goes down with it completely.

Horizontal scaling, referred to as “scale-out”, allows you to scale by adding more servers into your pool of resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Advantages of database replication:

A
  • Better performance: In the master-slave model, all writes and updates happen in master nodes; whereas, read operations are distributed across slave nodes. This model improves performance because it allows more queries to be processed in parallel.
  • Reliability: If one of your database servers is destroyed by a natural disaster, such as a typhoon or an earthquake, data is still preserved. You do not need to worry about data loss because data is replicated across multiple locations.
  • High availability: By replicating data across different locations, your website remains in operation even if a database is offline as you can access data stored in another database server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cache Consideration:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is throttling?

A

Throttling is a process of limiting the amount of data that can be transferred between two systems in a given period of time. This is often done to prevent one system from overloading another system with too much data, or to prevent one user from consuming too much of a shared resource.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What Is Aspect-Oriented Programming (AOP)?

A

Aspects enable the modularization of cross-cutting concerns such as transaction management that span multiple types and objects by adding extra behavior to already existing code without modifying affected classes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What Are Aspect, Advice, Pointcut and JoinPoint in AOP?

A

Aspect – a class that implements cross-cutting concerns, such as transaction management
Advice – the methods that get executed when a specific JoinPoint with matching Pointcut is reached in the application
Pointcut – a set of regular expressions that are matched with JoinPoint to determine whether Advice needs to be executed or not
JoinPoint – a point during the execution of a program, such as the execution of a method or the handling of an exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What Is Weaving?

A

weaving is a process that links aspects with other application types or objects to create an advised object. This can be done at compile time, load time, or runtime. Spring AOP, like other pure Java AOP frameworks, performs weaving at runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Reactive Princples

A

Responsive – The system should respond in a timely manner.
Resilient – In case the system faces any failure, it should stay responsive.
Elastic – Reactive systems can react to changes and stay responsive under varying workload.
Message-driven – Reactive systems need to establish a boundary between components by relying on asynchronous message passing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly