1 / 39

Digging deeper into ServiceStack

Digging deeper into ServiceStack. There is more than just easy webservices. Who, where, what?. All the boring stuff you will forget after the slides have passed. Why am I here…. Stefan Daugaard Poulsen @ cyberzeddk AP in Computer Science Developer/Architect at Atea Denmark

Download Presentation

Digging deeper into ServiceStack

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. Digging deeper into ServiceStack There is more than just easy webservices

  2. Who, where, what? All the boring stuff you will forget after the slides have passed

  3. Why am I here… • Stefan DaugaardPoulsen • @cyberzeddk • AP in Computer Science • Developer/Architect at Atea Denmark • Currently working on Atea Tele • .NET developer since 2002 • Silverlight developer back in 2011 with high use of WCF • “Caught” in a discussion about webservices in November 2011 • Got annoyed by RPC style, code-gen webservices

  4. Why is ServiceStackinterresting? Is it needed? Does it solve anything?

  5. What are bad ideas for webservices • Code-gen • It fails…too often • Archaic Xml configuration • Distribution, misspelling…or even horrible merges • Defaults that is bound to make you cry • Why do I need to set values that should be default! • Fixed serialization • Could be nice to talk to more systems no matter who they are • RPC style services • Maintenance hell • Chatty services • Bulk it!

  6. What is this ServiceStack thing • Official subtitle: • Web Services done right, REST services done easy :) • Simple and model-driven • Endpoint ignorant • Authentication built-in • IoCbased • Easy access to HTTP • Fast as lightning • Cross platform • Extendable • Oh!... And clients are in the box

  7. Seen from the serverside This is where the most wheels are turning in your development

  8. Gentlemen, start your engines… • IService • Service • And a lot more…

  9. Quick steps • Conventionbasedregistrations • Throwexceptions and have magichttpstatuscodes • Strongtypedreturns • It’s more than CRUD • PATCH etc. • Restrictaccess to your services

  10. Endpoint ignorant • JSON • Xml • JSV • CSV • SOAP • 1.1 • 1.2 • Custom

  11. Whatwas lost in the ”war” • Funq • OrmLite • ICacheClient • MiniProfiler • Validation • Custom responses • Headers

  12. Funq – it’salmost to easy • It’sdead simple • Fullfills the basicneeds • It’s fast • If youdon’tlike …add an adaptor

  13. OrmLite – whystick to EF or Nhibernate? • Do youreallyneed EF? • Do you trust your developers to know SQL? • Want to getcloser to the server? • Pragmatic over academic

  14. Caching – weneed more problems? • Youadded caching so nowyou have more problems • Cachekey generation • It’s so darnhard!!!

  15. Profiling – it’s so darneasy • Estimates and guessesleavesyounowhere • Easy to give response to the average Joe • Thankyou mr. Saffron and Dixon • Don’treinvent the wheel!!!

  16. Validation – whateveryonehates to repeat • if( request.Id != default(int) ) • It’sgetting boring! • Leverage the same validation in severalplaces • Fine grain it whereneeded

  17. Customizedresponses • If youwantanothercontent type • If youneed to return an image • If youwant to be a joker?

  18. Custom headers – this is a hardone...NOT!!! • CORS • Pleasedon’tuseAddHeader • If youwant to youcan do it • Location • …Link? • Not sure youwant to go thatway ;)

  19. Welcome to the clientside …unless you want to go all JS on me :)

  20. Clients • Client interfaces • IServiceClient • IRestClient • IRestClientAsync • Implementations • Soap11ServiceClient (only for IServiceClient) • Soap12ServiceClient (only for IServiceClient) • JsonServiceClient(Async) • JsvServiceClient(Async) • XmlServiceClient(Async) • Or you can hookup to the XSDs or WSDLs as well • Might be handy when delivering services to external partners

  21. But that’s not all kids… If you order now you will get … for only $19.99

  22. It’s a freaking swiss army knife!!! • OrmLite • MySQL • PostgreSQL • Sqlite 32 & Sqlite 64 • Firebird • Oracle • Authentication • MongoDB • Nhibernate • OpenId • RavenDB • Razor • Caching • Memcached • Azure • Protobuf • MessagePack • Logging • NLog • Log4Net • ELMAH • Eventlog • Swagger

  23. Show off time… Grab your whiskies and smile

  24. I’m in the need for speed! • Fastest JSON serializer • Burning Monk JSON Benchmarks (19/11/2012)

  25. Crossplatform • Supports ASP.NET and HttpListener hosts • Runs on Windows with .NET 3.5 and 4.0 • IIS 5/6/7 (uses IHttpHandler) • VS.NET WebDev Server (Cassini) • IIS Express • Console App, Windows Gui, Windows Service • Linux/OSX with Mono • Apache + mod_mono • Nginx + MonoFastCGI • XSP • Console App • A demo have been done inside iOS with MonoTouch

  26. Hosting – it canbecheap or reallyexpensive! Hetzner Windows Azure 1.67 GHZ 1.75GB RAM 100GB HDD 2TB Traffic €219.50 €2634 • 2.67 GHZ • 2GB RAM • 80GB HDD • 4TB Traffic • €19.90 • €238.80

  27. Where do we go next? Well where I am going I don’t need roads!!!

  28. Where is it hidden? • Source: https://github.com/ServiceStack • Wiki: https://github.com/ServiceStack/ServiceStack/wiki • More docs: http://www.servicestack.net/docs/ • Community resources: https://github.com/ServiceStack/ServiceStack/wiki/Community-Resources • Links to InfoQ articles: http://www.servicestack.net/mythz_blog/?p=860

  29. Who’s behind this thing…and do I dare use it for production • Main contributor: DemisBellot (@demisbellot) • Currently creating awesomeness at StackExchange • It’s been around for a while • First commit Dec 21, 2008 • It is well maintained • Currently at version 3.9.37 • Jun 6 2012 – 3.9.2 • Jan 8 2012 – 3.2.0 • Jun 11 2011 – 2.2.0

  30. That’s all folks • Twitter: @cyberzeddk • LinkedIn: http://www.linkedin.com/in/cyberzed • Blog: http://cyberzed.dk • Email: cyberzed@sleddog.dk • GitHub: http://github.com/cyberzed/ • Tutorials will be published soon at Tech.Pro • Book will be started of as an OS project this year Feel free to contact me with any questions, or if you want me to come talk more about ServiceStack

More Related