Software Architecture

Software Architecture

13 bookmarks
Custom sorting
PostgreSQL Foreign Key
PostgreSQL Foreign Key
In this tutorial, you will learn about PostgreSQL foreign key and how to add foreign keys to tables using foreign key constraints.
The following illustrates a foreign key constraint syntax: [CONSTRAINT fk_name] FOREIGN KEY(fk_columns) REFERENCES parent_table(parent_key_columns) [ON DELETE delete_action] [ON UPDATE update_action]
In this syntax: First, specify the name for the foreign key constraint after the CONSTRAINT keyword. The CONSTRAINT clause is optional. If you omit it, PostgreSQL will assign an auto-generated name. Second, specify one or more foreign key columns in parentheses after the FOREIGN KEY keywords. Third, specify the parent table and parent key columns referenced by the foreign key columns in the REFERENCES clause. Finally, specify the desired delete and update actions in the ON DELETE and ON UPDATE clauses.
Since the primary key is rarely updated, the ON UPDATE action is infrequently used in practice. We’ll focus on the ON DELETE action.
PostgreSQL supports the following actions: SET NULL SET DEFAULT RESTRICT NO ACTION CASCADE
·neon.tech·
PostgreSQL Foreign Key
PostgreSQL Copy Table: A Step-by-Step Guide
PostgreSQL Copy Table: A Step-by-Step Guide
In this tutorial, you will learn how to copy an existing table to a new one using various PostgreSQL copy table statements.
To copy a table completely, including both table structure and data, you use the following statement: CREATE TABLE new_table AS TABLE existing_table;
·neon.tech·
PostgreSQL Copy Table: A Step-by-Step Guide
PostgreSQL Temporary Table
PostgreSQL Temporary Table
You will learn about the PostgreSQL temporary table and how to manage it using the CREATE TEMP TABLE and DROP TABLE statements.
When to use temporary tables Isolation of data: Since the temporary tables are session-specific, different sessions or transactions can use the same table name for temporary tables without causing a conflict. This allows you to isolate data for a specific task or session. Intermediate storage: Temporary tables can be useful for storing the intermediate results of a complex query. For example, you can break down a complex query into multiple simple ones and use temporary tables as the intermediate storage for storing the partial results. Transaction scope: Temporary tables can be also useful if you want to store intermediate results within a transaction. In this case, the temporary tables will be visible only to that transaction
·neon.tech·
PostgreSQL Temporary Table
Proxy Pattern
Proxy Pattern
Intercept and control interactions to target objects
·patterns.dev·
Proxy Pattern
Catalog of Patterns of Distributed Systems
Catalog of Patterns of Distributed Systems
A catalog of patterns to better understand, communicate, and teach the design of distributed systems
·martinfowler.com·
Catalog of Patterns of Distributed Systems
Data Transfer Object
Data Transfer Object
An object that carries data between processes in order to reduce the number of method calls.
·martinfowler.com·
Data Transfer Object
Architecture Principles: An approach to effective decision making in software architecture
Architecture Principles: An approach to effective decision making in software architecture
Are you a software architect and often find it difficult to make architecture decisions in your team? This article shows you how to use architecture principles to make effective decisions in your team.
A declarative statement made with the intention of guiding architectural design decisions in order to achieve one or more qualities of a system.
If we take a closer look at this definition, we find several interesting parts in this definition. "[...] intention of guiding architectural design decisions [...]" As a software architect or a team of software engineers, you have to deal with and decide on many architecture issues. But how do you decide these questions? Gut feeling? :-) That's is probably not the right approach. As we learn from the Software Architecture Canvas, there are quality goals that are drivers of architecture.
What are the basic characteristics of good architecture principles?
Comprehensible & clear
Architectural principles should be like marketing slogans.
Testable The principle should be verifiable, whether work is done according to the principle and where exceptions are made.
Atomic The principle requires no further context or knowledge to be understood. In summary, architectural principles should be written to enable teams to make decisions: they're clear, provide decision support, and are atomic.
What are the pitfalls of creating architecture principles? What do you think about the following principle 👇? "All software should be written in a scalable manner."
That's why we've adopted in a product team the following architecture principle. "Use cloud services if being lock-in to a particular cloud provider is acceptable."
Whether this vendor lock-in is acceptable depends on several criteria: The effort required to replace this managed service An acceptable lead time for providing alternatives. Let's take a look at an example technological decision we had to make in the past: We needed to evaluate a centralised identity and access management solution for our SaaS products. In addition to meeting the functional requirements, we had two powerful IAM solutions on the shortlist: Keycloak (self-hosted) Auth0 (Managed, cloud service)
Following the defined principle of "Use cloud services if being lock-in to a particular cloud provider is acceptable." we have concluded that a centralised IAM system should be self-managed and not managed by a third-party provider because it's a huge effort to replace a managed IAM product and therefore there is no reasonable lead time to deploy an alternative. In summary, vendor locking wasn't acceptable to us in this case. So this principle efficiently guides us to the right decision.
Example 2: "Prefer standard data formats over third-party and custom formats"
The next principle was about the selection of protocols for service communication. "Prefer standard data formats over third-party and custom formats"
If you have multiple services that need to communicate with each other, the question of protocol and format arises. In the protocol ecosystem there is a fairly new kid on the block: gRPC gRPC (gRPC Remote Procedure Calls) is a cross-platform, open-source, high-performance protocol for remote procedure calls. gRPC was originally developed by Google to connect a large number of microservices. So in our team, the question is: RESTful HTTP vs. gRPC?
The selection of a protocol thus depends heavily on the quality and change scenarios of the services involved. But if you can meet the quality goals and underlying requirements with both options, like RESTful HTTP vs. gRPC, then consider yourself lucky to have such a principle. This principle helped us choose RESTful HTTP over gRPC because RESTful HTTP is a widely accepted standard data format, while gRPC is more of a third-party format. So here this principle speeds up our decision making, which doesn't mean that we don't rely on gRPC in certain cases.
Software architecture may be changing in the way it's practiced, but it's more important than ever.
·workingsoftware.dev·
Architecture Principles: An approach to effective decision making in software architecture
Software Architecture Canvas: A Collaborative Way to Your Software Architecture
Software Architecture Canvas: A Collaborative Way to Your Software Architecture
The Software Architecture Canvas is a collaborative technique for elaborating the software architecture playground of a software initiative. With this canvas, you can work efficiently, iteratively, and in a time-saving manner on the software architecture of your software products as a team sport.
·workingsoftware.dev·
Software Architecture Canvas: A Collaborative Way to Your Software Architecture