March 2014 news about “DelphiMVCFramework”

In the last months DMVCFramework has been used in many projects. Some fixes and some new features has been added.

Tomorrow will start the 4th training from the Jan 1st 2014 on DMVCFramework… WOW!

The best selling training is “Developing Web Client applications using AngularJS and DelphiMVCFramework” (a slightly modified version of this classic training

Tomorrow the training will be in italian, however is very popular also the english version.

However, back to the project, there is a first attempt to add some documentations on the project.

So far there are a lot of samples and all the unit tests, however there was a lack on the “classic” documentations. So, I’m happy to say that in the SVN trunk you can find my presentation held at the last ITDevCon2013 in Verona, IT.

If you are using DMVC framework I’ll be glad to have 2 lines of description about your project (numbers not functionalities insights) to put a success case page on the project website.

Here’s the direct link to the documentations:

This is the main DelphiMVCFramework project website:

Stay tuned

Book Review: “ZeroMQ” (PACKT Publishing)


Some days ago I was contacted by a representative from PACKT Publishing asking me to write a review for their last book about the ZeroMQ library.


In 2009 I was looking for a fast, very fast, messaging system for a complex project and I meet ZeroMQ. At that time there was the 1.x version and I wrote a Delphi wrapper for the C dll that some days later has been included in the official ZeroMQ distribution.

Now, after 4 year since then, I’m using ZeroMQ for a lot of things. I’ve talked about ZeroMQ to the popular ITDevCon (The European Delphi Conference), so I’m very happy to write about ZeroMQ another time.

So, back to the book review…

The book title is simply “ZeroMQ”, but the subtitle explains what you’ll really learn from it: “Use ZeroMQ and learn how to apply different message patterns”.

Yes, this book is really a crash course in ZeroMQ. In about 100 pages, this “small but full of interesting things” book, explains all the most useful message patterns implemented in ZeroMQ. Congrats to Faruk Akgul (the author).

Traditional message queuing systems use a broker. However, ZeroMQ is brokerless. In a brokerless design, applications can directly communicate with each other without any broker in the middle. All the complexity is hidden, and handled, by ZeroMQ. In this situation there isn’t the “single point of failure”. In some cases this architecture cannot be used, but when it can be, you can gain a lot of flexibility, speed with no added complexity.

Let’s give a more  deeper overview for each chapter.

Chapter 1: Getting Started

In this chapter there are some informations about the messaging architectures in general (good for newcomers to the topic) and about ZeroMQ messaging (in particular). Some concepts introduced in this chapter are reused a lot in the rest of the book.

In chapter 1 is introduced the first and the simpler ZeroMQ pattern, the request-replay.

Chapter 2: Introduction to Socket

This chapter starts with a nice introduction to the publish-subscribe pattern and the related filtering (ZeroMQ can filter messages with a very simple “match” pattern). Then, the chapter talks about one of the most interesting patterns when speed is important: the pipeline pattern. While is talking about the pipeline, it explain the ZMQ_PULL and the ZMQ_PUSH socket types. At the end of the chapter, there is an introduction to the Valgrind’s tools suite to detect memory leaks in C/C++ programs. In Delphi can be used FastMM or other similar tools for the same thing.

Chapter 3: Using Socket Topology

In this chapter there is a small introduction to the types of Internet Sockets and TCP. There there is a nice comparison between the “plain” sockets and the ZeroMQ sockets.

At the end, there is an introduction to the CZMQ, a small helper library which lets

C developers to code their ZeroMQ applications easier and shorter. For a Delphi programmer there are a number of ZeroMQ wrapper that makes its use really a snap.

Chapter 4: Advanced Patterns

In this last chapter, are introduced some advanced variation of the previously introduced patterns. Then, there is a nice explanation of some critical situations that could happened in a messaging system. To help the programmer to handle this cases there a number of examples of the ZeroMQ “High Watermark” setting. As very last topic, there is a well known problem, the infamous “slow subscribers in a publish-subscribe pattern”.


The “ZeroMQ” book published by PACKT Publishing is a small but very nice book. Can be very useful to all those people that don’t know about messaging or want add the power of ZeroMQ to their messaging knowledge.

As in every single thing, there are good aspects and bad aspects.

This book is good for an introduction but is not so good for advanced users. There are some other ZeroMQ patterns and features that are not explained at all. However, these patterns are not the most used, or are advanced stuff, so this could not be a big issue.

Considering, the price, the contents and the informative density, is a definitely a good book that can be read, and studied, in few hours and could change your way to do things in everyday programming (messaging are very often not used, or used in a bad way, simply because usually is complex to write and maintain a good messaging system).

One of the more nice features about ZeroMQ is that it can use different transportation protocols. The same library and the same code can be used to do messaging between machines, between processes or between threads in the same process (ipc). As last note, ZeroMQ can handle, without much effort, millions of messages per seconds. If you need speed… consider this.

P.S. I’ll translate and publish on this blog, some of the C examples contained in the book, in Delphi. Stay tuned.

DataSnap XE3 concurrency problems and Update1

If you know DataSnap, probably you know the famous post by Roberto Schneiders about its stability problems (

Now, after some (right) dust cloud, in the Update 1 Embarcadero fixed some bugs.

I still haven’t the time to do an heavy test but the first “fast-and-dirty” test give some results, and I’d like to share my little tests.

I created a simple “DataSnap REST Application” as a VCL Application.

Start a little test with ApacheBenchmark (you can find it in the Apache HTTPD installation directory).

Run the test… and, exception at the 32° connections, just as before the update. However this is not a “bug”, it is simply a problem related to the default wizard configuration.

So I changed the MaxConnection to 1024. This number is very high (for a simple PC) but I’m interested in the concurrency problems, so I’ve to push the concurrency far enough to che the Update 1 Fixes.

Max Connections
Max Connections


Also, I’ve disabled the session with a little change in the “EchoString” method (as suggested by Marco Cantù in his blog post about DataSnap problems).

Closing the session
Closing the session


Now the test results are good. As I said, my objective is not to check the performance or other problems arised from the Roberto tests. My test is just about the concurrency problems (IMHO the biggest one) and the related crash.

Here the Apache Benchmark tests with 100000 requests with 100 concurrent connections.

D:wampbinapacheapache2.2.22bin>ab -v 1 -n 100000 -c100
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,

Benchmarking (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requests

Server Software:
Server Hostname:
Server Port:            8080

Document Path:          /datasnap/rest/TServerMethods1/EchoString/Daniele
Document Length:        22 bytes

Concurrency Level:      100
Time taken for tests:   465.320 seconds
Complete requests:      100000
Failed requests:        0
Write errors:           0
Total transferred:      18966732 bytes
HTML transferred:       2200000 bytes
Requests per second:    214.91 [#/sec] (mean)
Time per request:       465.320 [ms] (mean)
Time per request:       4.653 [ms] (mean, across all concurrent requests)
Transfer rate:          39.81 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1  11.8      0     529
Processing:     2  464 230.4    500    2041
Waiting:        1  457 216.6    499    1922
Total:          2  465 230.8    501    2041

Percentage of the requests served within a certain time (ms)
  50%    501
  66%    565
  75%    609
  80%    637
  90%    699
  95%    769
  98%   1008
  99%   1039
 100%   2041 (longest request)

I certainly will do other tests, however this fast-and-dirty test gave me a good impression.

More to come.

ITDevCon 2012 – RECAP

Last friday is just ended the 4th edition of ITDevCon. This conference is, now, the biggest Delphi conference in Europe, in terms of speakers, speeches and topics… no doubt!

Some numbers:

  • 2 days
  • 31 speeches
  • 15 speakers from all over the world (Italy, USA, Norway, Slovenia, Benelux)
  • 70 attendees c.a. from all over the world (Italy, Germany, Russia etc)
  • 32 prizes offered by our (beloved) sponsors. No one of the attendee went back home without some prize won. In many cases the price of the prize has been even bigger than the price of the ticket!

Some speakers, attendees and other people, have already blogged about the conference and many others have talked about it on twitter and facebook. There’s been a great partecipation… before, during and after the conference.

#itdevcon on twitter:

ASAP will be published other photos on Google Picasa.

This year too, ITDevCon has been a great experience.

I want to say THANK YOU to all the speakers, attendees and sponsors. And also to all the great bit Time crew that makes this conference the biggest Delphi conference in Europe. As you may think, I’m very proud of it.

See you next year for ITDevCon 2013!

RAD Studio XE3 World Tour – Milan, Rome and Dubai

Last week I was busy with the event “RAD Studio XE3 World Tour“, held in 3 different cities: Milan, Rome and Dubai. In Milan we had a lot of attendees, the developers were looking forward to see the last RAD Studio XE3 features.

Fabrizio Bitti, opened the event, introducing bit Time Software as italian representative of Embarcadero Techonologies.

I presented RAD Studio XE3 Product Address, Visual LiveBindings and HTML5 Builder with the mobile deploy facilities for Android, iOS and others mobile platforms.

Marco Cantù presented Firemonkey fm2, Windows 8 and the new Metropolis UI showing a lots of demos.

The next day we held the event in Rome, setting the same timing and contents.

The following day I flew, with Fabrizio Bitti to Dubai, where the launch event went live too.

I came back to Rome last night and I’m preparing the materials for the course that I’ll do Oct 16, 17 2012 in Rome.

The course title is “Update to Delphi XE3 from previous versions” and if you are interested in the training, contact me. You can find the topics (in italian and in a bit longer version) here.

Here you’ll find some photos:

Me and Marco while setting up the official RAD Studio XE3 promo video
Me and Marco while setting up the official RAD Studio XE3 promo video
Me presenting the new Visual LiveBindings. It is a very cool technology.
Me presenting the new Visual LiveBindings. It is a very cool technology.
Me, talking about the upcoming Mobile Studio for iOS and Android
Me, talking about the upcoming Mobile Studio for iOS and Android
Fabrizio in front of bitTime International Office in Dubai UAE
Fabrizio in front of bitTime International Office in Dubai UAE


See you soon at ITDevCon and DROIDDevCon in Verona.