1 / 37

Somethings U should Know

Somethings U should Know. What the … ?. Replication / clustering ORM i18n. What is replication?. Allows 2 or more databases to maintain state between them One server acts as a master for one or more slaves

braden
Download Presentation

Somethings U should Know

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Somethings U should Know

  2. What the … ? • Replication / clustering • ORM • i18n

  3. What is replication? • Allows 2 or more databases to maintain state between them • One server acts as a master for one or more slaves • Slaves pull data to be replicated from server’s binary logs and execute the relevant statements locally

  4. Master Slave Slave Slave Slaves Replication basics… • One master supports multiple slaves • Each node on the network is assigned a unique identifying number • Each slave attempts to connect to the master and fetches data to be replicated

  5. Master Slave Client Replication basics… DATA DATA INSERT INTO … • Clients perform data modification on master server • INSERT, SELECT, DELETE, LOAD DATA

  6. Master Slave Client Replication basics… DATA DATA Binary Log INSERT INTO … • Immediately following execution of command on master, the command is written to the local binary log • Additionally, the master records its unique ID (to prevent endless loops in circular replication scenarios) and the timestamp for use with statements which use NOW(), etc.

  7. Master Slave Client Replication basics… DATA DATA INSERT INTO … Replication Thread INSERT INTO … Relay Log • If the slave is online, the command is transmitted to the slave in parallel (well, immediately following) to being written in the local binary log • Otherwise, when the slave next connects it will receive a list of all pending statements from the master server’s binary log • The slave’s replication IO thread stores the command in the local relay log

  8. Master Slave Client Replication basics… DATA DATA DATA INSERT INTO … Replication Thread INSERT INTO … Relay Log • Once the data is received in the slave’s relay log, the slave SQL thread executes the command locally, bringing the slave up-to-date with the master • In MySQL 3.23, the IO and SQL threads were just one thread. In later versions this was changed to boost performance

  9. Replication Strategies • Load balancing – single write, distributed read

  10. Client INSERT INTO… Client INSERT INTO … Replication Strategies • Load balancing – single write, distributed read • Load balancing – circular read/write

  11. Client Master Slave Replication Strategies • Load balancing – single write, distributed read • Load balancing – circular read/write • High availability (hot failover) DATA DATA DATA DATA DATA

  12. Clustering != Replication • Replication is not real time • Replication by itself is not fault tolerant • No two-phase commits

  13. Replication == Clustering • Allows you to spread your reads out over multiple hosts thus reducing your single points of failure. • Create databases for specific tasks

  14. Object Relational Mapping • Overview • What is Object Relational Mapping? • Desired Features • ORM Approaches & Examples • Code Generation • Attributes • XML • Object Databases • Q&A

  15. What is ORM? • ORM addresses the “impediment mismatch” • Databases – focus on rows, indexes and key-based relationships • Objects – focus on object graphs, inheritance / polymorphism and property / object-based relationships • Databases and Objects do not cleanly align

  16. What is ORM?

  17. What is ORM? • ORM closes this gap • Provides a means to automatically map objects to databases and vice versa • Simple ORM focuses on single table to single class mapping • Advanced ORM focuses on logical objects that span multiple tables, with support for object caching, child property persistence, etc.

  18. ORM Desired Features • Support for: • All types of relationships (1-1, 1-n, n-n) • Transactions • Map single object to multiple tables and vice versa • Object inheritance • Object caching

  19. ORM Desired Features • Support for: • Optimized queries • Smart updates • Bulk inserts / updates • Performance savvy queries / loading of object graphs • Lazy Loading • Support for multiple RDBMSs • Load-time validation • GUI for management

  20. ORM Desired Features • Support for: • Filtering queries in memory (avoid DB round-trips) • Object Query Language • Support for Composite keys • Support for various key types (autoincrement, GUID, HiLo, etc.)

  21. ORM Approaches – Code Gen • Code Generation focuses on generating all mappings and code at design-time • Pros • Avoids black box • Often provides ability to modify / extend generations • Everything is packaged together • Normally provides GUI • Quickly up and running

  22. ORM Approaches – Code Gen • Cons • Less flexible – changes require regeneration • Difficult to provide more complex ORM features • Tied to specific patterns / constructs • Can bloat projects

  23. ORM Approaches – Code Gen • Examples • LLBLGen Pro • Wilson ORMapper • CodeSmith • MyGeneration • Codus

  24. ORM Approaches – Attributes • Attributes allow you to map objects to databases within your code • Pros • Everything is packaged together • Relationships are readily apparent to coder • Compile-time validation (limited)

  25. ORM Approaches – Attributes • Cons • Tightly coupled framework • Unable to modify mappings without modifying code and recompiling • Bloats code

  26. ORM Approaches – Attributes • Examples • Gentle.NET (Demo) • DLinq (Demo) • ActiveRecord • Data Mapper

  27. ORM Approaches – XML • XML mappings allow you to define object to database mappings via an external XML file • Pros • Allows for run-time modification • Normally supports the most advanced ORM capabilities • Can be coupled w/ code generation to speed development • Easier to extend / provide frameworks on top of • Loosely coupled

  28. ORM Approaches – XML • Cons • Requires packaging of external files • No compile-time validation • More error-prone • Syntax to learn if no GUI provided

  29. ORM Approaches – XML • Examples • OfBiz • NHibernate • Elementary

  30. ORM Approaches – OODBMS • OODBMSs allow you to circumvent the object-relational mismatch • Pros • Easier to get up to speed and running • Stronger performance in most cases • Run-time embedding

  31. ORM Approaches – OODBMS • Cons • Not as mature as RDBMS market (blackouts, indexing, etc.) • GUIs are very limited at this point • Only good for short-term applications

  32. ORM Approaches – OODBMS • Examples • db4o • Matisse • Bamboo Prevalance

  33. Internationalization in Portals and Web sites powered by Web Services Source: http://www.pricenoia.com Powered by Amazon ECS (E-commerce Web Services Suite)

  34. Handling International Preferences of Service Consumers Airline Information Web Service

  35. Today the enterprises are gearing to embrace service orientation at multiple tiers to address many of the challenges of adaptation, flexibility, and efficiency Multichannel Presentation Layer Business Processes Service Service Service Service Service Service Shared Business Services Integration Tier Enterprise Application Tier Resource Tier

  36. SOA intermediaries need to negotiate locales between providers and consumers Source: Web Services Usage Internationalization Scenarios, W3C Note

  37. Tugas ! • Buat kelompok (1 kelompok sekitar 6 orang) • Masing – masing kelompok akan mendapat tugas mengerjakan topik : • Replikasi (2 kelompok) • ORM (2 kelompok) • Penerapan internationalization (1 kelompok) • Membuat presentasi (ulasan lebih fokus ke teknologi yang spesifik) dan rekaman (mpeg,avi,dll) dari hal yang dikerjakan • Untuk replikasi dapat memanfaatkan virtual machine (vmware, virtualbox, qemu , dll) • Dipersiapkan semaksimal mungkin untuk presentasi minggu depan (dipilih secara acak)

More Related