Space Based Programming

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Space Based Programming - Presentation Transcript

    1. Space based programming [email_address] @gojkoadzic http://gojko.net
    2. Why should you care?
      • It helps us build applications that:
        • can scale out to lots of machines easily
        • can grow and shrink dynamically
        • have massive throughput
        • handle massive amounts of data
    3. So what are spaces?
      • Data spaces are “network attached memory”, allowing us to read, put or take objects
      • Space takes care of redundancy, failover, transactions …
      • Alternatively, send tasks to the object and let it execute it.
    4. The idea has been around for a while, but somehow has not caught on… however it’s coming back with a bang!
    5. Another language named after a Lovelace
    6. David Gelertner invents Linda in the 80’s
      • Distributed processing based on tuples
      • Orthogonal process coordination
      • Data coupling rather than process coupling
    7. Sun Jini in the 90’s
      • Evolvable architectures, autodiscovery and lots of other flux capacitors nobody needed or knew how to use at the time…
    8. Grid computing in 00's
    9. Great for computations, but what about transaction processing?
    10. Space-based systems will be key for cloud scalability
    11. Products
      • http://coherence.oracle.com
      • http://www.gigaspaces.com
      • http://virtuoso.openlinksw.com/
      • http://www.almaden.ibm.com/cs/TSpaces/
      • http://www.jboss.org/infinispan
    12. Command Pattern (GOF)‏
      • “ is a design pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later time”... (wikipedia)‏
    13. You need a recipient, probably an entity by ID
    14. You need a “recipient”, probably an entity by ID A “command” with all the information required to run it
    15. You need a “recipient”, probably an entity by ID A “command” with all the information required to run it And an “invoker” to do the job
    16. And the command gets executed...
    17. So what does it have to do with spaces?
      • “ ...makes it easier to construct general components that need to delegate, sequence or execute method calls” (also wikipedia)
    18. You can use many invokers
    19. And do loads of work in parallel
    20. And you can do something more productive with your time...
    21. So what does that have to do with spaces?
      • Space is where recipients reside and where you send commands
      • Lots of different processors run in the space, but from the outside appear as a single “mind”
      • This scales really well and it is virtually indestructible....
    22. Space: all your objects
    23. Processing units (=partitions)‏
    24. GigaSpace data objects [SpaceClass] public class Message { [SpaceID(AutoGenerate=true)] public String MessageId {get; set;} [SpaceRouting] public String MessageType{ get; set;} ... }
    25. Space Data Properties
      • [SpaceID] is unique for the class in Space
      • [SpaceRouting] determines the partition (defaults to space ID)
      • Indexes speed up queries
      • [SpaceProperty(Index=SpaceIndexType.Basic)]
      • [SpaceVersion] for optimistic locking
      • [SpaceExclude] are not serialized
    26. Recipient (Command context)‏
      • Space object
      • Space ID is the entity ID
      • Routing ID is the same field
    27. Commands
      • Space object
      • Space ID is a GUID (can be auto-generated)‏
      • Target recipient ID is the Routing ID
    28. Processing Units
      • Worker thread pool
      • Template matches the command
        • Class matching
        • Property matching (if not null)‏
      • Works inside a PU container
    29. Example processor [PollingEventDriven(MinConcurrentConsumers = 1, MaxConcurrentConsumers = 4)] internal class MessageProcessor { [EventTemplate] public Message TemplateForThisProcessor { get{ ... } } [DataEventHandler] public Message ProcessMessage(Message message) {.... } }
    30. Processes
      • Contain one or more processing unit containers
      • Own a space partition
      • Run on the network, balanced, clustered, backed up
    31. Coherence - distributed HashMaps
      • Works on POCO objects, but you can implement PortableObject for .NET/Java interop
      • void IPortableObject.ReadExternal(IPofReader reader)
      • {
      • firstName = reader.ReadString(0);
      • addrHome = (Address)reader.ReadObject(1);
      • ....
      • void IPortableObject.WriteExternal(IPofWriter writer)
      • {
      • writer.WriteString(0, firstName);
      • writer.WriteObject(1, addrHome);
    32. Works as a hashmap
      • INamedCache cache = CacheFactory.GetCache(“my map”);
      • cache.Add(key, value)
      • cache.Remove(key, value)
      • Also supports queries, notifications etc
    33. Entry Processors – push code to objects
      • cache.Insert("BGD", new Temperature(25, 'c', 12));
      • IValueUpdater updater = new ReflectionUpdater("setDegree");
      • IEntryProcessor processor = new UpdaterProcessor(updater, 26);
      • object result = cache.Invoke("BGD", processor);
    34. Key ideas to do it efficiently
      • Forget about n-tier systems
      • Group data together with all processes
      • Ensure that invokers have all the information needed to run (so no unnecessary serialization)‏
      • Ensure that the recipients are the correct aggregates for execution (so low contention during execution)‏
      • Use asynchronous persistence
    35. That's it for now...
      • http://gojko.net
      • http://ukdotnet.ning.com
      • October 1st, Mike Hadlow on MassTransit
    SlideShare Zeitgeist 2009

    + gojkoadzicgojkoadzic Nominate

    custom

    1162 views, 1 favs, 8 embeds more stats

    Presentation of space based programming given at Sk more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1162
      • 602 on SlideShare
      • 560 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 27
    Most viewed embeds
    • 453 views on http://gojko.net
    • 62 views on http://vehera.jsn-server7.com
    • 34 views on http://dotnet.sys-con.com
    • 5 views on http://silverlight.sys-con.com
    • 3 views on http://java.sys-con.com

    more

    All embeds
    • 453 views on http://gojko.net
    • 62 views on http://vehera.jsn-server7.com
    • 34 views on http://dotnet.sys-con.com
    • 5 views on http://silverlight.sys-con.com
    • 3 views on http://java.sys-con.com
    • 1 views on http://tweetree.com
    • 1 views on http://web2.sys-con.com
    • 1 views on http://java.ulitzer.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories