Skip to content

Instantly share code, notes, and snippets.

@guardrex
Created May 11, 2016 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save guardrex/5afab2c09eebdfc12538539fea59da4f to your computer and use it in GitHub Desktop.
Save guardrex/5afab2c09eebdfc12538539fea59da4f to your computer and use it in GitHub Desktop.
ron_frown
@ben_a_adams I am told you know a thing or two about servicefabric
8:15:47 PM
guardrex
that's what I really want ... a crack at the markup at the very end of the Razor engine processing
8:15:52 PM
ben_a_adams
@guardrex http://stackoverflow.com/questions/14585184/issue-with-closure-variable-capture-in-c-sharp-expression
8:15:59 PM
guardrex
thx
8:16:04 PM
ben_a_adams
@ron_frown I have encountered it ??
8:16:13 PM
guardrex
^ "encountered"
8:16:24 PM
ben_a_adams
he's going to ask a difficult question; so I'm downplaying ??
8:16:55 PM
guardrex
Here to baffle and bewilder in his eclectic extravaganza of efflorescent ectoplasm, that master magician ... @ben_a_adams !!!!
8:16:59 PM
ron_frown
damn it
8:17:00 PM
it actually not too difficult... just more of a question
8:17:24 PM
ArieJones just entered AspNetCore.
8:18:28 PM
ron_frown
were microservices in fabric designed to host say webapi and thats the communication channel between service and other services?
8:18:01 PM
ben_a_adams
@guardrex I think Jon Hanna is an MVP
8:18:15 PM
ron_frown
and I was thinking you just create a bunch of services in the same app
8:18:28 PM
guardrex
@ben_a_adams he is!!! He E-mailed me the good news.
8:18:30 PM
ron_frown
and you could easily get an IBlahService and call methods
8:18:38 PM
seems like if you hosted a web api inside of a service, you'd have to have stuff in place to make sure that ALSO scales
8:19:02 PM
ben_a_adams
@ron_frown they are communication channel neutral
8:19:20 PM
ron_frown
in my head I thought of service fabric as a pool of services, that had all the comm between the services plumbed for you
8:19:36 PM
and you could then say plop a webapi project on top of that service pool
8:19:46 PM
calling different services etc
8:19:51 PM
ben_a_adams
so you create an enumerator for your communication channels as part of your service which then service fabric registers for you
8:20:28 PM
a web endpoint can be one of them
8:20:46 PM
or tcp or soemthing more exotic
8:20:56 PM
Yannick.Motton left AspNetCore.
8:21:40 PM
ben_a_adams
your service controls its channels
8:21:21 PM
and you tell it what they are
8:21:34 PM
ron_frown
and if I wanted to talk from one service to another, I'm either calling webapi or tcp or whatever the other communication channels?
8:22:14 PM
ben_a_adams
then if something asks how to commincate with that service it gives you ip+port and types from your enumerator
8:22:20 PM
ron_frown
I assume you can auto create proxies etc
8:22:21 PM
this just makes me want to create my own microservices framework
8:22:54 PM
ArieJones left AspNetCore.
8:23:42 PM
ben_a_adams
I just do kestrel; but you can choose whatever you like
8:22:59 PM
ron_frown
well microservices is conceptually lke "everything is a service"
8:23:30 PM
but then you embed api frontend onto each of those services
8:23:39 PM
seems...
8:23:41 PM
bad
8:23:43 PM
ben_a_adams
hmm
8:23:57 PM
ron_frown
I was hoping almost like a "distributed ioc container"
8:23:58 PM
ArieJones just entered AspNetCore.
8:24:41 PM
ron_frown
=)
8:23:59 PM
give me a x service
8:24:08 PM
call shit
8:24:09 PM
whatever
8:24:11 PM
ben_a_adams
remoting ??
8:24:11 PM
let me rummage
8:24:28 PM
ron_frown
@ben_a_adams are you running rc2 bits?
8:24:39 PM
frankr just entered AspNetCore.
8:25:30 PM
ben_a_adams
@ron_frown its the true way ??
8:25:05 PM
ron_frown
I noticed tuts I was playing with said the stateful service with api endpoint wasnt around until rc2 of netcore was released
8:25:06 PM
ben_a_adams
well...
8:25:31 PM
ron_frown
the way you interact with a stateful service btw... very fucking strange
8:25:43 PM
ben_a_adams
officially I think
8:25:45 PM
unofficially officially there's this https://github.com/weidazhao/Hosting
8:26:09 PM
ron_frown
based on the quick once over of the description
8:27:12 PM
that sounds like exactly how I pictured it wokring in my head =)
8:27:20 PM
ben_a_adams
Gateway service is probably the one you want to have a peek at
8:27:21 PM
https://github.com/weidazhao/Hosting/blob/dotnetcli/Gateway/Startup.cs
8:27:50 PM
so that "stateless" service is the entrypoint or public port 80
8:28:29 PM
frankr left AspNetCore.
8:29:40 PM
ben_a_adams
then it does the service discovery and routing behind the scenes to the correct partition of the stateful service that has the data
8:29:10 PM
ron_frown
any hope of that stuff running rc1?
8:29:28 PM
until rc2 is official I dont want to fuck around with my workstation config
8:29:48 PM
ben_a_adams
flip branches ??
8:30:09 PM
https://github.com/weidazhao/Hosting/tree/master
8:30:10 PM
oh
8:30:31 PM
ron_frown
bueno
8:30:34 PM
ben_a_adams
that's rc2 pre dotnet cli :-/
8:30:49 PM
ron_frown
well
what you want to upgrade together; detect faults in and rollback together
9:34:23 AM
ArieJones
ok cool....that's exactly what I was looking for.. .watching these videos and it's always the same.."Let's create one solution..with one piece of code in it" ..
9:34:50 AM
ron_frown left AspNetCore.
9:35:18 AM
ron_frown just entered AspNetCore.
9:38:17 AM
ben_a_adams
so in the build demo thing Hanselman did; we have the TradeAndIndustry service where we have to group some things into a slightly bigger service due to the data
9:38:22 AM
so its txn over your inventory + your production queues
9:38:46 AM
ArieJones
Do they have that code up somewhere ... I think I missed that..
9:39:16 AM
ben_a_adams
if something completes and is coming from production you want it going into the inventory as well as removing from the queue in a single unit
9:39:39 AM
and if you are pulling stuff out of your inventory to queue into production again want that as a txn
9:40:12 AM
ArieJones
I'm going to have to actually GO to Build next time.. take a week off...
9:40:30 AM
ben_a_adams
some things cross data partitions; like moving from one persons to anothers; so need to do book keeping
9:41:03 AM
or sending data between two services
9:41:19 AM
little handshake ??
9:41:26 AM
demo was here https://channel9.msdn.com/Events/Build/2016/KEY02#time=57m20s code isn't so easy to read though
9:42:28 AM
Rami just entered AspNetCore.
9:42:32 AM
ArieJones
Yes, that's exactly what I was trying to work out..... is what if I have things that go across boundaries... do I have service talking to other services .. or do I HAVE to manage everything in the app
9:42:29 AM
Rami left AspNetCore.
9:42:59 AM
ben_a_adams
have services talking to other services; but for example put it immediately into a relable queue
9:43:14 AM
rather than processing it immediately
9:43:36 AM
then you know the other service got it
9:43:45 AM
ArieJones
Thanks for the link.. that's what I get for trying to watch something and work at the same time
9:43:50 AM
ben_a_adams
whereas trying to get it into a queue is a smaller operation
9:44:28 AM
ArieJones
Yes, that's exactly what I was thinking about .... thanks for the input...invaluable ..
9:46:10 AM
ben_a_adams
its divided into more applications than he shows; we smushed them into one application for the presentation
9:46:49 AM
is annoying to update and use in VS like that though ??
9:47:21 AM ASP.NET Core 1.0 https://github.com/aspnet/home
ROOM OWNERS
ben_a_adams
in your app .. are you guys breaking out each service fabric piece(Actors and Services) into their own projects.. or are you lumping like items together ?
9:30:23 AM
So since your game is a pretty complex situation do you end up with like a bazillion projects for each Actor and Service you have
9:31:15 AM
Ciel left AspNetCore.
9:32:19 AM
ben_a_adams
don't use actors, don't know too much about them
9:32:23 AM
have each service in own project; and groups of service in different applications
9:33:01 AM
services are really division by data
9:33:21 AM
what do you want to do a txn on
9:33:43 AM
and applications are division by upgrade
9:34:00 AM
douglaswaights just entered AspNetCore.
9:34:23 AM
ben_a_adams
what you want to upgrade together; detect faults in and rollback together
9:34:23 AM
ArieJones
ok cool....that's exactly what I was looking for.. .watching these videos and it's always the same.."Let's create one solution..with one piece of code in it" ..
9:34:50 AM
ron_frown left AspNetCore.
9:35:18 AM
ron_frown just entered AspNetCore.
9:38:17 AM
ben_a_adams
so in the build demo thing Hanselman did; we have the TradeAndIndustry service where we have to group some things into a slightly bigger service due to the data
9:38:22 AM
so its txn over your inventory + your production queues
9:38:46 AM
ArieJones
Do they have that code up somewhere ... I think I missed that..
9:39:16 AM
ben_a_adams
if something completes and is coming from production you want it going into the inventory as well as removing from the queue in a single unit
9:39:39 AM
and if you are pulling stuff out of your inventory to queue into production again want that as a txn
9:40:12 AM
ArieJones
I'm going to have to actually GO to Build next time.. take a week off...
9:40:30 AM
ben_a_adams
some things cross data partitions; like moving from one persons to anothers; so need to do book keeping
9:41:03 AM
or sending data between two services
9:41:19 AM
little handshake ??
9:41:26 AM
demo was here https://channel9.msdn.com/Events/Build/2016/KEY02#time=57m20s code isn't so easy to read though
9:42:28 AM
Rami just entered AspNetCore.
9:42:32 AM
ArieJones
Yes, that's exactly what I was trying to work out..... is what if I have things that go across boundaries... do I have service talking to other services .. or do I HAVE to manage everything in the app
9:42:29 AM
Rami left AspNetCore.
9:42:59 AM
ben_a_adams
have services talking to other services; but for example put it immediately into a relable queue
9:43:14 AM
rather than processing it immediately
9:43:36 AM
then you know the other service got it
9:43:45 AM
ArieJones
Thanks for the link.. that's what I get for trying to watch something and work at the same time
9:43:50 AM
ben_a_adams
whereas trying to get it into a queue is a smaller operation
9:44:28 AM
ArieJones
Yes, that's exactly what I was thinking about .... thanks for the input...invaluable ..
9:46:10 AM
ben_a_adams
its divided into more applications than he shows; we smushed them into one application for the presentation
9:46:49 AM
is annoying to update and use in VS like that though ??
9:47:21 AM
1:01:00 is adding to production queue code
its less than ideal because its doing more than it really needs to
9:55:59 AM
https://github.com/Azure-Samples/service-fabric-dotnet-data-streaming-websockets/tree/master/src/DataStreaming/Common/Shared/Websockets
9:56:35 AM
daviddriscoll left AspNetCore.
9:57:00 AM
ron_frown
System.Net.Websockets it looksl ike
9:57:00 AM
Shyju just entered AspNetCore.
9:57:30 AM
cow just entered AspNetCore.
9:58:33 AM
cow left AspNetCore.
9:59:19 AM
ben_a_adams
I just set up regular aspnet kestrel webserver
10:01:52 AM
add the websockets stuff
10:02:02 AM
your ICommuincation is just a regular http thing
10:02:30 AM
keeps it simple
if (context.WebSockets.IsWebSocketRequest)
{
await context.WebSockets.AcceptWebSocketAsync( .. do your thing .. )
}
thats inside your ICommunicationListener?
10:08:10 AM
ben_a_adams
ICommunicationListener is just give out the url
10:08:40 AM
ron_frown
oh
10:08:58 AM
so then on start of the service fireup kestrel?
10:09:05 AM
ben_a_adams
yeah
10:09:36 AM
then handle all the comms via that
10:09:59 AM
ron_frown
hmmm seems like that would be much simpler in implementation =)
10:09:59 AM
once i get this crapola working, I intend to get a github example up that people can use as a ref
10:12:04 AM
ben_a_adams
so SF is telling you where the endpoints are; keeping everything highly available etc
10:12:34 AM
thomaswr left AspNetCore.
10:12:52 AM
thomaswr just entered AspNetCore.
10:12:56 AM
ben_a_adams
be then all the actual comms is regular aspnetcore
10:13:59 AM
ron_frown
uyeah
10:14:13 AM
Ciantic left AspNetCore.
10:15:23 AM
ron_frown
one day I need to understand better how it all fits together as far as vm provisioning...
@davidfowl You were talking to @Pinpoint earlier on shared framework versus standalone runtime startup speed. If standalone native is still on the roadmap, that should close the gap on startup speed between the two (or erase it), correct?
RandomStranger
Hey @ben_a_adams, can you suggest any resources to getting started with Service Fabric and .NET Core? On the Service Fabric website there's only on resource I found, which refers to a project template that has been removed.
10:34:47 AM
davidfowl
the other reason we want shared by default is for portability
10:34:49 AM
Pinpoint
'cause with shared, people just have to xcopy their project as-is and it just works? Instead of having to add an explicit rid under runtimes I mean.
10:35:55 AM
ben_a_adams
@RandomStranger this is a good sample project https://github.com/weidazhao/Hosting
10:36:00 AM
davidfowl
right
10:36:00 AM
RandomStranger
Thanks, I'll check it out.
10:36:08 AM
Pinpoint
So DNX is back? ??
10:36:17 AM
davidfowl
yeah
10:36:50 AM
a few things executed better
10:36:58 AM
Pinpoint
Wonderful
10:37:09 AM
davidfowl
dotnet foo.dll
10:37:20 AM
Pinpoint
dotnet run won't work with shared?
10:37:42 AM
ben_a_adams
@RandomStranger is for aspnet core rc2 with dotnet cli; currently SF only works with full framework; but dotnet core soon
10:37:47 AM
Pinpoint
(I guess it might be confusing)
10:38:06 AM
davidfowl
it will
10:38:09 AM
ben_a_adams
I bug them about it regularly ??
10:38:18 AM
davidfowl
dotnet run will work with all things
10:38:22 AM
Pinpoint
Oh? Nice.
10:38:31 AM
RandomStranger
@ben_a_adams You mean RC1? Otherwise I'm not sure I understand your statement.
10:38:36 AM
davidfowl
we also have to support libraries that have native dependencies in the output folder
10:38:46 AM
so for portable applications, everything is copied
10:38:58 AM
ben_a_adams
the project I linked to is for RC2 (dotnet cli rather than dnx)
10:39:10 AM
RandomStranger
Oh, that's fine. I'm planning to get more into rc2
10:39:23 AM
Pinpoint
@davidfowl ah great! Does that mean we won't have those horrible runtime.xxx packages in the future? ??
10:39:32 AM
davidfowl
@Pinpoint those are for standalone mode only
10:39:50 AM
so they exist but they are never used in shared mode
10:40:00 AM
Pinpoint
Hum, okay.
10:40:21 AM
RandomStranger
@ben_a_adams Ohh, now I understand your statement. I thought it would work with .NET Core already. Is there any ETA?
10:40:26 AM
ben_a_adams
@RandomStranger yes; but don't think I'm allowed to say anything ??
10:41:30 AM
RandomStranger
Within the next 3 months?
10:41:44 AM
Pinpoint
Quick question: many of the Microsoft.Extensions packages that were previously targeting net451 now target netstandard1.0/1.1 (which can be used by net451 apps). Sadly, this also means net451 apps downloads packages they don't really need (e.g System.Runtime). I guess there's no plan to revert that?
10:41:45 AM
RandomStranger
(Not gonna bind you on anything you say, don't worry. ??)
10:42:06 AM
ben_a_adams
@RandomStranger that would seem a reasonable guess, but I couldn't confirm or deny ??
10:43:25 AM
RandomStranger
Ahh darn ??
10:43:36 AM
We'll be evaluating new tech stack the next 3 weeks, for all upcoming projects (and reworks) for the next 5-10 years. Service Fabric looks very interesting.
10:44:14 AM
ben_a_adams
.net core brings in Nano server, at which point everything will be magic
10:44:24 AM
RandomStranger
But we have a lot of Mac and Linux guys in our company, which we want to involve.
10:44:27 AM
ben_a_adams
works on linux now, was one of the announces
10:44:54 AM
RandomStranger
Only a private preview
10:45:01 AM
ben_a_adams
yeah and java only ??
10:45:11 AM
but dotnet core brings in linux proper
10:45:26 AM
RandomStranger
For local development it would be a requirement that it can run without service fabric anyway. Not sure if that is possible.
10:45:36 AM
ben_a_adams
so you can imagine its a high importance ??
10:45:42 AM
RandomStranger
Yeah
10:45:46 AM
davidfowl
@Pinpoint by design
10:46:44 AM
ben_a_adams
I think the shared runtime deploy is also import for SF on core
10:46:57 AM
else every microservice has their own runtime
10:47:17 AM
davidfowl
@Pinpoint fixable but we'd have to support empty dependency groups in project.json
10:47:21 AM
RandomStranger
David mentioned once there's a kind of replacement for app domains, and .net core makes it easy to self-host everything. I'd imagine for development you'd just start a bunch of different assembly contexts (no idea if that's the name), and just host the different microservices all in one application. Then for further testing and development publish to Service Fabric.
10:47:39 AM
Pinpoint
@davidfowl a bit annoying, but okay ??
10:48:12 AM
davidfowl
its worse if you use it with packages.config
10:48:41 AM
RandomStranger
@ben_a_adams You always have to run service fabric also locally to develop? I didn't work with it yet personally. I just remember the emulator for Azure Web roles (as it was named back then) was incredible slow.
10:51:01 AM
ben_a_adams
@RandomStranger yes; though its not an emulator, it is service fabric
10:51:37 AM
you run a "one box cluster"
10:51:52 AM
where it runs a node 3-5 times
10:52:17 AM
obv uses more ram locally
10:52:39 AM
RandomStranger
But how fast is the deployment? You changed code, you want to restart your app
10:52:40 AM
ben_a_adams
local is fast
10:52:58 AM
remote is slower as you need to copy the data
10:53:14 AM
the actual upgrade is fast
10:53:30 AM
depends how big the app is
10:54:13 AM
RandomStranger
But I'd imagine it just updates single microservices. Not everything all over again.
10:54:43 AM
ben_a_adams
yeah, versioned and differential upgrades
10:55:16 AM
an "application" is the bundle size
10:56:23 AM
which is a group of microservices
10:56:38 AM
and you can have many applications and they will all happily talk to each other
10:56:58 AM
but the application is the "fault-check/rollback" unit
10:57:30 AM
RandomStranger
I'm not sure how I would draw the size between different applications and microservices. But I have no experience with microservices in general, so.. yeah, gotta read up on that
10:57:50 AM
ben_a_adams
its like the unit of services that you'd change together
10:58:34 AM
RandomStranger
With the reliable nodes where the memory is automatically transferred between machines, it's "kinda" like the machine is never stopping - always running, never having to explicitly reload cached data.
10:58:40 AM
ben_a_adams
and then if it went wrong you'd want them to rollback as a unit
10:58:52 AM
@RandomStranger yep completely
10:59:40 AM
RandomStranger
Given the architectureof AoA you showed in the presentation, what would be an "application"?
10:59:50 AM
ben_a_adams
so like login/account stuff would be an app as that's its own thing and is reused across everything
11:01:33 AM
flying in space would be its own app as that's its own thing
11:01:51 AM
its mostly around data
11:02:12 AM
RandomStranger
So the dashed white lines?
11:02:12 AM
ben_a_adams
which microservices do you have to change in lock step
11:02:51 AM
or dependencies
11:03:05 AM
obv they all have dependecies on each other
11:03:19 AM
but some are harder dependencies the line is around detecting dependcy failure knockons
11:04:16 AM
samipoimala
@Pinpoint "DNX is back". WTH?
11:04:54 AM
ben_a_adams
so if upgrade one microservice with bad code is likely to cause another microservice to start failing; then they are probably in the same app; if that makes sense?
11:05:50 AM
so that knock on failure can be detected and force the rollback of the upgrade
11:06:28 AM
davidfowl
@samipoimala not DNX itself
11:06:50 AM
some of what it is
11:06:54 AM
Pinpoint
@samipoimala I was kidding, DNX is definitely dead. But the general "shared runtime" concept DNX was using has been added to CLI ??
11:07:01 AM
RandomStranger
Makes sense. Just difficult to wrap my head around it, given the limited scope of my experience.
11:07:01 AM
ben_a_adams
also you don't want everything in the same application as your project and deployment packages will get really big
11:07:17 AM
so that's the trade off ??
11:07:29 AM
but you have many applications in the same cluster
11:08:21 AM
RandomStranger
I could guess you can add some kind of version check for dependent applications inside the node health check. So if you have two apps, and the second one requires changes in the frst, you'd add a version check.
11:08:36 AM
To make sure the first app was deployed first.
11:08:44 AM
ben_a_adams
yeah; all the health checks are user defined
11:10:25 AM
other than the "is it alive" one ??
11:10:47 AM
it doesn't solve everything; so if you want to do aggregate data queries; then you'd still want a sql piece; or if you are storing big data blobs; then you'd probably want to put them in regular storage
11:14:19 AM
or historic data
11:14:26 AM
RandomStranger
Yeah, of course.
11:14:44 AM
We'll have to deal with a bunch of third-party systems
11:14:52 AM
ben_a_adams
but is really good for operational data
11:15:08 AM
the "now" state
11:15:23 AM
RandomStranger
We're planning to fan out our current application landscape across microservices. Service Fabric looks really suited for that.
11:15:31 AM
ben_a_adams
basically anything where if you where writing an app on a single machine that never failed and could get away with using dictionaries and queues
11:16:45 AM
RandomStranger
e.g. for every third-party system we get an "Adapter"-microservice, which transforms the 3rd party data structure into a uniformed one (or general provides uniformed access to the 3rd party). Then a bunch of microservices in our business layer, which is containing the core business logic. Retrieving routes, booking a flight, etc. Below that a layer where we have an website/application related gateway API, and a website that accesses the gateway. So website -> Gateway -> business service -> adapter
11:17:04 AM
ben_a_adams
and you didn't have to enumerate them too much ??
11:17:04 AM
RandomStranger
(Only the gateway and web would be public accessible)
11:17:45 AM
ben_a_adams
ah; so would all mostly be stateless?
11:18:04 AM
not much saved to disk?
11:18:18 AM
RandomStranger
We plan to make them as stateless as possible. Most data will be stored in the 3rd party systems we access.
11:18:38 AM
ben_a_adams
then its just perfect ??
11:18:55 AM
RandomStranger
But looking at how state is implemented in Service Fabric, it's not so off-the-table anymore. We'll have to see when we get there
11:19:02 AM
I guess for cached data state would be nice, wouldn't it?
11:19:23 AM
ben_a_adams
lot of power in the stateful
11:19:30 AM
RandomStranger
So you don't have slow "get the data and cache it" operatons, because that's part of service fabric. The node is not considered started when the reliable data is not passed on already.
11:20:08 AM
ben_a_adams
well for cached state you can just put it in ram in a stateless service
11:20:13 AM
RandomStranger
Oh wait, that's something you could just do in the run method.
11:20:34 AM
ben_a_adams
statelful means its always in ram even when stuff falls over and it moves
11:21:50 AM
has a little over head
11:22:09 AM
if you are happy to just pick it up again then; can use just regular in ram stuff as you don't need it to be replicated state
11:22:49 AM
as you can just go back to the source
11:22:58 AM
RandomStranger
I'd just not want it to be picked up again as part of a web request.
11:23:14 AM
It would need to be there before the node is accessible and ready.
11:23:23 AM
But I think the run method is good for that, isn't it? You could just run periodically cache operations there
11:23:41 AM
ben_a_adams
DI a global state object
11:23:59 AM
yeah
11:24:05 AM
the stateful is more for where the microservice is the primary source of the data
11:24:41 AM
RandomStranger
yeah
11:25:06 AM
ben_a_adams
and you can loose half the cluster and that data is still there
11:25:47 AM
also means it scales up well
11:26:27 AM
but if you are caching; can put it in a regular dict or concurrent dict
11:27:00 AM
then pull it back if it falls over
11:27:15 AM
RandomStranger
Yep. Didn't think of that correctly before. I'm sure there is a way to run code before any request is issued and before the node is considered healthy and running
11:27:44 AM
ben_a_adams
yep
11:27:58 AM
hmm
11:28:41 AM
also might want to use stateful for queues
11:29:04 AM
so if you are taking requests that complete later
11:29:21 AM
RandomStranger
If you don't need one "global" queue across all nodes
11:29:31 AM
ben_a_adams
to make sure you always have them till they complete
11:29:42 AM
so this type of thing
11:30:05 AM
https://github.com/weidazhao/Hosting/blob/master/Sms/SmsService.cs
11:30:07 AM
RandomStranger
yeah
11:30:52 AM
ben_a_adams
long running tasks; or send email when this completes, but don't want it tied to request
11:30:57 AM
RandomStranger
And as I understand it, service fabric is not only for web services good, but also for "worker" machines, which only constantly work on a queue. I guess this SmsService is something like that.
11:31:28 AM
ben_a_adams
so they don't get lost if the webserver falls over
11:31:31 AM
RandomStranger
Hmmm... Yeah. That would be perfect for sending confirmation mails (in our application scope).
11:31:48 AM
But this requires you to trust that your infrastructure holds, and that never more than half of the nodes fail at once.
11:32:25 AM
ben_a_adams
not really as they are disk backed
11:33:11 AM
RandomStranger
Really? Great
11:33:27 AM
ben_a_adams
is ok if the node fail and come back
11:33:35 AM
more if half of your nodes were wiped out; their disks destroyed never to come back, depending on how much replication you told it to do
11:35:02 AM
but then that's still probably better reliability than most databases ??
11:35:37 AM
RandomStranger
Yeah
11:35:46 AM
And theoretically you could even spread a cluster over different services, right? Host some nodes in the on-premise, some in Azure, some in AWS.
11:36:05 AM
ben_a_adams
yep
11:36:23 AM
RandomStranger
Can you also specify that some hosted nodes are only for backing up the data for the reliability, and not for actual serving requests / handling operations?
11:36:59 AM
ben_a_adams
you have primaries and secondaries
11:37:19 AM
you can specify that you want to read from secondaries also
11:37:50 AM
but normally you just use the primaries
11:38:00 AM
and it handles ensuring the data is on the secondaries
11:38:31 AM
if the primary goes down then one of the secondaries becomes the primary and a new secondary is created
11:39:04 AM
and the data copied to that
11:39:10 AM
RandomStranger
I was thinking about this scenario: a primary (on-premise) fails, and a secondary (azure) is becoming the primary - but only temporarily. As soon as a new node on-premise is started, it will become the primary and the azure one is secondary again. So that the Azure ones are only fallbacks, and stay fallbacks.
11:40:28 AM
(Not really sure if we'd even need that, just playing some scenarios and learning ??)
11:40:50 AM
ben_a_adams
might work; depends on how much you are writing to them
11:43:08 AM
as latency on copying will be higher
11:43:39 AM
but if you are mostly stateless; can put traffic manager in front of the two clusters
11:44:13 AM
have it go to on premise by default
11:44:30 AM
RandomStranger
I'm not sure what we will be. Just that it's planned to stay stateless, to avoid handling state and running into trouble when scaling
11:44:45 AM
Depending on the kind of state you'd need requests to always reach the same node. Not sure if service fabric offers that.
11:45:23 AM
ben_a_adams
it has service look up
11:46:22 AM
so you have some way of converting a key to a numeric (for example)
11:47:02 AM
ignore that, is detatils ??
11:47:39 AM
basically you ask service fabric what the endpoint is for some data is
11:48:07 AM
RandomStranger
Nice
11:48:32 AM
ben_a_adams
as it tells you the url to use, or tcp port etc depending on how you want to talk
11:48:34 AM
we use kestrel in all our services and have them chit-chat with that
11:49:02 AM
since its super fast ??
11:49:32 AM
RandomStranger
Alright, thanks a lot. ?? Was waiting to grab you for questioning since the keynote of build, where I learned that you guys use service fabric
11:50:39 AM
Now we only need it to run on .NET Core and Linux ??
11:52:39 AM
ben_a_adams
soon ??
11:53:09 AM
I've merged too much code with .net core to not use it ??
@Pdavidfowl You were talking to @Pinpoint earlier on shared framework versus standalone runtime startup speed. If standalone native is still on the roadmap, that should close the gap on startup speed between the two (or erase it), correct?
1:06:01 AM
^ oops
1:06:12 AM
@davidfowl You were talking to @Pinpoint earlier on shared framework versus standalone runtime startup speed. If standalone native is still on the roadmap, that should close the gap on startup speed between the two (or erase it), correct?
1:06:50 AM
davidfowl
yeah and increase the size
1:07:23 AM
guardrex
that's fine ... and standalone native would be post-RTM? is that just not known
1:07:53 AM
davidfowl
its known
1:08:31 AM
just not planned
1:08:33 AM
guardrex
ok, thx
1:08:46 AM
davidfowl
hows your startup speed/
1:10:13 AM
ChadT
wait.. which is faster... shared vs standalone?
1:12:29 AM
guardrex
@davidfowl few seconds but I haven't taken careful measurements
1:13:07 AM
davidfowl
yea we do ??
1:13:16 AM
@ChadT shared
1:13:20 AM
guardrex
@ChadT If you scroll back to earlier today they had a good chat on it
1:13:35 AM
very interesting
1:13:42 AM
davidfowl
its the same bits
1:13:58 AM
just the things in package are not natively compiled
1:14:12 AM
the shared framework solves 2 main things
1:14:36 AM
deployment size
1:14:50 AM
startup speed
1:14:56 AM
side effect of 1 is density
1:16:19 AM
you have 10 apps on the same server
1:16:25 AM
you have a single copy of the shared framework
1:16:31 AM
guardrex
@ChadT hence why I was asking about standalone native. I'm a big fan of app isolation + no (shared) frameworks on servers + apps on different runtime versions (when needed); downsides: size on disk + deployment speed
1:16:45 AM
I'll take that tradeoff
1:16:59 AM
davidfowl
shared doesn't mean what you think it means tho
1:17:16 AM
its not .NET Framework shared
1:17:23 AM
it's side by side framework shared
1:17:28 AM
guardrex
that part I don't understand (yet)
1:17:36 AM
davidfowl
the app specfies what version of the shared framework it wants to run on
1:17:56 AM
vladzaharia just entered AspNetCore.
1:19:11 AM
davidfowl
thats why 2 apps can use 2 different shared frameworks side by side
1:18:53 AM
or n apps
1:18:55 AM
n shared frameworks
1:18:58 AM
but you get the best of both worlds
1:19:06 AM
if you can't deploy the shared framework to the server, then you have to go standalone
1:19:33 AM
Pure.Krome left AspNetCore.
1:20:23 AM
guardrex
^ "side by side framework shared" ... bit of an oxymoron when stated so succinctly, but I see what you mean; however, it still calls for a server install of a framework.
1:21:55 AM
...but I guess each app can have its own shared framework each deployment
1:22:31 AM
davidfowl
yeah
1:22:55 AM
thats the idea
1:22:58 AM
guardrex
ah i see ... so the shared framework could be deployed each time with the app at the same time + cross gen fast startup with that natively compiled runtime
1:23:34 AM
davidfowl
that we don't support right now
1:23:53 AM
thats what DNX supported
1:23:56 AM
guardrex
ok
1:24:45 AM
davidfowl
today, you're either standalone and you deploy everything
1:24:10 AM
HaydenMc left AspNetCore.
1:25:02 AM
davidfowl
or shared and you deploy less things
1:24:20 AM
guardrex
The Publishing to IIS doc will likely have two sections at RC2 then: standalone setup and shared framework setup
11:53:58 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment