I have heard of .NET APIs for memcached.
Is there any equivalent for EHCache?
I am envisioning a cluster of linux machines running EHCache, serving cached objects for a farm of ASP.NET webservers. Is this practical? Can this be done without installing Java on the ASP.NET servers?
Well, there is the James Webster's Ehcache.NET - that gives you access to ehcache server through REST API. Guys at Terracotta are promissing that .NET API for their enterprise level caching solution will be avaiable sometime soon...
I'm afraid that in order to use ehcache you will need Java on your boxes, after all it is written in Java, runs on top of JVM etc..
This article discusses the memcached architecture in more detail: How memcached works.
Can this be done without installing
Java on the ASP.NET servers?
Nop
Related
I have a project which is an ASP.NET CORE REST API and the UI is hosted using Http.sys
IIS doesn't come anywhere in picture here. There are multiple backend services created as windows service which include many API calls.
I am looking for a memory profiler tool to monitor the performance. Any suggestions will be helpful. I have tried using .NET memory profiler but due to absence of IIS, things are difficult to manage in it.
Can anyone please suggest me a better tool?
Have you tried MiniProfiler
https://miniprofiler.com/dotnet/AspDotNetCore
MiniProfiler https://www.youtube.com/watch?v=7ThPz-9XM54
NewRelic also has a profiler (if you are using for development purpose only)
https://newrelic.com/lp/dotnet-monitoring?utm_campaign=Supported-Languages-IND&utm_medium=cpc&utm_source=google&utm_content=SLNT_LP&fiscal_year=FY21&quarter=Q4>m=DEV&program=OBSV&ad_type=TXT&geo=APJ&utm_term=%2B.net%20%2Bprofiler&utm_device=c&_bt=501298407481&_bm=b&_bn=g&gclid=CjwKCAjwtJ2FBhAuEiwAIKu19lvqygIsvrOLzUxuZmnd9IcaFRnX5xaMKVEGes5rnV5vhOTWbjb06RoCW0sQAvD_BwE
There is one from JetBrains as well (dotTrace)
https://www.jetbrains.com/help/profiler/Profile_.NET_Core_Application.html
I have a Delphi Application with a Client-Server Architecture. Now, I want to write a Web-application for this Delphi Client-Server Application.
To write a this Web App I don't want to use Delphi - I want to use a "modern" Web Architecture like a PHP Framework, ASP.NET, Ruby on Rails etc.
So far i came to one possible Solution with RemObjects (http://www.remobjects.com/ro/) and ASP.NET:
In this approach the Delphi Application communicates with an ASP.NET WebServer over RemObjects where the Delphi Application is the REM Objects Server and the ASP.NET App is the Client.
My questions are:
Is this approach really a good idea and if not why?
What are other possible approaches to solve this problem?
Thank you for your help.
Edit:
Thank you for your answers so far!
How about establishing a neutral link like a Database?
You need a two-way messaging / inter process communication solution. Typically SOAP, REST and other web services (RemObjects) are synchronous, request-response style communication.
A messaging middleware can be implemented in a way which totally decouples the applications so that you can restart any part of the system (for example for maintenance and update installation) without disturbing the others.
Popular open source products in this field are for example Apache ActiveMQ, Open Message Queue and RabbitMQ, which offer cross-platform/cross language clients.
An alternative could be SOAP, or a RESTful connection.
R/O is faster than SOAP, for sure, and well integrated to both sides (Delphi and C#).
And, since you are already using R/O between Delphi client and Server, it will be the first option to consider.
IMHO any RESTful connection between Delphi Server and a C# client may do the work also. And will probably be faster, so is to be considered only in a second phase, if you find any performance or stability problem with a R/O connection.
I have been reading all over the place about the new MemoryCache class starting in .Net Framework 4.0. From what I've read, you can access the MemoryCache across different .Net applications. I am trying to share an object between an Asp.Net application and a standard windows forms .Net application. If I add the object to the MemoryCache in the .Net application, the Asp.Net application does not see it. Is there any way to accomplish this? Thank you for your time, it is greatly appreciated.
Windows Form App:
Dim cache As ObjectCache = MemoryCache.Default
Dim policy As New CacheItemPolicy()
policy.AbsoluteExpiration = DateTimeOffset.Now.AddMinutes(60)
cache.Set("testcache", TestObj, policy)
Asp.Net App:
Dim cache As ObjectCache = MemoryCache.Default
If IsNothing(cache("testcache")) Then Response.Write("TestCache Is Nothing")
Thanks -
Ryan
No, that's not possible. MemoryCache is not a distributed caching solution. So it will only be available locally.
If you are looking for a distributed cache alternative you may want to look into AppFabric or Redis.
However, it does sound a bit like an odd architecture to want to share the cache that way.
Maybe exposing a shared services layer, that both the asp.net and winforms consume, and have just the services implement the caching would seem more logical (take into account I actually know nothing about the problem you are trying to solve, so I could be wrong).
Caching is more commonly used for performance reasons, not as a way to share data among applications.
MySQL memory tables are working great and having stellar performance. 20/30 inserts a second and only around 1% CPU load.
I realize this advice is not timely, but for others reading this question, another possibility is Interprocess Communication (IPC) between the two programs. This way the two programs can exchange messages/data directly without going thru an intermediate.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx
From the documentation above, here are some of your options.
Clipboard
COM
Data Copy
DDE
File Mapping
Mailslots
Pipes
RPC
Windows Sockets
In your case, mapped memory files might be the best approach as it allows for a shared memory space between applications. Fundamentally, your MySql/Redis approach is probably not that different.
if you are interested in :
single server multiple applications - memory share
you should consider create web api at the same node and consume it (simple key value API)
and use simple Memory Cache provided by .net framework
multiple servers - memory share
free $$ solution
you can use "Distributed SQL Server Cache", allows the
distributed cache to use a SQL Server database as its backing store.
To create a SQL Server cached item table in a SQL Server instance,
you can use the sql-cache tool. The tool creates a table with the
name and schema that you specify.
if you have a cluster of nodes you can use NCache it is
an open source in-memory distributed cache developed natively in
.NET and .NET Core. NCache works both locally and configured as a
distributed cache cluster for an ASP.NET Core app running in Azure
or on other hosting platforms.
solutions that require paying money:
NCache mentioned previously, there's Professional and Enterprise solutions,
or
Redis Cache - Redis is an open-source in-memory data store, which is often used as a distributed cache. You can configure an Azure Redis Cache for an Azure-hosted ASP.NET Core app, and use an Azure Redis Cache for local development.
I'm having a look at the best way of developing a server application that presents an ASP.NET MVC front end for management/reporting.
The server app (service?) will also need to provide TCP listener as well as communicate to devices on a COM port.
The most obvious way I can think of doing this is to have an ASP.NET MVC web app and have a windows service that talks to the web app using a web calls/services. I guess then I'd talk to the service using the tcp listener or remoting?
The only other way would be to actually host an web server component in the service, and not use IIS which seems a bit to over the top.
Does anyone have any experience of this/recommendations?
It's a bit open ended but hope I've explained the basics.
TIA
Sam
I would probably try and decouple things a bit more.
Start off w/ a core project where all your business logic lies (agnostic of how users interact with it); sort of the DDD Domain Model idea.
Then, create two projects which consume that core project, one that is your MVC app, and another that's a WCF or ServiceStack-based service which can handle your TCP stuff.
Share state between them using the normal means; either inter-process comms, shared database, etc.
It sounds to me like you're looking for something very close to Windows Communication Foundation. Your requirements for IIS hosting, ASP.NET communication, and TCP communication. MSDN has a brief overview of WCF up here. There's also an article available about the transportation protocols here.
There are some good -- if a little old -- WCF questions here on Stack Overflow. I've just started delving into this world myself, and I have to admit that it's daunting at first. The Beginner's Guide (found under the first hyperlink above) has some slightly old, but very useful tutorial videos about WCF.
I will say that, although it may seem daunting or difficult, it's certainly better to use an existing, established technology for your purposes than to try to write your own homebrewed solution for something like this.
I started ServiceStack because I needed a high-performance web services framework option that promotes the correct way to develop web services.
ServiceStack can be run on top of any ASP.NET host or self-hosted using the HttpListener option. See the Starter Templates for example projects of a Console App or Windows Service hosts. Although even under IIS, ServiceStack is very fast and imposes very little overhead with a hello world service executing in sub <1ms response times.
ServiceStack also comes with .NET's fastest text serializers and a myriad of high-performance caching providers so you can escape the XML config bound ASP.NET's session and caching provider model.
Because ServiceStack encourages a clean message-based development model your same web services can take advantage of the Redis MQ Host allowing it to be invoked outside of HTTP context using Redis as a broker - with no code-changes required.
Redis is one of the fastest distributed NoSQL data stores.
I already have ASP.NET hosting, but I'm not sure how to run my application off Neo4j, since it requires a Java stack.
It seems my only options are:
Get separate Java/Linux hosting, and install Neo4J there, utilizing it as a database server.
Get Neo4J-as-a-service, (akin to what MongoHQ does for MongoDB users) but I haven't had any luck finding providers. Any advice here?
Move my whole application to Mono and then put it all on Java/Linux hosting and install Neo4j.
Any other ideas?
Yes there is such a thing very much indeed. We have just put Neo4j hosted in Windows Azure and as such it may naturally back an ASP.NET solution or any other front end solution that you might want to have!
Besides it is very easy to communicate with the Neo4j server from .NET since it speaks over HTTP using REST. It's as natural to speak to it as it is to speak with Windows Azure Storage.
http://neo4j.cloudapp.net/