3 Tier Architecture


Published on

3 Tier Architecture

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

3 Tier Architecture

  1. 1. Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .Ltd
  2. 2. 3-Tier Architecture
  3. 3. 3-Tier Architecture
  4. 4. 1-Tier Architecture
  5. 5. 1-Tier Architecture• In 1-Tier Architecture the file you want to work with must be accessible from a local or shared drive• This is the simplest of all the architectures, but also the least secure• Since users have direct access to the files, they could accidentally modify, delete the file by accident or on purpose• So 1-tier architecture is simple and cheap, but usually unsecured and data can easily be lost if you are not careful
  6. 6. 2-Tier Architecture
  7. 7. 2-Tier Architecture• This architecture is also called Client-Server architecture because of the two components• The client that runs the application and the server that handles the database back-end• The client computer usually can’t see the database directly and can only access the data by starting the client• This means that the data on the server is much more secure• Now users are unable to change or delete data unless they have specific user rights to do so
  8. 8. 2-Tier Architecture• The client-server solution also allows multiple users to access the database at the same time• One other huge benefit is that the server is processing data that allows the client to work on the presentation and business logic only• This mean that the client and the server is sharing the workload and by scaling the server to be more powerful than the client• you are usually able to load many clients to the server allowing more users to work on the system at the same time.
  9. 9. 3-Tier Architecture• This involves one more layer called the business logic tier, service tier or middle tier (layer)• In the client-server solution the client was handling the business logic and that makes the client “thick”• A thick client means that it requires heavy traffic with the server, thus making it difficult to use over slower network connections like Internet and Wireless• This means that only little communication is needed between the client and the middle tier making the client “thin” or “thinner”• An example of a thin client is an Internet browser that allows you to see and provide information fast and almost with no delay
  10. 10. 3-Tier Architecture• As more users access the system a three-tier solution is more scalable than the other solutions because you can add as many middle tiers (running on each own server) as needed to ensure good performance (N-tier or multiple-tier).
  11. 11. 3-Tier Architecture• Security is also the best in the three-tier architecture because the middle layer protects the database tier• There is one major drawback to the N-tier architecture and that is that the additional tiers increase the complexity and cost of the installation
  12. 12. Differences among 1-Tier,2-Tier,3-Tier Architecture 1-Tier 2-Tier Multi-TierBenefits Very simple Good security Exceptional Inexpensive More scalable security Fastest No server Faster execution execution needed “Thin” client Very scalable Issues Poor security More costly Very costly Multi user issues More complex Very complex “Thick” client Users Usually 1 (or a 2-100 50-2000 (+) few)
  13. 13. 3-Tier Architecturefrom transferobj import tobj UIfrom Blogic import Blogicclass gui: def userip(self): print enter the Airline code self.int_Airline_Code=raw_input() print enter the Airline Name self.vchr_Airline_Name=raw_input() print enter the Airline Numeric Code self.int_Airline_Numeric_Code=raw_input() tob=tobj() tob._init_(self.int_Airline_Code,self.vchr_Airline_Name,self.int_Airline_Numeric_Code) b=Blogic() b.getdata(tob)
  14. 14. 3-Tier Architecture UIdef main(): g=gui() g.userip()main()
  15. 15. 3-Tier Architecture Logicfrom transferobj import tobjfrom Database2 import Dataclass Blogic: def getdata(self,tob): self.int_Airline_Code=tob.int_Airline_Code self.vchr_Airline_Name=tob.vchr_Airline_Name self.int_Airline_Numeric_Code=tob.int_Airline_Numeric_Code obj3=Data() obj3.getdetails(tob)
  16. 16. 3-Tier Architecture DataBasefrom transferobj import tobjimport psycopg2import sys#Define our connection stringconn_string = " dbname=firstdb"# print the connection string we will use to connectprint "Connecting to databasen ->%s" % (conn_string)# get a connection, if a connect cannot be made an exception will be raised hereconn = psycopg2.connect(conn_string)# conn.cursor will return a cursor object, you can use this cursor to perform queriescursor = conn.cursor()print "Connected!n"
  17. 17. 3-Tier Architecture DataBaseclass Data: def getdetails(self,tob): self.int_Airline_Code=tob.int_Airline_Code self.vchr_Airline_Name=tob.vchr_Airline_Name self.int_Airline_Numeric_Code=tob.int_Airline_Numeric_Codecursor.execute("insert into tbl_Airlines values(%s,%s,%s)",(self.int_Airline_Code,self.vchr_Airline_Name,self.int_Airline_Numeric_Code))cursor.execute("select * from tbl_Airlines");result=cursor.fetchall()print resultconn.commit()
  18. 18. Reference http://blog.simcrest.com/what-is-3-tier-architecture-and-why-do-you-need-ithttp://www.c-sharpcorner.com/uploadfile/gowth/two-tier-and-three-tier-architecture- with-example/
  19. 19. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance.www.baabtra.com | www.massbaab.com |www.baabte.com
  20. 20. Contact Us