Figaro

1,262 views

Published on

An introduction to Figaro, the XML Database for the .NET Framework, and a solution overview of an ASP.NET MembershipProvider built with the XML database.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,262
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Figaro

  1. 1. The XML Database for the .NET Framework
  2. 2. Endpoint Systems • Products – ShoBiz Biztalk Documentation Tool (CodePlex) – ShareScan LOB Connector (eCopy Document Management) – Figaro • Services – Consulting (BizTalk, K2, .NET) – BizTalk/K2 Hosting (on-site, cloud) • BizTalk 2009 – BizTalk/K2 Support
  3. 3. What is Figaro? • XML Database – Application database – Client or server – < 7 MB (~6.34 MB) – Holds up to 256 TB data • Oracle Embedded Product – Oracle Berkeley DB XML – Licensed product
  4. 4. Product Stack
  5. 5. Product Editions • Data Store (DS) – Single reader, single writer – High performance • Concurrent Data Store (CDS) – Multiple readers, single writer • Transactional Data Store (TDS) – Multiple readers and writers – ACID transaction support • High Availability – Replication layer – Coming soon to Figaro (late 2009)
  6. 6. Solution Step-by-Step FIGARO ASP.NET MEMBERSHIP PROVIDER
  7. 7. Designing the Provider • Single-app solution – Data Store access (single reader/writer) – Build up, then out • CDS, TDS • Object serialization • One container per provider – CDS, TDS scenarios can help create SSO/centralized credential store
  8. 8. Membership Provider Key Objects • FigaroMembershipProvider • FigaroMembershipUser – [Serializable] – Intermediary to MembershipUser • FigaroMembershipData – DAL
  9. 9. Figaro Key Objects • FigaroEnv – Environment manager – Not used in this example • XmlManager – Manage containers, object creation • Container – The database – Node storage or ‘wholedoc’ storage – Every entry has a ‘file name’ – either auto-generated or assigned • QueryContext – Assign variable values – Set XML namespaces • Figaro.BerkeleyDb.Xml.XmlDocument – Not to be confused with System.Xml.XmlDocument • (but you can explicitly convert to it) – File name, Metadata
  10. 10. FigaroMembershipUser <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <FigaroMembershipUser xmlns:xsi=quot;http://www.w3.org/2001/XMLSchema-instancequot; xmlns:xsd=quot;http://www.w3.org/2001/XMLSchemaquot; xmlns=quot;http://schemas.bdbxml.net/membership/user/2009/quot;> <Email>bojangles@test.com</Email> <Comment>comment test</Comment> <IsApproved>true</IsApproved> <LastLoginDate>2009-04-30T02:13:02.3791226-04:00</LastLoginDate> <LastActivityDate>2009-04-30T02:13:02.3791226-04:00</LastActivityDate> <CreationDate>2009-04-30T02:13:02.3791226-04:00</CreationDate> <IsLockedOut>false</IsLockedOut> <LastLockoutDate>2009-04-30T02:13:02.3791226-04:00</LastLockoutDate> <LastPasswordChangedDate>2009-04-30T02:13:02.3791226-04:00</LastPasswordChangedDate> <PasswordFormat>Clear</PasswordFormat> <PasswordQuestion>Favorite Food</PasswordQuestion> <ProviderName>FigaroMembershipProvider</ProviderName> <ProviderUserKey xmlns:q1=quot;http://microsoft.com/wsdl/types/quot; xsi:type=quot;q1:guidquot;>794a07ab-fe38- 48aa-869f-994fbab00a38</ProviderUserKey> <UserName>mrbojangles</UserName> </FigaroMembershipUser> Object Serialization
  11. 11. Adding Users public MembershipCreateStatus CreateUser(FigaroMembershipUser user) { var status = MembershipCreateStatus.Success; StartTimer(); try { var ms = new MemoryStream(); serializer.Serialize(ms, user); ms.Seek(0, SeekOrigin.Begin); var reader = XmlReader.Create(ms); var doc = mgr.CreateDocument(reader); doc.Name = user.UserName; container.PutDocument(doc,mgr.CreateUpdateContext(),PutDocumentOptions.None); } catch (Exception ex) { status = MembershipCreateStatus.ProviderError; var e = ExceptionHandler.HandleException(ex, source); if (null != e) throw e; } finally { //you must sync or your data will disappear when you close the container! container.Sync(); StopTimer(quot;CreateUser quot; + user.UserName); } return status; }
  12. 12. Getting User Info • GetUserPassword – for $x in collection('membership') where $x/FigaroMembershipUser/UserName = $user return xs:string($x/FigaroMembershipUser/Password) • GetNumberOfOnlineUsers – for $x in collection('membership') where xs:dateTime($x/FigaroMembershipUser/LastActivityDate) >= $y return $x
  13. 13. How does it perform? • • MembershipData.CreateUser MembershipData.Query testuser995 completed in completed in 0.0079436 0.0581908 seconds. seconds. • MembershipData.CreateUser • MembershipData.GetUser testuser996 completed in 0.0749375 seconds. completed in 0.0030428 • MembershipData.CreateUser seconds. testuser997 completed in • MembershipData.Update 0.0581884 seconds. completed in 0.0500253 • MembershipData.CreateUser seconds. testuser998 completed in 0.0750547 seconds. • MembershipData.UpdateUser • MembershipData.CreateUser completed in 0.0008002 testuser999 completed in seconds. 0.0580407 seconds. • • ChangePasswordQuestionAndAns MembershipData.CreateUser testuser1000 completed in wer completed in 0.1160279 0.0582832 seconds. seconds.
  14. 14. MembershipProvider Design: Going Forward • Concurrency – CDS/TDS – COM+ layer? • Indexing – The more users added, performance will slow – “2 Gb Rule” • Data Partitioning – Keep roles, profile properties separate, or add to membership container?
  15. 15. Planning for Concurrency • Consider the Framework • Consider the OS Features – COM+ – MSDTC • Consider the Figaro API – Concurrent Data Store (CDS) switches – Transactions
  16. 16. Benefits • FLEXIBILITY – Put whatever you want into your containers – Change management just got a whole lot easier • Scalability – Concurrency – Gigabytes, Terabytes – Replication/HA* • Security – File – Application layer – AES Encryption support • Performance – Sub-millisecond operations – ACID transaction support – In-memory databases, log files (TDS) • ROI – Get more out of your XML – Reduced need for resources (no database server!) * Coming late 2009
  17. 17. Where do you want to go today? • Client • Server – Office – ASP.NET • Custom OpenXML Packages – CMS (e.g. Oxite) – Visual Studio – CodePlex Projects • Developer tools – WCF, REST, Services SDKs – WPF? – Cloud/Saas/Software + – Search/Indexing Services – ISV products – Server Products, Platforms • Mobile/Embedded • MOSS, BizTalk • Search Server • Exchange? – ISV Products
  18. 18. What the Future Holds • 64 bits • Configuration Framework – Environment setup/configuration • Replication/High Availability – WCF stack? • Diversified output – Event Window Tracing – Custom Listeners • Further Framework Integration – 3.0, 3.5, 4.0 – IQueryable, LINQ • Performance Counters • Powershell
  19. 19. Licensing Options • Client, Server • DS, CDS, TDS[, HA] • ISV • Enterprise • Partner Programs Available
  20. 20. Come and Get It! • Figaro Product Portal – http://bdbxml.net • Product Documentation – http://help.bdbxml.net • Endpoint Systems – http://endpointsystems.com

×