#1 2023-07-18 02:11:15

keinn
Member
Registered: 2014-10-20
Posts: 103

need suggestion

i'd like to implement some 3rd party system client ,like redis, rabbitmq based on mormot2 codebase .
some suggestion which tcpclient compent is best to use? like the IndyTcpClient.

should i use TCrtSocket or TASyncClient? is there any block tcp client like indy?

communicate with such system is a must have ability for a modern IT system . especially in a microservice scene ,we have to cowork with others .

Last edited by keinn (2023-07-18 02:12:55)

Offline

#2 2023-07-18 06:33:00

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: need suggestion

For RabbitMQ there is a Habari STOMP Client - in latest releases it based on mORMot: https://forum.lazarus.freepascal.org/in … #msg470786
For Redis I wrote a simple TCrtSocket (mORMot1) based client to use in UnityBase - you can take it here (classes TRedisConnectionsManager & TRedisClient not depends on SpiderMonkey): https://git-pub.intecracy.com/unitybase … gredis.pas

Last edited by mpv (2023-07-18 06:33:30)

Offline

#3 2023-07-18 20:00:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: need suggestion

@Kein
From what I have understood, a MicroService should better not use any external service for storage or communication.
If you use an externall Redis DB for communicating between the services, it is not a MicroService as defined by https://www.martinfowler.com/microservices/
A MicroService should have its own storage/persistence layer.
But some kind of event-driven MicroServices may plug into a MQ for sure, if the MQ is used in a "light" way - as stated by https://www.martinfowler.com/articles/m … vices.html

Offline

#4 2023-07-19 03:24:57

keinn
Member
Registered: 2014-10-20
Posts: 103

Re: need suggestion

@ab
Maybe it should be described as distributed rather than microservices.

I really like mormot, from the perspectives of quality, scale, performance, modernization, and cross platform, mormot is undoubtedly the #1 in pascal world.

This is why I use it heavily, which makes life much much easier.

As a middle-aged man、 an ordinary programmer, a framework user, NOT an architect, boss, or infrastructure researcher,

Most of the time we can only do what is asked and make the best use of what we have.

Lately I've been thinking, what's the meaning of always writing CRUD? What is my goal?

So, I have project that I want to do for myself, i'd like to build it in the most ideal way to make a perfect product.

And once upon a time, in order to learn, I stayed up for several consecutive days to read the source code of mormot or other systems, in order to use them in the best way.

But, I found THAT, once i want to be perfect , my project could Never be completed.

In addition, there are pressures such as cost, marketing, competition, and living bills that we cannot afford to be perfect.

So for a independent developer or a mini-team (Delphi/Pascal current use situation) get something done and stay alive is much much important than tech it self .

So what i do is to choose the best framework such as Mormot, infrastructure components such as Redis\RabbitMQ etc..

Becasue they suit for many cases , can get the job done Reliable and Faster.

i offen promot Mormot to others , there are 2 types responses:
1、don't want to import to0 many dependency, they just uses little piece of mormot like http.sys httpserver or crypto
2、use mormot as infrastructure framework, from RawUTf8 to everything .

second type of users, says they need infrastructure framework abilities like java SpringBoot so they can focus on business logic.

As for Redis, *MQ, they are not just cache or a messagequeue. if it is only cache or queue, i rather use TSynCache ,TSynDictionary, or TSynQueue.
they are ecosystems much more than a simple cache or queue.

Last edited by keinn (2023-07-19 03:57:25)

Offline

#5 2023-07-19 06:49:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: need suggestion

@keinn
It makes a lot of sense.
I agree with all your points.

Offline

#6 2023-07-20 06:28:36

keinn
Member
Registered: 2014-10-20
Posts: 103

Re: need suggestion

mpv wrote:

For RabbitMQ there is a Habari STOMP Client - in latest releases it based on mORMot: https://forum.lazarus.freepascal.org/in … #msg470786
For Redis I wrote a simple TCrtSocket (mORMot1) based client to use in UnityBase - you can take it here (classes TRedisConnectionsManager & TRedisClient not depends on SpiderMonkey): https://git-pub.intecracy.com/unitybase … gredis.pas

thanks a lot for the info

Offline

Board footer

Powered by FluxBB