E1.01 Apache Php Symfony Doctrine. Subproject requirements (Wpf, Xamarin, Angular SPA, Reactjs SPA) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

Three-tier architecture

The solution you create includes three three tiers:

  • Front-end tier
    • It's a client app (Wpf or Xamarin or Angular SPA or Reactjs SPA)
  • Middle tier
    • It is Web server app which includes security lier, CRUD implementation and so on.
  • Data Storage tier
    • It is SQL server to manage data.

Note

It's bad idea to create large stored procedures on Sql server. In this case, we transfer the functions of the application server (Middle tier) to another server, i.e. Sql server (Data Storage tier). The Data Storage tier is known to be the bottleneck of this architecture.

What is "Apache Php Symfony Doctrine Subproject"?

This is a Middle tier php-implementation that can be deployed to an Apache server.

Primary platforms

Since we chose to use Microsoft development tools, our main platforms were Microsoft's own platforms with deep integration with development tools (including debugging, profiling, new project templates, huge amount of documentation with a very careful explanation of each coding and architectural aspects, free development tools including developer licence for MS SQL server).

  • Middle tier
    • Microsoft IIS is used as a Web server
    • Asp.Net Web Application (Web Api) is used for creating RESTfull Http services.
  • Data Storage tier
    • Microsoft Sql server

Primary platforms hosting

All is fine at development time. But what about Web-hosting. Sorry, "IIS + MsSql"-hosting is three times more expensive than "Php-MySql"-one.

Of course, the choce of big companies will be Microsoft (or Oracle or IBM or ...) platforms. Big companies need some garanties to have stable IT-infrastructure and minimize IT-related risks. As a result, the IT-development for big companies involves many very expensive productivity development tools or even ready to use products like Ms Dynamics or Oracle Siebel.

And what about small and medium businesses with very little or no IT budget. "Php-MySql"-platform is what do they need. IT risks for them will not be associated with large losses.

Let's talk about hosting again. What for hosting is needed?
  • Middle tier requires hosting.
  • Data Storage tier requires hosting.
  • But, it does not matter which hosting is used for Front-end tier (including Angular SPA or Reactjs SPA).
Let's talk about MySql

We mentioned above that Data Storage tier is the bottleneck of any data-driven solution. How to get around this? To answer this question please google "Oracle Physical Standby Database". There exists configuration under which Standby-slave server is avalable for select operation, but not for insert/update/delete. (PostgreSQL servers can be configured in the same way). However, the "Standby" architecture is not a fully functional SQL server farm with an almost linear relationship to the number of servers in the farm.

Now what about MySql? To answer this question please google "MySql NDB". Oracle continues to experiment with building a fully functional SQL server farm. Each data node of "MySql NDB" is avalable for insert/update/delete operation!!! This is very good news. (May be except one thing: insert/update/delete operations require two-phase commit).

Conclusion

Low hosting cost and "MySql NDB" make php-mysql platform very attractive.

Why Symfony

Nothing special. From our point of view to develop php project from scratch is not a very good idea. Instead we would use any available php Framework which is free, good documented, has ORM,"old"-enough to be trusted and which has "How to"-lessons.

We found two such frameworks.

  • Laravel
  • Symfony

We begin with Symfony and nobody knows why. (May be Laravel will be as well but latter).

Php Subproject Requirements

  • Php subproject must be created in such a way that Front-end tier and Data Storage tier require no changes (including security).
    • i.e. client app generated for "IIS+MsSql"-platform (or for "IIS+MySql"-platform) should run against "Apache+php+MsSql" (or against "Apache+php+MySql"-platform) without any modification.
    • i.e. client app generated for "Apache+php+MsSql"-platform (or for "Apache+php+MySql"-platform) should run against "IIS+MsSql" (or against "IIS+MySql"-platform) without any modification.
    • i.e. storages created for Asp.Net Web Application (Web Api) should be ready to be used by Php Middle tier without any modification.
    • i.e. storages created for Php Middle tier should be ready to be used by Asp.Net Web Application (Web Api) without any modification.
    • more over, created storages should be used by both Php Middle tier and Asp.Net Web Application (Web Api) in parallel: one storage and two Web App servers runing in the same time (but on the different platforms (Web Api on IIS) and (Symfony microservices on Appache)).
  • PHP developer must be able to create storages using Symphony ORM tools.

According to formulated Requirements for Php Subproject.

  • security storage should include the following tables
    • basic asp net security
      • aspnetuser
      • aspnetrole
      • aspnetuserclaim
      • aspnetuserlogin
      • aspnetuserroles
    • bitmask add-on
      • aspnetdashboard
      • aspnetmodel
      • aspnetrolemask
  • security should implement
    • JWT-Authentication
  • roles-field of "Symfony Security User" can not be saved into a column of database table since aspnetuser-table has no such a field