<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pro-Tek Blog &#187; Microservices</title>
	<atom:link href="http://www.pro-tekconsulting.com/blog/category/microservices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pro-tekconsulting.com/blog</link>
	<description>For UI developers / UI designers and UI trends</description>
	<lastBuildDate>Thu, 05 Sep 2019 03:59:47 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.34</generator>
	<item>
		<title>BUILDING MICROSERVICES IN PYTHON</title>
		<link>http://www.pro-tekconsulting.com/blog/building-microservices-in-python/</link>
		<comments>http://www.pro-tekconsulting.com/blog/building-microservices-in-python/#comments</comments>
		<pubDate>Fri, 09 Jun 2017 02:25:16 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Microservices]]></category>
		<category><![CDATA[Building Microservices in Python]]></category>

		<guid isPermaLink="false">http://www.pro-tekconsulting.com/blog/?p=2033</guid>
		<description><![CDATA[<p>What are Microservices? Microservices is also known as the microservice architecture &#8211; is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture allows the continuous delivery/deployment of large and complex applications. It also enables an organization to evolve its technology stack. The microservice [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/building-microservices-in-python/">BUILDING MICROSERVICES IN PYTHON</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h4>What are Microservices?</h4>
<p>Microservices is also known as the microservice architecture &#8211; is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities. The microservice architecture allows the continuous delivery/deployment of large and complex applications. It also enables an organization to evolve its technology stack.</p>
<p>The microservice architecture pattern language is a collection of patterns for applying the microservice architecture. It has two goals, they are:</p>
<p>* The pattern language enables the user to decide whether microservices are a good fit for their application or not.</p>
<p>* The pattern language enables the user to use the microservice architecture successfully.</p>
<p>Explore this article and know how to build microservices in python.</p>
<p>Microservices design helps to ease the problems associated with the monolithic model. Implementing microservices is perhaps one of the greatest ways to improve the productivity of a software engineering team. This is especially true if the following takes place:</p>
<p><img class="aligncenter wp-image-2034" src="http://www.pro-tekconsulting.com/blog/wp-content/uploads/2017/06/Building_Microservices_in_Python-300x203.png" alt="Building_Microservices_in_Python" width="350" height="237" /></p>
<p>* User deploys only the component that was changed. This keeps the deployments and the tests manageable.</p>
<p>* If multiple team members are working on the application, they need to wait until everyone is done with development and testing to move forward. However, with the microservices services model, whenever each piece of functionality is ready, it could be deployed.</p>
<p>* Each microservice runs in its own process space, so if the user wants to scale for any reason, he canscale the particular microservice that needs more resources instead of scaling the entire application.</p>
<p>* When one microservice needs to communicate with another microservice, it uses a lightweight protocol such as HTTP</p>
<p><strong>MICROSERVICES DESIGN</strong></p>
<p><img class="aligncenter wp-image-2037 size-full" src="http://www.pro-tekconsulting.com/blog/wp-content/uploads/2017/06/Microservices_Design.jpg" alt="Microservices_Design" width="1000" height="456" /></p>
<p>Let&#8217;s examine how the configuration would look for a Python and Django application that runs on Nginx on a typical Linux server.</p>
<p>As the application code is spread across multiple repos grouped by a logically independent code, this will be the typical organization of the application directories on the server.</p>
<p>[ec2-user@ip-172-31-34-107 www]$ pwd<br />
/opt/www<br />
[ec2-user@ip-172-31-34-107 www]$ ls -lrt<br />
total 8<br />
drwxr-xr-x. 5 root root 4096 Oct 12 14:09 microservice1<br />
drwxr-xr-x. 7 root root 4096 Oct 12 19:00 microservice2<br />
drwxr-xr-x. 5 root root 4096 Oct 12 14:09 microservice3<br />
drwxr-xr-x. 7 root root 4096 Oct 12 19:00 microservice4</p>
<p><strong>Nginx, which is deployed by a front-end gateway or a reverse proxy, will have the configuration:</strong></p>
<p>[ec2-user@ip-172-31-34-107 serviceA]$ cat /etc/nginx/conf.d/service.conf<br />
upstream django1 {<br />
server unix:///opt/www/service1/uwsgi.sock; # for a file socket<br />
}<br />
upstream django2 {<br />
server unix:///opt/www/service2/uwsgi.sock; # for a file socket<br />
}<br />
upstream django3 {<br />
server unix:///opt/www/service3/uwsgi.sock; # for a file socket<br />
}<br />
upstream django4 {<br />
server unix:///opt/www/service4/uwsgi.sock; # for a file socket<br />
}<br />
server {<br />
# the port your site will be served on<br />
listen 80;<br />
# the domain name it will serve for<br />
server_name localhost;<br />
charset utf-8;<br />
# max upload size<br />
client_max_body_size 75M; # adjust to taste<br />
location /api/service1/ {<br />
uwsgi_pass django1;<br />
include /etc/nginx/uwsgi_params;<br />
}<br />
location /api/service2/ {<br />
uwsgi_pass django2;</p>
<p>include /etc/nginx/uwsgi_params;<br />
}<br />
location /api/service3/ {<br />
uwsgi_pass django3;<br />
include /etc/nginx/uwsgi_params;<br />
}<br />
location /api/service4/ {<br />
uwsgi_pass django4;<br />
include /etc/nginx/uwsgi_params;<br />
}</p>
<p><strong>Multiple uWSGI processes have to be created that would process the request for each microservice:</strong></p>
<p>/usr/bin/uwsgi &#8211;socket=/opt/www/service1/uwsgi.sock &#8211;module=microservice-test.wsgi &#8211;master=true &#8211;chdir=/opt/www/service1<br />
/usr/bin/uwsgi &#8211;socket=/opt/www/service2/uwsgi.sock &#8211;module=microservice-test.wsgi &#8211;master=true &#8211;chdir=/opt/www/service2<br />
/usr/bin/uwsgi &#8211;socket=/opt/www/service3/uwsgi.sock &#8211;module=microservice-test.wsgi &#8211;master=true &#8211;chdir=/opt/www/service3<br />
/usr/bin/uwsgi &#8211;socket=/opt/www/service4/uwsgi.sock &#8211;module=microservice-test.wsgi &#8211;master=true &#8211;chdir=/opt/www/</p>
<p>The post <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog/building-microservices-in-python/">BUILDING MICROSERVICES IN PYTHON</a> appeared first on <a rel="nofollow" href="http://www.pro-tekconsulting.com/blog">Pro-Tek Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pro-tekconsulting.com/blog/building-microservices-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
