<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Krzysztof Kąkol on Medium]]></title>
        <description><![CDATA[Stories by Krzysztof Kąkol on Medium]]></description>
        <link>https://medium.com/@krzysztofkakol?source=rss-33a4796d1f42------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-ZwrtB8VO8PpnQAy</url>
            <title>Stories by Krzysztof Kąkol on Medium</title>
            <link>https://medium.com/@krzysztofkakol?source=rss-33a4796d1f42------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 13:09:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krzysztofkakol/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Solutions Architect. Personal Vision.]]></title>
            <link>https://medium.com/pgs-software/solutions-architect-personal-vision-bed4f67579f8?source=rss-33a4796d1f42------2</link>
            <guid isPermaLink="false">https://medium.com/p/bed4f67579f8</guid>
            <category><![CDATA[soft-skills]]></category>
            <category><![CDATA[architects]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Krzysztof Kąkol]]></dc:creator>
            <pubDate>Thu, 12 Nov 2020 07:21:27 GMT</pubDate>
            <atom:updated>2020-11-12T07:22:14.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAE3QOciFF0EApvcJafkIQ.png" /></figure><p>Who exactly is a solutions architect? Intuitively, everyone has their own definition. In most cases these definitions are incomplete and depend on what a given project requires. When I talk to project managers, technical leaders, software developers, clients, or business analysts, it looks like an architect as a one-man band. Someone whose expertise, experience, flexibility, and responsibility can be used to patch all holes in a project, both those related to processes and those resulting from lack of competence or communication problems.</p><p>Each project is different and in each of them responsibilities of solutions architects may be distributed differently. Sometimes an architect works together with a team, often providing a code. Sometimes it is a high-level work related to architectural concepts and defining a path that a project is to follow in the field of technology. In fact, architects’ involvement is a product of their character, their team’s needs, and project definitions.</p><p>Different visions of a solutions architect are perfectly justified, and it is difficult to bring them to a common denominator. However, architects can help themselves and a project if they are aware of certain aspects of their work.</p><h3>Technological clairvoyant</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HQAI72lGpGycPOrh.png" /></figure><p>Architects usually focus on the project current challenges; they solve unsolvable problems and plan future operations. They should not, however, forget about business technological challenges and they cannot lose sight of what is about to happen. This is of course very difficult, because it is hard to predict how a given technology will develop, how changes to a project itself will evolve, or, most importantly, what technology to use.</p><p>Usually, it is a team that chooses technology. With the help of specialists in MVC application, we will not execute a difficult project in serverless technologies. And even if it is technically possible, we can’t guarantee that we will deliver a working solution. Naturally, it may turn out that a client will impose technology; should this be the case, an architect’s role is to make a client aware of the consequences of such a choice.</p><p>“More difficult” doesn’t mean “better”. Architects must be aware of an environment they work in, clients’ requirements, and above all, of what their top priorities are: is it delivering the MVP, providing fantastic quality, or maybe brilliant architecture? An architect’s job is to decide whether a project should be executed right away or maybe its execution should take a bit more time, with the assumption that the latter will eventually pay off.</p><p>How to do it?</p><ul><li>Understand the business context. Cooperate with a client, business analyst, project manager, product owner, UX etc. In other words, work with anyone who can provide a perspective of a client’s needs. These needs will often affect the choice of technology and even the architecture.</li><li>Help put a team together (if it is possible).</li><li>Meet team members, talk to them about their experience. In case of projects in progress, ask for their opinion on the selected technology. Sometimes it may turn out that a team’s skills do not allow it to work effectively. If so, take some actions. For instance, suggest a change of technology or try to improve your team’s competences in a given area. Both solutions are difficult, but the worst thing is to do nothing.</li><li>Fail fast. If architects can test some ideas themselves to confirm them in practice, that’s fantastic. But it is also a great move to involve team members in such tests. This is how a team’s competence related to a specific technology develops.</li><li>Predict what may go wrong or where you or your team lack knowledge or belief you are going the right way.</li></ul><h3>Soft leader</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3PjHkrs065Zdq38u.png" /></figure><p>Most architects will probably be surprised now… An architect as a leader? A leader? Why? A solutions architect’s job is to design, not to manage people. But you are half-right.</p><p>Of course, it is easy to imagine architects being only an authority on technology. However, such architects will not have it easy. Perhaps they will have to work with other architects, software developers with extensive experience or technical leads with their own vision. Perhaps there will be too many seniors per square meter in a team.</p><p>Architects’ vision will only work if they have natural authority. Of course, they discuss their ideas with their team, but they also want to win others over if their visions are controversial. Sometimes they should be uncompromising and bossy to achieve their goals. They often have to tell their team members that they are wrong and must not be reluctant. To do so, they need highly developed soft skills and conciliation approach. They have to be able to listen carefully to other team members, notice their needs, and fulfil their ambitions. Only then is it possible to make a considerable change (e.g. to decide authoritatively) without damaging consequences.</p><p>Nothing that architects intend to do will work if they do not pay attention to reliable communication, fact-based arguments, explaining their own perspective, or conversation. I have seen a lot of conflicts in teams caused by an architect that was too domineering and did not pay attention to the fact that team members had their own visions and ambitions. This almost always leads to a communication disaster, or, when the worst comes to the worst, to employees, including the best ones, leaving a project or even a company.</p><p>Architects don’t like it, but it is a project “must-have”. Not only should they be technological visionaries, but also soft leaders, communication masters, experts in listening to team members, geniuses in manoeuvring between different, often clashing visions.</p><p>Yes, it is difficult. But nobody said it would be easy.</p><p>How to do it?</p><ul><li>Talk, talk, talk. This may seem like a waste of time, but it is not. Authority cannot be established based on making the right decisions. To prove the rightness of one’s decisions, time is needed, and authority must be established way ahead.</li><li>If something goes wrong, say it. Never pretend that nothing is happening. Remember that when it comes to technology you are the highest authority.</li><li>Recognize the needs and ambitions of team members. Maybe someone can help you with what you feel is your responsibility. For you it is a responsibility, but for someone else it may be an ennoblement.</li><li>If you think something needs to be changed, do it. Of course, you should agree it with others, talk to a client, a team, a project manager. But do not hesitate to take actions as failure to make a change — assuming that a problem has been correctly diagnosed — may have far-reaching consequences.</li><li>Clearly show the purpose. It is a bad sign if a team sees nothing but problems. So take a step back, turn problems into challenges, help your team formulate the MVP (if possible) and find the right path.</li></ul><h3>Thick-skinned visionary</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SfYEyXgKqhmYJouj.png" /></figure><p>A project is an area where various interests meet. Reality can be harsh when a client has a slightly different point of view than a project manager, a technical leader, or a developer. Architects should wise up to it and act like a peacemaker between business and technology. They have to consider different perspectives, make it easier to share them and help find a solution.</p><p>Each of us has participated in many discussions about software quality. We all would like to do it the right way: follow all good practices, run tests, adhere to design patterns, etc. However, it is not always possible, as the client’s strictly business perspective holds us back. “Business perspective” usually means “as soon as possible” or “as inexpensive as possible”. The reasons behind this approach may differ as sometimes it is a desire to enter the market quickly, sometimes it is limited budget. We should understand it. After all, it is the clients’ money, their business, and they know best what their limits are.</p><p>These divergent perspectives usually lead to micro-conflicts that architects should be able to manage. Technical leaders and developers sometimes complain that they do not have time to run tests. Project managers may be worry about the code quality, but they feel pushed by their clients. Clients ask architects for the best solutions and they do not want to hear about obstacles. Architects are often caught between the devil and the deep blue sea and so it is better if they are thick-skinned and pursue their goals regardless of the resistance of matter.</p><p>It takes a bit of visionary. Do you remember how Prince Radziwiłł, a figure from “The Deluge”, a historical novel by Henryk Sienkiewicz, explained his betrayal and the signing of the treaty with the king of Sweden? Well, his plan was simple: Poland will surrender to Sweden, Karl Gustav will place Radziwiłł on the throne of Poland, then then Prince will rebuild the Republic and expel the Swedes. Regardless of whether these were Radziwiłł’s true intentions (truth be told, they were not), it may be a lesson for architects: they sometimes have to sacrifice one thing to gain the other. If the MVP allows the client to earn money, it must be delivered on time and its quality may be improved later.</p><p>All this requires the ability to manoeuvre between a team’s natural tendency to provide a high-quality solution, for which there may not be enough time at a given moment, and the necessity to provide a working solution. All software developers dream of executing their next project exactly as planned but such dreams rarely come true. Architects will sometimes have to face criticism from all sides, but they should have a far-reaching perspective in mind and must not sacrifice it for short-term benefits.</p><p>How to do it?</p><ul><li>If providing some solution in the shortest possible time is the most important thing for your clients, talk openly about the consequences, i.e. about the resulting technical debt that will have to be handled.</li><li>Modify the architecture vision based on the business context. Show the clients what and how they can achieve by using different approaches.</li><li>Make a long-term plan. For example, if you think that the best option is to migrate to the <a href="https://www.pgs-soft.com/cloud/">cloud</a>, but it is currently not feasible due to short-term benefits for your clients, think about it ahead. Prepare at least an outline of the concept on how to do it and present it to your clients. It doesn’t have to be a perfect plan. It doesn’t have to be a strict plan at all. It can be for instance a high-level concept of a final solution. It might be imperfect or incomplete, but at least it will show some direction.</li><li>If your team has to take a short cut, make sure that it doesn’t become the norm. And remember that dealing with a technical debt is usually not a one-time operation, but a slow, tedious process. Make the team aware that the boy scout rule applies to everyone. This is, of course, the primary responsibility of technical leaders, but it doesn’t mean that architects should not support them.</li></ul><h3>Responsible support</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2D60CIiOm66nQ81T.png" /></figure><p>We sometimes say that responsibilities must be precisely divided in a project. For example, a person responsible for a release should be appointed. We agree not only who will lend their name to a release but also who will physically do the job and check the effects. In the end, it is the entire team that bears responsible for the project success.</p><p>But you know what? From the technological point of view, clients and project managers primarily deal with solutions architects. If we realize it, we will quickly notice that despite precisely formulated RACI matrix, the main responsibility for processes in the project and for the project as such rests with architects. They may try to take the burden off their shoulders, but it will only work until the first failure. Then only an architect will be responsible both for this failure and further work. It is always easier to find one scapegoat.</p><p>Therefore, architects should take an attitude of responsible support. They don’t cut themselves off from the problems of team members, they support them not only in task performance, but also in technological development. They notice the team’s weaknesses, identify potential threats, and try to eliminate them. In other words, architects perform risk analysis on an ongoing basis in the context of technology and cooperation between team members. If necessary, they go beyond the scope of their responsibilities. Therefore, they do not ignore potential or existing problems.</p><p>As it was said , whatever the RACI matrix shows, architects are responsible for technological success of the project.</p><p>How to do it?</p><ul><li>I will say it again — talk, talk, talk. Effective team communication will help you a lot.</li><li>Support team members in their own self-development. Naturally, this support may take various forms, but the better your teammates are at doing their job, the easier it will be for you to pursue your vision of architecture (naturally, in line with the client’s needs).</li><li>Don’t be afraid of challenges, not only for you but also for the team. Paradoxically, difficult tasks that make people learn willingly and develop for the sake of the project.</li></ul><h3>Team member</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LDfghZpDA33oiays.png" /></figure><p>It sounds banally, but it is not such. Architects, due to the nature of their work, tend to distance themselves from their team’s everyday work. This is usually because they spend most of their time delivering high-level designs and having discussions with clients. And sometimes they simply have too little time to participate in a given project. Every so often their low participation in performing tasks with the team results from objective factors; if so, it is necessary to compromise.</p><p>If it is possible, work with your team. Integrate, take responsibility for low-level tasks, support your colleagues, share your knowledge. This is how authority is established. You may need it if one day you will have to act with conviction, or tell someone point-blank that they are doing a bad job, or make everyone listen to you carefully when you say that the team’s vision is leading the project astray and it needs to be immediately changed.</p><p>If a project is executed using the technology you are not familiar with, nothing is lost. The “hands-on” approach is not necessary, although your experience will definitely help solve the problem. It is, however, necessary to provide support, help with releases, understand the processes, and explain them. Sometimes an architect’s involvement in a project is part-time job and then working with a team is difficult, if not impossible. Too bad, that’s the way it goes. But this does not mean that in such a situation an architect is doomed to fail. In such a case, responsibilities will be distributed differently.</p><h3>One-man band</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C7xH0Jnd4BO0UTQB.png" /></figure><p>All the-above mentioned aspects of architects’ work make their clients sleep well. Architects give them a sense of security and deal with all problems so that clients do not have to do research at night to make sure whether team-suggested solutions will work. They also do not have to worry that they will have to report to their CFOs, because AWS costs have grown astronomically. They have a sense of control, even if not all solutions have been delivered.</p><p>Architects’ life is not simple, and nobody has ever said it is. An architect is a lot like a one-man band, both in terms of hard and soft skills, which is extremely important. They should have extensive experience and know how to use it wise to successfully complete a project. And last but not least, architects should be aware of their own weaknesses, because humility will help them establish authority, win the team’s trust, and do what they have intended to do.</p><p><em>Originally published at </em><a href="https://www.pgs-soft.com/blog/solutions-architect-personal-vision/"><em>https://www.pgs-soft.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed4f67579f8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pgs-software/solutions-architect-personal-vision-bed4f67579f8">Solutions Architect. Personal Vision.</a> was originally published in <a href="https://medium.com/pgs-software">PGS Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Microservices in PHP: A Multi-Tenant Framework]]></title>
            <link>https://medium.com/pgs-software/aws-microservices-in-php-a-multi-tenant-framework-f1339ce0c1d7?source=rss-33a4796d1f42------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1339ce0c1d7</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Krzysztof Kąkol]]></dc:creator>
            <pubDate>Wed, 17 Apr 2019 10:59:53 GMT</pubDate>
            <atom:updated>2019-04-18T09:58:24.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*52CiFEjuvaI4P2xnuWjB2A.jpeg" /></figure><p>When we talk about PHP, it’s often simplified as a “web app language”. This used to be a hindrance, as it overlooked the wider uses and potential of the language but, as we move into Cloud solutions and microservices, the need for a strong “web language” is actually starting work in PHP’s favour.</p><p>After all, as every PHP developer will tell you, the language <em>is</em> highly suited for web applications and server-side scripting — which sounds an awful lot like the Cloud, right? So, naturally, there’s some strong potential to pair PHP with the likes of Amazon Web Services (AWS).</p><p>I refer to AWS because I specifically had the opportunity to do just that when we were tasked with creating a new product for a client in the HR sector. Due to their specific nature and requirements, it was very quickly decided that microservices and AWS would be the most beneficial. Subsequently, PHP became a natural selection in this case — which is where my adventure began.</p><h3>The Project</h3><p>Once we started our project with a new customer in the HR industry, we wanted to create an architecture that would fit their needs. We defined some of the areas that must be covered, like the extensibility of the application, the possibility to divide work across different teams, the ability to cooperate with external tools, and — of course — maintainability in the context of different customer needs.</p><p>The last point is quite important, as this application is a typical multi-tenant solution (where in different users and groups need to run their own instances, unique and private to them, while still accessing a shared server or database) and all of these tenants/users seem to have slightly different requirements. Furthermore, when considering the architecture in the context of various countries it could be used in, one might conclude that, for instance, it’s crucial to be able to implement different rules for businesses working in multiple countries.</p><p>Straight away, microservices seemed to be a good choice. Currently, there’s a lot of hype around microservice architecture. However, the term itself allows for some amount of, let’s say, “Interpretational freedom”. Here, I want to explore just what microservices means for us, as well as how we implemented them in this particular situation.</p><h3>Why Microservices?</h3><p>Let’s start from the beginning: we know the pros &amp; cons of this approach. We are aware, for example, that microservices allow for strong responsibility decoupling, allowing us to focus on the given part of a software and enabling the development of different parts of the application in different technologies.</p><p>There are a lot more advantages of using microservices, but we also know that “there is no such thing as a free lunch”. Microservices come with strong communication issues — all your components must still cooperate and talk to each other, even if they’re built in isolation. Of course, there are design patterns that facilitate these tasks, but this is still one of the hardest things to do when designing the architecture for microservices.</p><p>When you think of real microservice implementations and, further down the line, the deployment process, you could easily switch to the concept of Cloud services. Of course, this is an obvious solution — with the use of Cloud solutions, you could create an elastic and highly available infrastructure for your microservices. You could also use native Cloud services, such as databases, cache engines or queues. These are in fact the most often used components in basic microservice architectures.</p><p>All of this is easy to create — and remove when it’s no longer needed — and can be readily configured to be highly available to specific needs. It’s also very inexpensive, if you use it with care.</p><h3>Pairing Microservices with the Cloud</h3><p>With this in mind, we decided to utilise both microservices and the Cloud — it’s something that is quite an obvious choice nowadays. But what about the technology? Should we use Docker containers or virtual machines? What infrastructure-as-a-service tool should we use — the one that the Cloud provider offers (like CloudFormation in AWS) or a universal option, such as terraform? Likewise, what’s the better choice for continuous integration — Jenkins or CodeBuild? And — last but not least — what language and framework should we use?</p><p>The answers are not so simple and they most often depend on the skills you have. Yes, let’s forget about our “ideal choices”, “dreams” and so on. If you are an experienced terraform developer, you will likely never use CloudFormation — even if you think or know that the latter is better (or vice versa, no matter). The same is true for languages and frameworks — you will always use the technology that you’re familiar with.</p><p>Of course, it’s also true that some options just aren’t applicable in certain situations. We can assume that you won’t try to use PHP for multi-threaded calculations. Yeah, there are some things that some languages are better in than others — let this inform your decision.</p><p>Yet for any — even a complex — business application, PHP can be a very good choice, especially when used with very mature frameworks, such as Symfony. What is more, I can tell you that we’ve done this. Furthermore, it works perfectly and is easily manageable.</p><h3>System Architecture</h3><p>The question at the beginning was simple: how can we implement the solution, using a modular approach, with (possibly) distributed teams and the architecture in which we could replace one component with another one, just by using the same contract? For example, when the salary management component will have to be replaced by the external salary system, but only for a specific customer?</p><p>The solution is quite obvious: let’s use <a href="https://www.pgs-soft.com/blog/10-reasons-why-you-should-adopt-microservices/">microservices</a> and let’s decouple the responsibilities strongly. What does this mean, in reality? Each microservice is responsible for a part of the business features, with strictly defined borders of the bounded contexts we’ve defined. The application we developed is a Human Resource Management system, so there are some clear business subdomains identified:</p><ul><li><strong>General identity management</strong> — this component should take care of the system authentication and authorisation;</li><li><strong>System management</strong> — a component used for product management and purchases processing — everything that is not customer specific;</li><li><strong>Publication management</strong> — the system also allows for creating and managing internal publications;</li><li><strong>Employment management</strong> — we can specify here the organisation structure, dependencies between employments (who’s in charge of whom) and job type management;</li><li><strong>Notification management</strong> — a component responsible for sending all system emails and dispatching notifications;</li><li><strong>Asset management</strong> — a separate module responsible for managing user assets, primarily images, movies and files.</li></ul><p>There are of course some other business domains that we identified, all of which have their own microservice. What’s important here is that we are not using a full microservice approach because of one client’s requirement: the data provider layer must be replaceable by some other external system. This resulted in a concept of a data provider component — it acts as a clean, context independent proxy for the data infrastructure layer below.</p><p>It also means that not every microservice has its own database. Some of them do, of course, but the others are using the data provider microservice to get the information and values they need.</p><p>The overall view of the architecture looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8oyMeECkDp1zL8YN.png" /></figure><p>Let’s see what some of the components do and how they cooperate with each other.</p><h3>Authentication Layer</h3><p>This is provided by Auth0 — an external authentication provider that is compatible with OpenID. You can configure Auth0 to work with database identification (users are specific for the application only and they can create accounts inside it, just like in a traditional authentication flow), social profiles, Active Directory, SAML-compatible identity providers, and much more. Its main advantage is the ability to be seamlessly implemented using the hosted solution — the login page is on Auth0 servers, so you can just redirect users to it to enable the authentication process, which is browser-based.</p><p>Of course, Auth0 also has an Application Programming Interface (API), which enables a full backend authentication flow. We use this ability to issue our own JSON Web Token after confirming, via the Auth0 API, that the frontend authentication is correct. This allows us to manage tokens, control their lifetime and issue refresh tokens — which also gives us the ability to cut off users at any time — all without interfering with Auth0 services.</p><h3>IAM</h3><p>This is a microservice that plays 2 important roles. First of all, it’s a single place of authorisation for all business components. Secondly. IAM also has a role in system management — it’s a component used in the purchasing process. Of course, this is not completely in-line with the microservices approach — IAM for sure is much wider than just identity access management. It’s a place where all the purchasing activities occur and all customer instances’ configuration data is stored. This might be considered a system management service that’s common for all other business components. At the same time, it’s an authorisation endpoint for other microservices — it stores the permissions for all the system processes, using the role-based access control approach.</p><h3>Modules</h3><p>“Modules” are all the business components that were identified as functional subdomains. For example, this can include components connected with employment management or publication management. Every module is in fact a microservice that has a limited and well defined feature scope. For instance, the publication microservice is responsible for creating or reading publications, editing their content and preparing their structure, but <em>it is not</em> aware of any employment being managed inside other microservices. What does connect them, however, is the fact that both use the data provider microservice to fetch the necessary data.</p><h3>Data Provider</h3><p>Speaking of which, this is actually a wrapper deployed over the data infrastructure layer. It knows which data source needs to be used. Additionally, it uses the multi-tenant approach with separated databases, so every customer (tenant) has its own database and the data provider decides which database to use (or maybe the trial database should be connected). It receives connections and requests from the business modules and returns the necessary data, which can be further processed by the respective business module and returned to the frontend — or any other API client.</p><h3>Notification Manager</h3><p>This component is responsible for sending all system emails, but it also returns notifications to the frontend application. It’s a separate microservice and, thus, the notification logic is separated from the business logic, and it is treated as a supporting subdomain, not the business one.</p><h3>… And the Rest.</h3><p>There are also some other supporting microservices, such as the asset manager which manages all system assets (ie. images, movies and files) or the translation microservice which, as the name implies, manages all translations. The web page itself is also a frontend Angular web application, which calls all the business microservices, as well as authorisation and system management components.</p><h3>Putting It Together</h3><p>All the business components are developed using PHP 7.1 and Symfony 3.4. Depending on the component, various libraries are utilised across these microservices — it is important to consider that every microservice is, in fact, a small, separate Symfony application.</p><p>The communication between microservices is provided using 2 methods:</p><ul><li>Direct requests — used, for example, when a business module is calling the IAM to authorise the user action.</li><li>A decoupled, queue-based approach — this is used when a user is making a purchase, which is then stored in a queue and asynchronously processed by the system, for instance.</li></ul><h3>Multi-Tenant System</h3><p>The system itself is a typical multi-tenant application. It’s designed to be a web service for multiple end-customers. Therefore, its architecture is focused on the ease of change management, which becomes more challenging when factoring in the usage of microservices.</p><p>One of the most difficult parts of multi-tenant system is database management. Here are a couple of approaches that we used:</p><ol><li>First of all, there is a single management database used in the IAM module. This database stores all the information about tenants and their permissions. There are some tables within that store information belonging to the given tenant and, in these cases, we use an additional column to play the role of discriminator — pointing to a given instance (tenant).</li><li>There is a single database that plays the role of a “trial” storage for customers in trial mode. Every table has a discriminator column and stores relevant business data (such as employments or publications).</li><li>In cases where a customer is “promoted” to a paying tenant, a separate database for him or her is created. This database stores specific data that’s only for the given tenant. However, while this particular approach is more secure by design, it also comes with a lot of management hassle, as we have to keep all the tenants’ databases inline, which can involve extra tasks. For example, we may have to run migrations on all of them in cases where the schema has been changed.</li><li>The system is also using a graph database — OrientDB, in our case. We use it to store non-predefined relations between objects, such as who’s in charge of whom or what relations are between employments or employees. This database is a single instance and it stores information regarding all tenants in one graph. This results in problems with data separation — we solved this by only storing relation types and object GUIDs (globally unique identifiers). Consequently, no business data is stored here. As for the relations, these are fetched from graph DB, while the rest of the data is fetched from the Relational Database Management System (RDBMS).</li></ol><p>The above design allows for data separation and — at the same time — minimises management problems. Of course, managing multiple databases might seem challenging at first, but we’re using automatic data source selection in the data provider component, so it’s not a problem at all!</p><h3>A Few Words about Cloud Architecture and the Deployment Process</h3><p>We had a strong battle regarding the repository structure. Do we need a separate repository (multirepo) for each microservice? Perhaps a monorepo strategy is a better option? Both approaches have their pros &amp; cons, and for some types of applications, monorepo is certainly a better choice — mainly for its simplicity of management and ease of deployment.</p><p>Usually, you deploy the whole application, not one module after another, right? Then, in such circumstances, separating the application into multiple repositories makes no sense. This is a strong argument in monorepo’s favour.</p><p>On the other hand, if you have independent, properly separated microservices, developed within strictly defined &amp; bounded contexts, then you might think of a scenario where every microservice can be deployed independently. What’s more, every component could be developed by another, separate team.</p><p>If this is the case, then the multirepo approach is much more appropriate. However, you still have to be careful — what if you deploy new microservice A, but it is using version 2.1 of microservice B, which is currently in version 2.0? You’ll quickly find that microservice A will not work properly — you must be prepared for such scenarios.</p><p>Taking these difficulties into consideration, we decided to use a multirepo approach. It’s difficult to manage but ultimately very flexible. We can delegate the development of a given microservice to another, completely independent team without any problems. Potentially conflicting deployment scenarios are handled through a strict release process and, each time, the order of deployed components must be carefully planned. What is more, our components must always be backward compatible, at least for the previously released version of the application. Thus, we can avoid errors if, for some reason, the order of deployment is not kept accurate.</p><p>Every environment we have on AWS has its own Virtual Private Cloud, complete with separate settings, and the native Cloud services have been separately setup for all environments.</p><p>This deployment process had 2 key stages:</p><ol><li>The infrastructure deployment is achieved using terraform. This gives us the possibility to manage the whole infrastructure in code and simplifies any changes in the services used. For instance, if we want to run a new queue on Amazon Simple Queue Service (SQS), it’s possible to add new resources to the terraform code and apply the change(s) this way.</li><li>Application deployment is performed using Jenkins and CodeDeploy/CodePipeline. The former is used in preparing build artifacts, as well as using parameters within AWS Parameter Store for security reasons. CodeDeploy, on the other hand, is used to deploy the code to AWS instances.</li></ol><p>CodeDeploy, used with CodePipeline, is a flexible and powerful solution that allows for the quick setup of rolling, or blue-green, deployment inside the AWS infrastructure. The CodeDeploy package can consist of both pre-installed or post-install hooks, enabling you to inject some bash scripts to bootstrap anything you need on the server (for instance, if you have to run migrations). Furthermore, CodeDeploy, by default, supports in-place deployment with a one-at-a-time strategy (a kind of rolling deployment), which allows for zero downtime.</p><h3>Summary</h3><p>At this point, you may very well be thinking — “is this really all written in PHP?”. The answer is — yes, it’s PHP. With Symfony, of course. The architecture for our application is very complex, because the HR domain is complex. Using PHP with Symfony is a good answer for this kind of challenge, because:</p><ul><li>It’s concise</li><li>It’s modern</li><li>It’s modular</li><li>It’s supported by many libraries</li><li>It’s easily testable,</li><li>It supports good code quality</li><li>It makes containerisation both easy and possible</li></ul><p>With PHP and Symfony — all of these benefits are available. But, you know what? Microservices afford us one more benefit that, while not used here, is nonetheless important going forward… every component might be built using another language, but this really doesn’t matter. As long as we use compatible contracts, the sky’s the limit!</p><p>The project is still in its early phase — it’s constantly growing, we’re adding new features and that sometimes results in the need to create new microservices. Its decoupled architecture is already paying off — every time a new module is added, we can design it as a separate microservice and this approach is also very convenient in terms of the business: release phases might be much faster, as we can easily develop new MVPs (Minimum Viable Products) without caring too much about the fact that the whole application is quite large and heavy now.</p><p>Symfony seemed to be a very good choice from the very the beginning. Well, it is still the best option if a given microservice is not a small component. However, one can think of a lighter framework, such as Slim, if a small feature microservice has to be created — this reduces the processing time, thus limiting the physical resources needed. Yet I still believe Symfony 4 could also be a perfect choice for that — and such an approach would also simplify the knowledge sharing among the team members.</p><p>Last but not least — this is still a microservices architecture: as stated before, every component might be developed in any technology, so you don’t have to just stick to PHP, of course! However, I hope this project has shown why PHP shouldn’t be so readily overlooked — in the right conditions, it can make your next project much more manageable!</p><h3>Business Perspective</h3><blockquote><strong><em>If you’re looking to create a multitenant application that thrives in the Cloud, PHP and microservices can offer a flexible solution that keeps individual functions separate, but well integrated and connected. The end result is a smooth delivery process that enables continued improvement on a rapid scale.</em></strong></blockquote><p><em>Originally published at </em><a href="https://www.pgs-soft.com/blog/aws-microservices-in-php-a-multi-tenant-framework/"><em>www.pgs-soft.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f1339ce0c1d7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pgs-software/aws-microservices-in-php-a-multi-tenant-framework-f1339ce0c1d7">AWS Microservices in PHP: A Multi-Tenant Framework</a> was originally published in <a href="https://medium.com/pgs-software">PGS Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI & ML in Business: Master Problem Solvers?]]></title>
            <link>https://medium.com/pgs-software/ai-ml-in-business-master-problem-solvers-e1062b323ea8?source=rss-33a4796d1f42------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1062b323ea8</guid>
            <category><![CDATA[business-solutions]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Krzysztof Kąkol]]></dc:creator>
            <pubDate>Wed, 03 Apr 2019 08:27:35 GMT</pubDate>
            <atom:updated>2019-04-03T08:27:35.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UiVVO6hkyich1p-393cM2w.jpeg" /></figure><p>Have a tricky business problem? Chances are Machine Learning and Artificial Intelligence can help you solve it.</p><p>However, it’s not a one-size-fits-all solution — Artificial Intelligence (AI) &amp; Machine Learning (ML) can do a lot, so there are a few things you need to know, not least of all the difference between the two. Secondly, once you know this, you can then look at what you want to optimise or improve in your company to determine the most suitable technology.</p><p>Here, I want to explain the key differences, before discussing some of the surrounding technology and the most applicable AI and Machine Learning use cases for business.</p><h3>Two Peas in a Pod</h3><p>The terms “AI” and “ML” are sometimes confusing and often used in the wrong context. What exactly is the former and how does it differ from the latter?</p><p>Well, in truth, they’re not different. To be more precise, ML can be considered a subset or part of AI. We can easily find various graphs and models presenting AI as the larger technology sphere, with ML being presented as a niche subset contained within — as this image more clearly explains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*MYUlHfxeTcIGBmihjkV2ww.png" /></figure><p>So, let’s start from the outer layer — what is AI? In the simplest terms, it can be understood as anything that can mimic human-like behaviour. This is a general and capacious definition but it nonetheless reflects the reality quite well. There are hundreds of examples of AI in action already — in fact, AI is everywhere and everyone already uses it, sometimes even unwittingly.</p><p>For instance, you use AI when you unlock your phone with facial recognition, when you speak to your voice assistant, or when you navigate your favourite streaming platform. Of course, AI also exists in much more sophisticated solutions, such as self-driving cars or eerily human-like AI-powered news anchors (more on that below). Nowadays, it is more or less everywhere, implemented in many different forms.</p><p>ML, on the other hand, is a field of knowledge which allows for the implementation of certain AI scenarios. For example, ML can be used to develop learning models that will boost your AI usage. It is, in its deepest sense, a set of algorithms or methods of various origins. Of course, this is still a strong simplification idea as, in essence, “Machine Learning” is a concept, not any specific algorithm.</p><p>However, in the previous graphic, you may have noticed another, smaller layer within. This is because there’s another term often mentioned when speaking about ML, namely deep learning, which is sometimes also referred to as deep neural networks. Deep Learning (DL) is one of ML’s methods. It is very sophisticated in its mathematical nature and is used for specific scenarios. However, there are many other simpler ML methods, which are strictly analytical and, even if they generate “smart” results, they are based on mathematical calculations (such as linear regression).</p><p>That said, we must emphasise one rule, which is the most important of all: there is no ML without data. Today’s world and technology provide a lot of data that can be used to train our ML models. More information allows for more accurate results, which is why machine learning is often paired with Big Data processes.</p><p>This fact is exploited by many companies, especially <a href="https://www.pgs-soft.com/cloud/">Cloud</a> providers, which provide us with ready-to-use AI solutions. These services have been taught and trained using ML methods and can now be used by anyone by means of simply using the application programming interface (API).</p><h3>AI and ML in the Cloud</h3><p>The benefits of using the Cloud for AI and ML purposes cannot be overstated.</p><p>First of all, as previously stated, you can use ready-to-use APIs, fed with data already gathered by Cloud providers. Consider, for instance, image recognition — such models are based on the billions of images stored and tagged in the likes of Google’s indexation. You can’t create a better model if you don’t have a sufficient number of assets to feed your learning process — and there’s a very, very high likelihood that you don’t have a larger dataset at your disposal.</p><p>What’s more, you can begin making use of Cloud resources at a low-cost and stop using them right after your algorithms finish their work. Thus, you don’t have to provision huge servers and can avoid overpaying for required resources. With the Cloud, you only pay for what you really need and actually use.</p><p>This also makes it highly scalable, giving you more processing power or server space as you refine and expand your AI &amp; Machine Learning applications — rather than having to prepare ahead with physical hardware of your own (arguably one of the strongest limitations for these business applications in the past).</p><h4>Low-Risk Prototyping</h4><p>If possible, everyone would rather be sure of their solution’s market maturity before its official live launch. Within AI/ML projects, you’ll be able to test, iterate, and fail fast safely and cost-effectively.</p><p>It’s always better to smooth out your solution’s edges in a low-risk, userless environment. This way, you’ll be able to save your consumers unnecessary frustration, providing them with a sophisticated and polished final product instead.</p><h4>Valuable Hiccups</h4><p>The whole point of artificially intelligent solutions lies in allowing them to continuously improve. To do so, they need to have feedback loops, which pinpoint the occurrence of “bad” decisions. This is a necessary step to be able to stop repeating them.</p><p>As the philosopher George Santayana once said, “those who do not learn history are doomed to repeat it” — a sentiment that applies to people, businesses and artificial intelligences alike.</p><p>In the future, such knowledge will aid you in making smarter business decisions. However, it’s important to note that you should experiment with AI in areas that won’t jeopardise your organisation’s good name or high quality user experience.</p><h4>Project Size Matters</h4><p>You’ll only be able to unearth AI’s true potential if you use it to solve the right kind of business problems. With such exciting technology, it’s easy to get caught up in its seemingly boundless world-saving capabilities and risk losing your focus towards solving real issues that, when answered, will noticeably help improve your company.</p><p>However, it’s important to remember that one should first learn to walk before signing up for a marathon. Breaking your AI efforts into smaller (yet nonetheless important) projects helps to focus your teams’ energy, allowing them to deliver cutting-edge solutions more efficiently.</p><h3>ML in its Element</h3><p>Hard logical rules are not the way to solve real world problems yet, unsurprisingly, these are the issues we’d like to alleviate the most. Machine Learning is situational in nature.</p><p>It understands exception and emotion. It learns from examples, meaning that instead of writing thousands of lines of code, a machine can learn from observation, so that it’ll later be able to apply that knowledge on its own. This isn’t magic; it’s ML with a dash of data science.</p><p>Companies today are making use of Machine Learning to collect valuable and, perhaps more importantly, actionable Business Intelligence and predictive analytical insights from large amounts of data — both those collected historically and in real-time. This is because there is tangible value in basing your business strategy on hard facts, as well as on mistakes that your machines have made and, consequently, learnt from.</p><p>ML algorithms create repeatable, reliable, and executable business processes. They identify correlations, make recommendations, and personalise user experiences through understanding context.</p><p>Considering all this, it’s easy to understand why so many businesses today are choosing to employ Machine Learning within their solutions, all in hopes of increasing profits and driving innovation.</p><p>It’s not just about the algorithms, though. Digital Transformation innovators need to envision the bigger picture to ensure that data, logistics, user engagement, etc., are all taken into consideration to help reach optimal effectiveness for the organisation as a whole.</p><p>Below are a few examples of Machine Learning pairings which have been known to generate the most impressive results and technological advancements. If you’re looking for a solution that touches on any of these areas, turn to ML to help you catapult your concept to greater heights.</p><h4>Business Intelligence</h4><p>Machine Learning and smart data analytics, when combined with a cutting-edge Business Intelligence (BI) platform, can lead to a greater operating efficiency and more effective problem identification.</p><p>The combination of Machine Learning and Business Intelligence is especially useful where immediate information can drive valuable decisions and problems need to be identified in real-time. This particularly applies to e-commerce and banking (specifically, fraud detection — but more on that shortly) as, with these, action needs to be taken in a timely, accurate manner. More specifically, a well-informed application, empowered by machine learning, can identify unique trends and react faster than a human can.</p><h4>Image &amp; Text Processing</h4><p>One of our clients, a media company which publishes hundreds of articles on a daily basis, had a low-efficiency editorial workflow. Journalists were spending too much valuable time searching for, sorting through, and categorising article images — instead of being able to focus on writing.</p><p>Fed up with wasting resources, they approached us with an idea that involved prototyping a smart <a href="https://www.pgs-soft.com/experience/how-the-aws-cloud-machine-learning-streamline-editorial-processes/">Cloud-hosted Machine Learning solution</a>, which would automatically process, tag, and sort images.</p><p>The created prototype showed the company that the Machine Learning image recognition and classification approach helped to solve their workflow problem and accelerated the entire process — freeing up resources and saving time.</p><h4>Speech Recognition</h4><p>In November 2018, China’s state agency, (Xinhua), debuted the world’s first AI news anchors. The broadcasters were developed using Machine Learning, thanks to which they are able to simulate the voice, facial expressions, and unique gestures of real-life news presenters, as well as both generate and present new information to viewers.</p><p>Such stunning advancements have recently been made possible as ML technology began to approach sound from a visual perspective. This latest development rendered image recognition a key facet of AI research because, even where the material to be processed is sound-based (or otherwise abstract and non-visual), the most measurable data is still presented graphically.</p><h4>Fraud Detection</h4><p>The nature of fraud detection and prevention provides ideal ML and AI use cases in banking, as well as other applications in the wider financial sector. Most consumers don’t even realise that there are complex, intelligent algorithms behind financial services’ customer care endeavours. Tired of having to validate every transaction with an SMS-generated passcode? Next time you’re asked to do this, just remember that you’re helping your bank’s implemented ML technology to learn and, hence, prevent fraud in the future. So, you can thank those algorithms later.</p><p>Machine Learning in finance services allows data scientists to easily and accurately determine which transactions are most likely to be fraudulent. That’s because it enables patterns to be automatically discovered based on large volumes of data collected from live transactions. Skilfully employed ML solutions can effortlessly differentiate between fraudulent and legitimate activity, while also learning to identify previously unseen fraud tactics.</p><p>What’s more, once such trends have been identified, ML can use this knowledge to stop repeat events in action. Ever had your bank notify you of possible fraudulent activity that they managed to stop before it went through — not after? You also have ML to thank for that.</p><p>However, it’s important to make use of an expertly crafted ML model to ensure that it will be able to correctly perform thousands of computations in milliseconds. ‘Correctly’ being the crucial word here, as algorithms can just as easily learn the wrong things, resulting in complete ineffectiveness. Human oversight should always be regularly deployed to check and steer ML on the right path.</p><h3>Today’s Problems, Tomorrow’s Solutions</h3><p>The prognosis for the next decade clearly points to Big Data becoming an ubiquitous staple in everyone’s lives. Last year’s American Big Data conference, BigData SV 2018, presented research findings indicating that Big Data will generate about $103 billion by 2027. The revenue brought in by this tech sector will grow at a rate of about $10 billion a year. That’s impressive!</p><p>But this also means masterfully crafted AI and ML will continue to grow in significance. In fact, they’ll likely become necessary, as Big Data solutions quite often lead to resolving predictions or classification problems. And, as previously mentioned, ML just isn’t possible without data — therefore, Big Data is a necessary component for AI.</p><p>It seems then that all things data will take reign in the foreseeable tech landscape — making AI and ML the key advisors with a guaranteed a seat at the table.</p><p>In summary, if you’re looking to throw in a bit of innovation into what you’ve been doing or to completely digitally transform your business — look to ML, AI and Big Data to see how you can make the best of what’s to come.</p><h3>Business Perspective</h3><blockquote><strong><em>Artificial Intelligence and Machine Learning can help businesses to make the most of any and all available information, refining solutions and instigating continuous improvement. While it may seem daunting, the agility and scalability of the Cloud, and the support offered by these providers, is making AI &amp; ML increasingly available for businesses of any size.</em></strong></blockquote><h3>Sources</h3><ul><li><a href="https://www.forbes.com/sites/louiscolumbus/2018/05/23/10-charts-that-will-change-your-perspective-of-big-datas-growth/#5fd549082926">10 Charts That Will Change Your Perspective Of Big Data’s Growth</a></li><li><a href="https://www2.deloitte.com/insights/us/en/deloitte-review/issue-20/augmented-intelligence-human-computer-collaboration.html?icid=dcom_promo_featured%7Cglobal;en">Cognitive Collaboration: Why Humans And Computers Think Better Together</a></li><li><a href="https://www.theverge.com/2018/11/8/18074806/ai-news-anchor-china-xinhua-digital-composite">China’s State-Run Press Agency Has Created An ‘AI Anchor’ To Read The News</a></li></ul><p><em>Originally published at </em><a href="https://www.pgs-soft.com/blog/ai-ml-in-business-master-problem-solvers/"><em>www.pgs-soft.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1062b323ea8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pgs-software/ai-ml-in-business-master-problem-solvers-e1062b323ea8">AI &amp; ML in Business: Master Problem Solvers?</a> was originally published in <a href="https://medium.com/pgs-software">PGS Software</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>