Skip to content

Commit b2445df

Browse files
committed
Move release notes and early articles to Markdown
1 parent 1f426f5 commit b2445df

10 files changed

Lines changed: 237 additions & 254 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: 3 solutions to the 3 layer problem
3+
date: '2023-08-10'
4+
icon: adjustments-question
5+
summary: What is the 3 layer problem, and how SQLPage solves it?
6+
---
7+
8+
# 3 solutions to the 3 layer problem
9+
10+
> Some interesting questions emerged from the article [Repeating yourself thrice doesn't turn you into a 3X developer](https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0).
11+
> This short follow-up article aims to answer them and clarify some points.
12+
13+
Hello all,
14+
15+
I am Ophir Lojkine, the main contributor of the open-source application server **SQLPage**.
16+
17+
The previous article focused on the conventional model of splitting applications into three distinct tiers:
18+
19+
1. a graphical interface (_front-end_),
20+
2. an application server (_back-end_),
21+
3. and a database.
22+
23+
In many projects, this results in three distinct implementations of the application’s data model:
24+
25+
1. First, in SQL, in the form of tables, views, and relationships in the database,
26+
2. Then, in _server side_ languages such as Java, Python, or PHP, to create an API managing access to the data, and to implement the business logic of the application,
27+
3. Finally, in JavaScript or TypeScript to implement data manipulation in the user interface.
28+
29+
![Traditional tiers model](blog/three-layers.svg)
30+
31+
---
32+
33+
The topic of interest here is the duplication of the data model between the different layers,
34+
and the communication overhead between them.
35+
We are not talking about how the code is structured within each layer.
36+
It can follow a Model-View-Controller pattern or not, it doesn't matter.
37+
38+
This three-layer model has several advantages:
39+
specialization of the programmers,
40+
parallelization of work,
41+
scalability,
42+
separation of concerns,
43+
and an optimal exploitation of the capacities of the infrastructure on which each layer is deployed:
44+
web browser, server application and database.
45+
46+
Nevertheless, in large-scale projects,
47+
there is often a certain redundancy of the code between the different layers,
48+
as well as a non-negligible share of code dedicated to communication between them.
49+
For small teams and solo developers, this becomes a major drawback.
50+
51+
## 3 solutions
52+
53+
Fortunately, there are several approaches to solving this problem:
54+
55+
1. For **UI-centric applications** without complicated data processing needs,
56+
you can almost completely abandon server-side development and **directly expose the data to the frontend**.
57+
Open-source tools available in this space include Supabase, PocketBase or Hasura.
58+
2. For **applications with a predominant business logic**, traditional _web frameworks_
59+
solve this problem by centralizing frontend and database control in the backend code.
60+
A common solution involves using an ORM and templating system instead of a dedicated javascript application.
61+
Popular solutions include Django, Ruby on Rails, or Symphony.
62+
3. For simpler applications, it is possible to **avoid both backend and frontend development**
63+
by adopting a _database-first_ approach.
64+
This alternative, although less widespread, allows taking advantage of under-exploited modern capacities of relational databases.
65+
The purpose of the original article was to introduce this lesser known approach.
66+
* **SQLPage** is representative of this last category,
67+
which allows designing a complete web application _in SQL_.
68+
This leads to a loss of control over the precise visual appearance of the application,
69+
which will get a “standardized” look and feel.
70+
On the other hand, this translates into significant gains in terms of development speed,
71+
simplicity and performance.
72+
This solution is not intended to compete with traditional _frameworks_,
73+
but rather integrate earlier in the life cycle of a project.
74+
It thus makes it possible to quickly develop a data structure adapted to the application,
75+
and to iterate over it while benefiting from continuous visual feedback on the final result.
76+
Then, when the application grows, it’s easy to add a classic frontend and backend on top of the existing database,
77+
without having to start from scratch.
78+
79+
Whichever approach is chosen in the end,
80+
a solid understanding of the conventional three-tier architecture,
81+
as well as a clear perspective on the challenges it creates and the possible solutions,
82+
facilitates decision-making and the evolution of the project with the best suited technologies.

examples/official-site/sqlpage/migrations/14_sorry_i_forked.sql renamed to examples/official-site/content/blog/im-sorry-i-forked-you.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
INSERT INTO blog_posts (title, description, icon, created_at, content)
2-
VALUES (
3-
'I’m sorry I forked you',
4-
'SQLPage forked the sqlx database drivers library. Here is why.',
5-
'git-fork',
6-
'2023-08-13',
7-
'
1+
---
2+
title: I’m sorry I forked you
3+
date: '2023-08-13'
4+
icon: git-fork
5+
summary: SQLPage forked the sqlx database drivers library. Here is why.
6+
---
7+
88
# I’m sorry I forked you
99

1010
I’ve been immersed in open source coding since my teenage years, and now, I can’t fathom a world without it.
@@ -13,7 +13,7 @@ Each company adds its proprietary touch to this vast open source landscape,
1313
but they are ultimately just forming a unique blend atop a colossal iceberg of shared resources.
1414
In the software world, open source truly is the driving force behind innovation.
1515

16-
## Unconventional Financial Currents in Software
16+
## Unconventional Financial Currents in Software
1717

1818
The software industry operates on a financial current that defies conventional norms.
1919
Unlike other sectors where key players like oil companies rake in the riches by supplying essentials to other businesses,
@@ -45,7 +45,7 @@ and the introduction of a new API, making it non trivial to migrate from the pre
4545
## SQLPage
4646

4747
As the principal caretaker of the [SQLPage web application server](/), which relies on sqlx,
48-
I faced a pivotal juncture. The path ahead diverged into two distinct trails:
48+
I faced a pivotal juncture. The path ahead diverged into two distinct trails:
4949
1. a challenging migration to sqlx v0.7, making a cross on MSSQL support;
5050
2. persisting with v0.6, a realm housing outdated and potentially vulnerable dependencies.
5151

@@ -94,4 +94,3 @@ The main contributor to sqlx reacted to this post, and they wanted to clarify tw
9494
(unlike SQLPage, which is free to use even in conjunction with proprietary software, under the *MIT* license).
9595
Companies that want to use these future sqlx drivers in proprietary software will have to pay for a commercial license.
9696
That change in the decision has been announced in 2022, and I should have been aware of it when I wrote this post. My bad.
97-
');

examples/official-site/sqlpage/migrations/42_blog_video.sql renamed to examples/official-site/content/blog/introduction-video.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
---
2+
title: Introduction video
3+
date: '2024-05-14'
4+
icon: brand-youtube
5+
summary: A 30-minute live presentation of SQLPage, its raison d'être, and how to use it.
6+
---
17

2-
INSERT INTO blog_posts (title, description, icon, created_at, content)
3-
VALUES
4-
(
5-
'Introduction video',
6-
'A 30-minute live presentation of SQLPage, its raison d''être, and how to use it.',
7-
'brand-youtube',
8-
'2024-05-14',
9-
'
108
# Introduction video
119

1210
## Canadians love SQLPage
@@ -16,15 +14,14 @@ by Anton Avramov, an avid SQLPage user and community member, who gave a live dem
1614

1715
## The video
1816

19-
The user group kindly invited me (Ophir, the initial creator and main contributor to SQLPage)
17+
The user group kindly invited me (Ophir, the initial creator and main contributor to SQLPage)
2018
to record a video introduction to SQLPage, which I did.
2119

2220
The video is a 5 minute introduction to the philosophy behind SQLPage,
2321
followed by a 25 minute live demonstration of how to create
2422
[this todo list application](https://github.com/sqlpage/SQLPage/tree/main/examples/todo%20application)
2523
from scratch.
2624

27-
Watch it on youtube:
25+
Watch it on youtube:
2826

2927
[![video cover](https://i.ytimg.com/vi/9NJgH_-zXjY/maxresdefault.jpg)](https://www.youtube.com/watch?v=9NJgH_-zXjY)
30-
');

examples/official-site/sqlpage/migrations/33_blog_v018.sql renamed to examples/official-site/content/blog/new-sqlpage-and-a-talk-at-pgconf-eu.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1+
---
2+
title: New SQLPage, and a talk at PGConf.eu
3+
date: '2024-01-29'
4+
icon: brand-youtube
5+
summary: SQLPage v0.18.0 is out, and there is detailed introduction to SQLPage on youtube
6+
---
17

2-
INSERT INTO blog_posts (title, description, icon, created_at, content)
3-
VALUES
4-
(
5-
'New SQLPage, and a talk at PGConf.eu',
6-
'SQLPage v0.18.0 is out, and there is detailed introduction to SQLPage on youtube',
7-
'brand-youtube',
8-
'2024-01-29',
9-
'
10-
[SQLPage](https://sql-page.com) is a small web server that renders your SQL queries as beautiful interactive websites. This release has seen significant new features and fixes from new contributors, which is great and show the health of the project ! If you feel something is missing or isn''t working quite right, all your contributions are always welcome.
8+
[SQLPage](https://sql-page.com) is a small web server that renders your SQL queries as beautiful interactive websites. This release has seen significant new features and fixes from new contributors, which is great and show the health of the project ! If you feel something is missing or isn't working quite right, all your contributions are always welcome.
119

1210
On a side note, I [gave a talk about SQLPage last December at PGConf.eu](https://www.youtube.com/watch?v=mXdgmSdaXkg).
1311
It is a great detailed introduction to SQLPage, and I recommend it if you want to learn more about the project.
1412

15-
1. **New `tracking` component for beautiful and compact status reports:** This feature adds a new way to display status reports, making them more visually appealing and concise.
13+
1. **New `tracking` component for beautiful and compact status reports:** This feature adds a new way to display status reports, making them more visually appealing and concise.
1614
1. ![screenshot](https://github.com/sqlpage/SQLPage/assets/552629/3e792953-3870-469d-a01d-898316b2ab32)
1715

1816

1917
3. **New `divider` component to add a horizontal line between other components:** This simple yet useful addition allows for better separation of elements on your pages.
2018
1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/09a2cc77-3b37-401f-ab3e-441637a2c022)
2119

22-
5. **New `breadcrumb` component to display a breadcrumb navigation bar:** This component helps users navigate through your website''s hierarchical structure, providing a clear path back to the homepage.
20+
5. **New `breadcrumb` component to display a breadcrumb navigation bar:** This component helps users navigate through your website's hierarchical structure, providing a clear path back to the homepage.
2321
1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/cbf2174a-1d75-499e-9d6b-e111136dbbbc)
2422

2523
8. **Multi-column layouts with `embed` attribute in `card` component:** This feature enables you to create more complex and dynamic layouts within cards.
2624
1. ![image](https://github.com/sqlpage/SQLPage/assets/552629/3f4435f0-d89b-424e-8b8a-39385a61d5ad)
2725

2826

29-
6. **Customizable y-axis step size in `chart` component with `ystep` attribute:** This feature gives you more control over the chart''s appearance, especially for situations with multiple series.
30-
27+
6. **Customizable y-axis step size in `chart` component with `ystep` attribute:** This feature gives you more control over the chart's appearance, especially for situations with multiple series.
28+
3129
7. **Updated default graph colors for better distinction:** This enhancement ensures clarity and easy identification of different data series.
3230

3331
10. **ID and class attributes for all components for easier styling and referencing:** This improvement simplifies custom CSS customization and inter-page element linking.
@@ -39,6 +37,3 @@ It is a great detailed introduction to SQLPage, and I recommend it if you want t
3937
13. **Unicode support for built-in SQLite database:** This enables case-insensitive string comparisons and lower/upper case transformations.
4038

4139
5. **Improved `card` component with smaller margin below footer text:** This fix ensures consistent and visually balanced card layouts.
42-
43-
'
44-
);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Repeating yourself thrice won't make you a 3X developer
3+
date: '2023-08-01'
4+
icon: box-multiple-3
5+
summary: A dive into the traditional 3-tier architecture and the DRY principle, and how tools like SQLPage
6+
helps you avoid repeating yourself.
7+
external_url: https://yrashk.medium.com/repeating-yourself-thrice-doesnt-turn-you-into-a-3x-developer-a778495229c0
8+
---

0 commit comments

Comments
 (0)