2017/05/09

Connect SQL Server from FireDAC in Ubuntu

FireDAC + Ubuntu + SQL Server the Frame Diagram photo

Now, We could connection database from Ubuntu to SQL Server use Delphi 10.2 FireDAC.

The SQL Server in AWS and Ubuntu version comparison.  For AWS version have support all feature like for Windows version. It's best solution!

If you would understand more about it. You can go to the URL:
Ubuntu(FireDAC)を使ってMS SQL Server(RDS)に接続する。[JAPAN]
Connect to Microsoft SQL Server (FireDAC)

 

仍然建議使用三方元件 -- 2024/02/15 更新

因為官方連結已失效,故參考 EMBT docs 重新整理本篇。

FireDAC 要在類 Unix (Unix-like) 系統上連結 MSSQL,一定要使用 ODBC:

  • UnixODBC (libodbc.dylib)
  • FreeTDS (libtdsodbc.dylib) ODBC driver (MAC)
  • SQL Server 的 Microsoft ODBC Driver 11 (Linux)

原始主文是以 AWS 的 SQL Server 為主軸,然而在 stackoverflow 上則有網友表示 FireDAC 在這方面還很有問題,會建議採用 Devart Driver (SDAC 或 dbExpress Driver
for SQL Server)。

See Also

 

2017/04/24

Is there a "formal" design pattern to DataSnap?

English version:

Is there a "formal" design pattern to DataSnap?
We learn REST DataSnap framework from technical documents in Embarcadero site.

Usually let us feel about:

  1. Very slow!
  2. Unstable!

But, I tried 50000 clients concurrent calling EchoString process into myself DataSnap Service.

......Don't worry.

All process is normal end. It's fine!

My REST DataSnap is strong!


So...Why always have "unstable" infomation appear in many website.
.
.
.
.
.
.
.
.
.
.
.
.
.

Oh! Because "HTTP persistent connection"!

About "HTTP persistent connection", In wiki is:

HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair. The newer HTTP/2 protocol uses the same idea and takes it further to allow multiple concurrent requests/responses to be multiplexed over a single connection.

Multiple connections V.S. Persistent connection


Although "HTTP persistent connection" have advantages about "Reduced latency in subsequent requests (no handshaking)".

But, The advantages is "disadvantages": Connection count is little in REST DataSnap Service!

Because each client is hold in service, this is hard pressure!

If client lose connection from service when network unstable, and then affect memory usage continuously grows, final crash.


More than "HTTP persistent connection" same "More Energy consumption" in mobile device!

The App connection closed when into sleep mode from mobile device.

When re-open, we will get: wrong window.

A error info is like it.

About problem, 
we can used "Heartbeat packet mode" is fine solution.

Heartbeat packet mode:
Send a message from each sec to service, it like heartbeat behavior, so named it.


But it's energy consumption more!


..........

conclusion:


DataSnap framework features is flexibility!

Have a "formal design" in DataSnap framework?

Any can solve problem are all great formal design!

When you think "DataSnap is bad", please think differently, what is Correct Design?

Maybe you will discover the new continent!

中文版本:實作 REST DataSnap,你用對方法了嗎?

看似好棒棒的 DataSnap 框架,這裡頭的眉眉角角還真是不少。


官方所給的 REST DataSnap DMEO,一直被詬病的有兩點:
  1. 太慢
  2. 不穩

2017/04/05

Linux 後端開發初體驗,使用Delphi 10.2 Tokyo

掩飾不住內心的喜悅,今天一裝完 Delphi 10.2 Tokyo,馬上就來試試看 Linux 最可能的應用:Web Application 開發!

在 PAServer 安裝好後,在 Target Platforms 上增加了 【64-bit Linux】編譯選項,環境部署也只不過是數秒的時間。

體驗完 Hello World in Linux Console Mode,接著就是實作一個 Web Broker吧!

但單純只出現一個【Hello WebBroker】實在不能表達我現在的喜悅。

那麼,就搭配 JQuery Mobile 來個前端整合試試看!

成果如下圖:


在 Linux 上實現 Debug WebBroker。成功!

掩飾不住內心的喜悅,在 Linux 上終於有了解決方案,Delphier 總算是一吐局限在 Windows 平台的悶氣了!

2017/03/27

為 Delphi 10.2 練手,IntraWeb 和 EasyUI 的結合實作

我一直以為 IW 只有 Application Mode 和 (Integrated) Page Mode。

在 IW14 版,新增了 Content Handlers 特色後,當時還不是很了解這功能可以帶來什麼好處。

但在看了【IntraWeb 之 EasyUI 篇】後,才恍然大悟,原來前端可以這麼簡單開發:


我再也不用為了改一個字而整個服務停機啦!


接下來,我也依樣畫葫蘆,做了一個簡單的展示:

後端及資料庫: Delphi 10.1 + IntraWeb 14.1.4 + Firebird 2.5
前端: EasyUI (JQuery components) 1.5.1


2017/03/23

DIY 修正 JSON.ToString 的處理

你在 JSON 的轉碼上也遇到問題了嗎?


在 Delphi 初期支援 JSON 版本,JSON相關類別有個【ToString】的函式,對於異質平台間的轉換需求上,替我們省下了不少時間。

But!人生最重要的就是這個 But!

2017/03/21

IntraWeb 未來也要支援 Linux 了!

IntraWeb 隨著 Delphi 支援 Linux 後,更加令人期待它未來的發展!

IntraWeb 在 14 版之後的異變相當大,尤其是 Page Mode 設計上。

在 Delphi 10.2 準備正式發佈時,IntraWeb 官網上也馬上提出新的 Roadmap,除了宣告最低支援開發工具版本之外,還要增加對 Linux 的支援。

Delphier 可以服務的地方就更多了,不再僅是支援 Windows-base。


一起來提升我們的競爭力吧!

see also:

2017/03/18

10.2 出現後,這個訊息註定讓 Delphier 幾家歡樂幾家愁啊

早在 XE4 時期,在線上手冊就出現這麼一段話:
dbExpress, which is described in this tutorial, is being deprecated.

當時 FireDAC 並不完全成熟,還在想何時才能完全取代 dbExpress 還是未知數,更何況 BDE 現在還活得頭好壯壯啊!